Compare commits

...

1196 Commits

Author SHA1 Message Date
Ani 2b8eb8deb6 rpcs3_version: Bump to 0.0.14 2020-12-31 23:15:54 +03:00
Megamouse 7262f3d0b7 VK: make static chip_family_tables const 2020-12-31 22:57:17 +03:00
Megamouse 6f80fd0063 VK: move static chip_family_tables to cpp 2020-12-31 22:57:17 +03:00
Megamouse 7a51b7a019 VK: move helpers to vkutils 2020-12-31 22:57:17 +03:00
Megamouse d9eb31000d VK: refactoring part 1 2020-12-31 22:57:17 +03:00
Chris f8589de476 Initial playlist-based custom soundtracks support (#9362)
* Initial playlist-based custom soundtracks support

This is the initial implementation of playlist-based (cellSearch) custom soundtracks support.
It is based on the initial work by @Megamouse and currently uses a directory-based approach to manage albums and utilizes FFMPEG to read audio metadata.

Background: The real PS3 can import music in XMB from USB into its internal storage (/dev_hdd0/music) and additionally stores metadata (artist, trackname, tracknumber, ...) in a database (/dev_hdd0/mms/db/metadata_db_hdd). Games can make use of imported music via cellSearch.

For the time being, this implementation does NOT make use of metadata_db_hdd as the db-format is not well understood and a folder-based approch is easier to use. Users only have to create folders inside /dev_hdd0/music and add music to it to create a "playlist". This playlists contents will be sorted alphabetically. As a result, users could prefix numbers to the audio-files to force a specific order.

The only really supported audio format is MP3. I also added support for AAC, AC3, WMA, ATRAC3 and ATRAC3 plus, however, non of these formats were successfully tested for several reasons. AC3 and WMA are not enabled in the current FFMPEG build which makes reading codec-specific data impossible. We could enable these later if we want to. AAC actually could work but I was not able to get it working in WipeOut HD Fury. My guess is that the game does not support AAC. Finally, I could not find any ATRAC3 (or Plus) music to test with.

This implementation currently only implements parts of cellSearchStartListSearch() and cellSearchStartContentSearchInList(). There are several other functions which are still completely unimplemented and will probably be needed by other games. However, this implementation is a starting-point and is enough for WipeOut and maybe a few other games.

A video which showcases this custom soundtrack support is available here: https://www.youtube.com/watch?v=4nu1OCtONTY

Next steps:
 - Utilize sortKey in cellSearchStartContentSearchInList()
 - Eliminate TODOs
 - Implement the missing other functions
 - Test on more games - I do not own many that support custom soundtracks

Signed-off-by: gladiac1337 <gladiac@gmail.com>

Co-authored-by: Megamouse <studienricky89@googlemail.com>
Co-authored-by: Ani <ani-leo@outlook.com>
Co-authored-by: Ivan <nekotekina@gmail.com>
2020-12-31 22:47:09 +03:00
Florin9doi f1c61067bc Buzz! emulated controller (#9504)
* Buzz emulated controller
Co-authored-by: Florin9doi <Florin9doi@users.noreply.github.com>
Co-authored-by: Ivan <nekotekina@gmail.com>
2020-12-31 21:02:03 +03:00
Nekotekina 8a5620592b Implement util/fifo_mutex.hpp
Prototype. Uses 2 bytes.
Added minor fix to slow_mutex.hpp as well.
2020-12-31 20:07:50 +03:00
Nekotekina 5227e65808 vm: implement vm::atomic_op, fetch_op helpers
Can help to reduce lambda depth hell a little.
2020-12-30 20:11:02 +03:00
Eladash c4c6dc19a5 memory viewer: Implement SPU mode, fix address GOTO 2020-12-30 15:42:56 +03:00
Eladash 7fc26b1fab rsx: Implement Texture LOD Bias addend setting 2020-12-30 15:37:21 +03:00
Eladash c0e121abef rsx: Fix RSXTexture.h spacing 2020-12-30 15:37:21 +03:00
Eladash 7db13fdeff rsx: Move Anisotropic Filter Override to RSX state 2020-12-30 15:37:21 +03:00
JohnHolmesII e68027b464 Format: Update clang format
Old clang format file was extremely broken, causing issues when viewing
code on github, and also featuring stale values.

- Fix indentation information
- Force wrapping on lambdas
2020-12-30 15:24:43 +03:00
JohnHolmesII 220b69058c Docs: Update BUILDING.md 2020-12-30 09:03:24 +03:00
JohnHolmesII 9c3e55787e CMake: Update required Qt version 2020-12-30 09:03:24 +03:00
Malcolm Jestadt c952e99f3e SPU LLVM: Fix edgecase in icelake codegen 2020-12-29 22:01:11 +03:00
Nekotekina 35322b5d14 Remove deprecated _bit accessor from v128
Complicated (a lot of code), confusing (ambiguous)
2020-12-29 21:04:28 +03:00
Nekotekina 6b96807112 Reimplement utils::popcnt64
Implement utils::popcnt128
2020-12-29 15:28:02 +03:00
JohnHolmesII 57621d1c4e Types: Use nullptr over 0 2020-12-29 14:17:34 +03:00
JohnHolmesII e04b2eebc3 Warnings: Silence false warnings about fatal code paths 2020-12-29 14:17:34 +03:00
JohnHolmesII 02b684b810 Warnings: Warnings use kebab case, Mr. Kot 2020-12-29 14:17:34 +03:00
JohnHolmesII 76b1acf99d Warnings: Ensure death functions are all marked noreturn 2020-12-29 14:17:34 +03:00
kd-11 18c120ab9f rsx: Revert an accidental deletion 2020-12-28 21:49:11 +03:00
kd-11 f87dd91b52 rsx: Allow attempted fetch of non-existent surface 2020-12-28 21:49:11 +03:00
RipleyTom 4a8a161a43 Improve skylander portal emulator 2020-12-27 22:20:58 +01:00
Nekotekina e3dec420a2 vm_native.cpp: conditionally define c_madv_free 2020-12-27 12:19:50 +03:00
Nekotekina 1e32311a65 Use MAP_NORESERVE when available in mmap (Linux)
Used in: memory_reserve, memory_decommit (vm_native.cpp)
2020-12-27 10:20:42 +03:00
Marin Baron 92e5bb88e8 Remove std typeinfo 2020-12-27 00:30:16 +03:00
Eladash 66581d115b vm: Fix access violations on super memory, support super memory in vm::get_addr 2020-12-26 17:56:49 +03:00
RipleyTom 4399324955 Disables precompiled headers by default (#9499) 2020-12-25 20:41:49 +00:00
Florin9doi 733f31f90e Allow USB passthrough for THQ uDraw GameTablet 2020-12-25 14:27:24 +03:00
RipleyTom bef2c50b03 Remove bom in Utilities dir 2020-12-25 10:07:40 +03:00
kd-11 a96b4412d3 rsx: Do not rely on program env state, instead, always use program ucode analysis results when doing codegen
- Some things can be present in program env but not ucode state
  e.g A texture can be active and bound in a redirected manner but not actually be used in ucode
  In such a case, only the ucode analysis or decompilation can decide whether to inject decoding routines
2020-12-25 02:39:08 +03:00
kd-11 bee76fc8d1 rsx: Refactor shader codegen and fix shadow sampling on depth-float 2020-12-25 02:39:08 +03:00
kd-11 d9cb1a6319 vk: Fix more spec violations 2020-12-25 02:39:08 +03:00
Nekotekina 567d23d856 Implement util/auto_typemap.hpp
Used in vm::block_t as an example.
2020-12-24 14:55:25 +03:00
Eladash c94a98e15a Fix minor typo 2020-12-23 20:50:33 +03:00
Eladash 72e6e87d82 Fix SPU ELF loader 2020-12-23 20:50:33 +03:00
Eladash 0055d84bd6 Partial revert of 43c87e99b0 2020-12-23 08:25:56 +03:00
Eladash d17d22139e SPU Debugger: Print reservation data 2020-12-23 08:25:56 +03:00
Eladash 87b6284275 memory viewer: Only allow "words" steps in powers of 2 2020-12-23 08:25:56 +03:00
Eladash 2c6b974f24 Fixup memory viewer SPU headers for RawSPU 2020-12-23 08:25:56 +03:00
Eladash 020acc8235 GUI: Rewrite GOTO address tools in debugger tools 2020-12-23 08:25:56 +03:00
Nekotekina a8e0d261b7 types.hpp: more cleanup
Also fix compilation.
2020-12-22 19:08:09 +03:00
Nekotekina 6357b9a04f perf_meter.cpp: register only named threads
Can workaround some possible problems.
2020-12-22 14:32:30 +03:00
Nekotekina 43a58df8a0 Butcher narrow cast a little (don't print value).
Also remove some forward declarations from util/types.hpp
If they don't work properly, it's easier to remove them.
2020-12-22 14:32:30 +03:00
Nekotekina b7bf316c1a Don't randomly include "stdafx.h"
It's file for precompiled headers.
Include what is used, don't rely on transitive includes.
2020-12-22 14:32:30 +03:00
Nekotekina 41ee792f95 MSVC: remove MemLeak build support
There are better memleak detection tools.
1) Requires to guard placement new and external libs
2) Doesn't work thoroughly
2020-12-22 14:32:30 +03:00
Bird Egop 6c1b6c1704 Add PR-BUILD.md and Pull Request Template 2020-12-22 14:31:44 +03:00
Fro Zen acadaeed3a Change skylander variants to use hex 2020-12-22 08:58:36 +01:00
Jan Beich 96bde3df81 atomic.hpp: revert Clang < 11 workaround for u128 2020-12-22 09:00:34 +03:00
Jan Beich 5cb70ddbd5 CMake: bump minimum Clang to 11 2020-12-22 09:00:34 +03:00
Jan Beich b9b9a0465f CI: switch FreeBSD to Clang 11 (similar to e2303f3378) 2020-12-22 09:00:34 +03:00
Nekotekina bd269bccaf types.hpp: remove intrinsic includes
Replace v128 with u128 in some places.
Removed some unused files.
2020-12-21 21:11:25 +03:00
Nekotekina 5f618814f6 atomic.hpp: use u128 as storage for masks/values 2020-12-21 13:51:23 +03:00
Eladash 43c87e99b0 Debugger: Switch from NoThread when the emulation is running
And fix UpdateUnitList() when the emulation is stopped at initial startup.
2020-12-21 13:46:26 +03:00
Eladash 74a09a6338 PPU memory must be exec memory when using debugger's "Next Instruction" feature 2020-12-21 13:46:26 +03:00
Eladash 2b9c407dc3 Mask PC in debugger_frame::keyPressEvent for SPU
SPU only has 256kb of memory, need to work with this.
2020-12-21 13:46:26 +03:00
Eladash 59ed222205 Disasm: read instruction contents only once
Memory is volatile and may be changed by guest threads, ensure the decoded instruction matches with the data.
2020-12-21 13:46:26 +03:00
Eladash 2c06043617 Debugger: correctness fixes and cleanup
* Remove m_current_choice, it's not correct to rely on thread name entry. In extreme corner cases a newly thread can be created, old destroyed with the same entry name. (reoccuring LV2 SPU/PPU ID)
* Remove m_no_thread_selected, can be easily replaced with std::weak_ptr expired() function and is more accurate this way.
* In HandleBreakpointRequest: only remove breakpoint on valid PPU thread and not any thread! also fix potential nullptr deref if thread has recently been destroyed.
2020-12-21 13:46:26 +03:00
Eladash ef884642e4 Cleanup disasm classes a bit 2020-12-21 13:46:26 +03:00
kd-11 e449111c33 vk: Fixup for renderpass issues 2020-12-19 12:58:44 +03:00
Megamouse 066e53da55 minor cleanup 2020-12-19 08:33:53 +01:00
Eladash c74b2cb085 memory viewer: Fix resizing down 2020-12-18 21:00:09 +01:00
Nekotekina eec11bfba9 Move align helpers to util/asm.hpp
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina d254a5736b Fix bug with vector arg alignment in BIND_FUNC and callbacks. 2020-12-18 18:07:42 +03:00
Megamouse b655e4aa47 Emu: implement on_exit callback 2020-12-18 16:05:40 +01:00
Nekotekina 1adec3d8e5 Hotfix: Emu.Quit after Emu.Stop 2020-12-18 13:37:14 +03:00
Nekotekina db9b7db531 Cleanup and move sysinfo.h -> util/sysinfo.hpp 2020-12-18 12:55:54 +03:00
Nekotekina 05099e2ae1 Replace uint64_t with u64 2020-12-18 12:23:53 +03:00
Nekotekina 77352a2a86 Replace uint32_t with u32 2020-12-18 12:23:53 +03:00
Nekotekina ae633292c0 Replace int32_t with s32 2020-12-18 12:23:53 +03:00
Nekotekina d6042cf891 Replace uint16_t with u16 2020-12-18 12:23:53 +03:00
Nekotekina 534c63bf57 Replace uint8_t with u8 2020-12-18 12:23:53 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina 360c4d1554 Simplify f16 type 2020-12-18 12:23:53 +03:00
Nekotekina 4cfa9b11f3 Move busy_wait() to asm.hpp 2020-12-18 12:23:53 +03:00
Megamouse 908465b274 memory viewer: improve layout and resize 2020-12-18 09:58:12 +01:00
Megamouse a7f10d142e fix warning 2020-12-18 09:58:12 +01:00
Megamouse e855673802 memory viewer: check width and height in image viewer 2020-12-18 09:58:12 +01:00
Megamouse 112ac7bd13 memory viewer: fix RGB Image viewer crash 2020-12-18 09:58:12 +01:00
Megamouse ec7963df3d memory viewer: use enum for color formats 2020-12-18 09:58:12 +01:00
Megamouse 343d006ae2 memory viewer: more cleanup 2020-12-18 09:58:12 +01:00
Megamouse ed8e5498d1 memory viewer: fix horrible overflow that freezes rpcs3 2020-12-18 09:58:12 +01:00
Megamouse 3cfead4ca6 memory viewer cleanup 2020-12-18 09:58:12 +01:00
Eladash c8947eee6a GUI: Make memory viewer address edit accept 0x/0X prefixes
Max length is 10, added regexp validator accordinally.
2020-12-17 22:57:13 +01:00
Eladash 6c1ca7d797 GUI: Polish the memory viewer 2020-12-17 22:57:13 +01:00
Eladash 2172974db9 Link the memory viewer with the debugger 2020-12-17 19:36:35 +01:00
Eladash ba03df8511 GUI: Improve PS3 decryption tool 2020-12-17 18:49:04 +01:00
kd-11 fb47d1f788 vk: Register ampere GPU PCI IDs 2020-12-17 19:56:48 +03:00
Nekotekina 3c86e14ea4 Fix hexadecimal line numbers in error reports 2020-12-17 17:00:06 +03:00
Nekotekina c16fb61bea fixed_typemap.hpp: Fix assignment operator for g_ptr
Maybe RPCS3 hangs will finally be gone.
2020-12-17 16:47:25 +03:00
Nekotekina 2acead357b Update LLVM commit (minor fixups) 2020-12-17 16:47:25 +03:00
kd-11 235db57f0e rsx: Do not reset vertex program texture mask when updating ucode analysis
- Fixes incorrect texture type detection in some games after program env/ucode separation
2020-12-17 09:36:20 +03:00
kd-11 cfbde005fb vk: Force ampere GPUs to use the slower but spec-compliant depth-color resize route
- TODO: More investigation and optimizations
2020-12-17 09:36:20 +03:00
kd-11 0a865bd9dc vk: Workaround for validation layers bug 2020-12-17 09:36:20 +03:00
Nekotekina 6b3f722ff0 Hotfix: useless error 2020-12-16 11:57:29 +03:00
Fro Zen 3dbecada4e Almost all Skylander variants (#9443)
* Update skylander_dialog.cpp

* Fix formatting, sorted

* Support for skylanders variant

* Remove duplicate Legendary Hand of Fate

* Removed accidental Series 2 Dark Spyro

There is no series 2 dark spyro, also im removing these as im finding them so sorry if theres tons of commits

* Add LightCore Hex

* Remove Vehicle tag

* Add Big Bang Trigger Happy

Co-authored-by: RipleyTom <RipleyTom@users.noreply.github.com>
2020-12-16 11:02:59 +03:00
Megamouse d21f87af5d Fix unresponsive UI during SPU compilation 2020-12-16 11:01:51 +03:00
Megamouse 0bfec59af8 Fix stop during shader compilation 2020-12-16 11:01:51 +03:00
kd-11 035a76f26d Fix build 2020-12-16 10:10:06 +03:00
kd-11 42f4e831a2 vk: Clean up some leftovers from shader decompiler rewrites 2020-12-16 10:10:06 +03:00
kd-11 d3686dbb75 rsx: Add some texture upload statistics to the texture cache 2020-12-16 10:10:06 +03:00
kd-11 fb1c790350 rsx: Make debug overlay dynamic 2020-12-16 10:10:06 +03:00
kd-11 0ef5743261 rsx: Fix sampler descriptor updates for framebuffer resources
- Each desc manages its own lifetime now instead of relying on global timestamp check
- Fixes situation where same object remains active without update for long
2020-12-16 10:10:06 +03:00
Nekotekina e82bef425f vm: fix warnings and add narrow cast for u64 ptrs 2020-12-15 20:10:16 +03:00
Nekotekina 24c246a9f6 Fix potential thread_pool crash on exit
Minor issue.
2020-12-15 20:01:26 +03:00
Nekotekina e39348ad96 Make lf_queue<> compatible with atomic_wait 2020-12-15 19:19:36 +03:00
Nekotekina ca5f0444bf shared_ptr.hpp: add wait support for atomic_ptr<>
As well as default mask and value transformation function overload.
2020-12-15 12:52:21 +03:00
Nekotekina 4a883ba6ea atomic.hpp: use SFINAE for waitable atomic detection
Add default_mask<> variable.
Refactor get_value<>().
2020-12-15 12:50:44 +03:00
Eladash bfe1a8673a PPU: Allow HLE execution from pure instruction decoder type interpreter 2020-12-15 11:18:51 +03:00
Eladash 0445ef393f FW SPRX install: Fix IDM ID's leak 2020-12-15 11:16:45 +03:00
Eladash 7eb16e13bb PRX loader: Fix libfs_155.sprx loading
Fix relocations' segments referencing when there are "empty" (memsize=0) LOAD segments.
2020-12-15 11:16:45 +03:00
Megamouse 03ad5c6830 Salvaging code (#9432)
* Minor input refactoring

* fix sys_config_unregister_io_error_listener log message

* Remove unused variables in RepaintTextColors

Co-authored-by: GermanAizek <GermanAizek@yandex.ru>
2020-12-14 14:33:43 +01:00
Megamouse ab23e5ca0e Minor tooltip grammar fix 2020-12-14 09:01:07 +03:00
Megamouse 35ecd00559 Remove BOM from new files 2020-12-14 09:01:07 +03:00
Eladash e5603fec1e Firmware libraries settings overhaul 2020-12-13 21:52:24 +03:00
Nekotekina e321765c54 Split BEType.h to util/v128.hpp and util/to_endian.hpp 2020-12-13 16:34:45 +03:00
Nekotekina 62fdcf50ea vm: initialize g_pages at vm::init
Can reduce compile time/overhead.
2020-12-13 15:39:36 +03:00
Nekotekina 09d293592e shared_ptr.hpp: fix is_same_ptr<>() trait
Implemented as constexpr function.
2020-12-13 15:39:36 +03:00
kd-11 f83c2f0b6b rsx: Restructure and simplify some header include chains 2020-12-13 15:38:35 +03:00
kd-11 d775c8dc73 rsx: Move shader analysis+prefetch to the end of the draw call 2020-12-13 15:38:35 +03:00
Fro Zen 8e07b19bc7 Add variant support for Skylanders (#9424)
* Update skylander_dialog.cpp

Co-authored-by: RipleyTom <RipleyTom@users.noreply.github.com>
2020-12-13 14:30:38 +03:00
Luke Barr cb8ef46ec7 Initial DualSense Support (#9308)
* Initial DualSense Support

* Add Vibration Support

* Add CRC32 Validation to Incoming Bluetooth Packets
Cleanup report sizes

* Consistency, remove button comments, add two buttons.

Co-authored-by: Ani <ani-leo@outlook.com>
2020-12-13 00:00:45 +01:00
Fro Zen ee814cfd0c Update skylander_dialog.cpp (#9419) 2020-12-12 19:16:15 +03:00
Nekotekina a6a5292cd7 Use uptr (std::uintptr_t alias) 2020-12-12 16:29:55 +03:00
Nekotekina b59f142d4e Move types.h to util/types.hpp 2020-12-12 15:12:01 +03:00
Nekotekina 666a18f5e5 Remove ceil2/floor2 from types.h 2020-12-12 15:12:01 +03:00
Nekotekina dff4392c10 Move error_code to ErrorCodes.h 2020-12-12 15:12:01 +03:00
Nekotekina b09b7c1184 Remove any_pod<> from types.h
Add simplified any32 to GCM.h
Add simplified cmd64 to PPUThread.h
2020-12-12 13:12:39 +03:00
Nekotekina 6e05dcadb6 Reduce std::numeric_limits dependency
Please, stop pretending...
You need these templates for generic code.
In other words, in another templates.
Stop increasing compilation time for no reason.
2020-12-12 12:35:18 +03:00
Nekotekina bc7acf9f7a RSX: remove overly long integer sequence (opcode_list)
Convert to constexpr array and move to gcm_printing.cpp
2020-12-12 11:38:35 +03:00
Nekotekina cb19316a17 Fix u128 constructors (MSVC) 2020-12-12 09:54:39 +03:00
Nekotekina 33c3977036 endian.hpp: minor simplification
And stop pretending...
2020-12-11 22:00:26 +03:00
Nekotekina 7a015b6fc0 VKMemAlloc.cpp: use shared_mutex in vk_mem_alloc.h
Because it allows to use custom implementation.
Also fix compilation.
2020-12-11 19:05:11 +03:00
Nekotekina aa3aef4beb std::chrono cleanup: always use steady_clock 2020-12-11 19:01:56 +03:00
Nekotekina 12a48fc6d1 Fixup for fs::file::read 2020-12-11 07:33:15 +03:00
Nekotekina 72284b4530 Use atomic_t<> in VKMemAlloc 2020-12-10 18:58:11 +03:00
Nekotekina 65c04e4ddd Remove constexpr from ppu/spu decoders.
We don't need them at compile time (yet).
But can reduce compile time and complexity.
2020-12-10 15:06:01 +03:00
Nekotekina b382d3b3e9 Remove ASSUME macro
It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
2020-12-10 14:08:02 +03:00
Nekotekina 61b882b2a6 Always print system error code on 'throwing' errors.
Print system error code in src_loc fmt.
Error code may be irrelevant though.
2020-12-10 12:43:49 +03:00
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +03:00
kd-11 d25c401aec vk: Validate image creation inputs
- Should avoid things like res scaling breaking when very large scaling is in use
2020-12-09 21:30:08 +03:00
kd-11 aac874a842 vk: Add even more D32_SFLOAT missing locations 2020-12-09 21:30:08 +03:00
Nekotekina 5d934c8759 Improve narrow() and size32() with src_loc detection 2020-12-09 16:26:20 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
Nekotekina 38745e5782 SPU ASMJIT: fixup mfence replacement 2020-12-09 11:15:40 +03:00
RipleyTom d0c271e534 Simplify g_pages
This was done because otherwise msvc runs out of heap space on azure.
2020-12-09 11:15:08 +03:00
RipleyTom 33635c5723 Set msvc toolkit back to mainline 2020-12-09 11:15:08 +03:00
kd-11 f8d2830ac7 vk: Properly register D32_SFLOAT as a depth-stencil format (#9396) 2020-12-09 02:06:27 +00:00
Megamouse a7e5c255b4 Qt 5.15.2 (#8867)
* Qt15: replace deprecated stuff

* Use Qt 5.15.1

* Move windows to Qt 5.15.2

* Move Ubuntu to Qt 5.15.2
2020-12-08 22:22:08 +01:00
Nekotekina 062c605eb1 atomic.hpp: fixup (rsp addressing) 2020-12-08 08:51:27 +03:00
Eladash 2602be426f Allow emulation to work without firmware (#9367)
* Allow emulation to work without firmware
* Fix HLE prx path detection.
* Fix manual list loading bugs.
* Fix HLE gcm
* GUI: Fix fonts search
* GUI: Hardcode sprx list
Do not depend on /dev_flash/sys/external/ contents.
2020-12-07 20:10:34 +03:00
RipleyTom 51dcb4a79d Remove bom from .hpp files 2020-12-07 20:03:44 +03:00
Nekotekina 24e4e329ed atomic.hpp: add atomic_t<bool> specialization
May be required in future, plus adds/hides some methods.
2020-12-07 17:13:12 +03:00
Nekotekina eb66302907 atomic.hpp: replace std::atomic with atomic_t
Dual dependency is nothing good.
2020-12-07 17:13:12 +03:00
Nekotekina b16cc618b5 atomic.hpp: add some features and optimizations
Add atomic_t<>::observe() (relaxed load)
Add atomic_fence_XXX() (barrier functions)
Get rid of MFENCE instruction, replace with no-op LOCK OR on stack.
Remove <atomic> dependence from stdafx.h and relevant headers.
2020-12-07 17:13:12 +03:00
Nekotekina 77aa9e58f2 shared_ptr.hpp: add trivial conversion for shared/single types
These conversions don't exist in std::shared_ptr-alike types.
But I don't want to bother with == operators until we have proper C++20.
Removed trivial conversion for atomic_ptr because it's heavyweight.
2020-12-07 15:33:28 +03:00
kd-11 3a0b3a85a5 rsx: Separate program environment state from program ucode state
- Allows for conservative texture uploads
- Allows to update a program object without running full ucode analysis for no reason
2020-12-07 00:45:27 +03:00
Eladash 15a12afe25 Debugger: Implement code flow tracking 2020-12-06 15:32:13 +03:00
Eladash 427cf91447 Debugger: rewrite GetPc() 2020-12-06 15:32:13 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
RipleyTom 7b694ebeb4 Set default to utf-8 for MSVC 2020-12-06 15:30:12 +03:00
Nekotekina d1e7837422 atomic_t: cleanup type requirements
Add C++17 requirements.
Remove alignment requirements (auto-align type).
What's missing is to detect padding and forbid it.
2020-12-04 19:11:36 +03:00
Nekotekina 8efc22bd45 atomic.hpp: simplify and unify bit test instructions
Also make them available on all platform.
Rename some rare methods.
2020-12-04 14:33:38 +03:00
Nekotekina 983439076b shared_ptr.hpp: fixups and updates
Fix atomic_ptr load() edge case.
Implement atomic_ptr::peek_op() to make possible to reduce load() overhead.
Implement atomic_ptr::compare_exchange() and friends.
Implement null_ptr constant, remove nullptr_t assignment/construction.
2020-12-04 14:10:53 +03:00
Nekotekina 019f566239 atomic.cpp: more phase splitting in notify_all() 2020-12-04 14:10:53 +03:00
Nekotekina 332410d20b shared_ptr.hpp: improve atomic_ptr methods 2020-12-04 14:10:53 +03:00
JoãoPaulo c2a85bde08 Update FW 4.87 Latest Version (#9366)
Updates the latest FW version according to: https://www.playstation.com/en-us/support/system-updates/ps3/
List of changes:
・ Updated blu-ray keys for new movie releases
・ Minor security fix
2020-12-03 18:16:38 +01:00
Nekotekina 13a0b88755 atomic.cpp: improve hashtable access
Simplified, tried to use all ptr bits.
Try to prevent self-collisions (bug).
Hashtable size doubled (to 8 MiB).
2020-12-01 10:19:31 +03:00
Nekotekina 32f39fec1c Make cpu_counter::remove() async
Remove both mutex and assertion from it.
2020-12-01 10:18:41 +03:00
Nekotekina cad3a6c547 sceNp.cpp: fix some UTF-8 string mismatch 2020-11-30 03:21:34 +03:00
kd-11 2aa5c437e8 rsx: Fix upscaled image reconstruction
- Base the upscaling on the real source and not the "attr" parameter.
- In case of reconstruction, the source is much larger than the subslice in "attr"
2020-11-30 01:20:17 +03:00
kd-11 67f48ce21c rsx: Fix uncaught depth-func changes
- Depth func of always or never usually disqualifies depth testing.
  Invalidate contested surfaces when depth func is changed.
2020-11-30 00:46:36 +03:00
kd-11 845a7d9968 Fix RSX replay thread lifecycle 2020-11-29 22:39:52 +03:00
Dylan Fenn 924774d3ef Add missing Fedora dependancy to BUILDING.md 2020-11-29 21:41:03 +03:00
Nekotekina e0635cf65c Remove unneeded non-ASCII character (unedat.cpp) 2020-11-29 16:18:22 +03:00
Nekotekina 3b8e3a9714 stdafx.h: remove BOM from custom included headers
Also add warnings about adding them.
2020-11-29 15:35:05 +03:00
Nekotekina 2bee096246 Try to set 2-3 GiB working space and show error if it's failed (Windows) 2020-11-27 14:49:07 +03:00
Nekotekina 872655369a shared_ptr.hpp: fix critical bugs
Fix array initialization.
Fix reference counting.
Fix offset to refctr.
Add some features.
2020-11-27 14:32:41 +03:00
Nekotekina 0892758994 Minor debugging enhancement
Use raise(SIGTRAP) in failed SIGSEGV handling and return.
2020-11-26 20:11:26 +03:00
Nekotekina 22a24446c1 Threads: fix minor race
Has already been in "fixed" state in past...
2020-11-26 20:11:26 +03:00
Nekotekina b5d498ffda Homebrew atomic_ptr rewritten (util/shared_ptr.hpp)
It's analogous to C++20 atomic std::shared_ptr

The following things brought into global namespace:
single_ptr
shared_ptr
atomic_ptr
make_single
2020-11-26 20:11:26 +03:00
Nekotekina bd90e3e37f atomic.cpp: shrink and simplify main hashtable
Reduce collision detection to 1 or 0 for now.
I think it should be offloaded to notifiers.
2020-11-26 20:11:26 +03:00
Nekotekina 8b6d615aa6 atomic.hpp: remove/deprecate incomplete notify features
Notification with "phantom value" could be useful in theory.
As an alternative way of sending signal from the notifier.
But current implementation is just useless.
Also fixed slow_mutex (not used anywhere).
2020-11-26 06:31:36 +03:00
Megamouse 9e352da052 Handle some undefined behavior regarding null pads 2020-11-26 00:45:49 +01:00
Nekotekina ca9898e838 JIT: increase likeliness of allocating 2M large pages
On top of enabled transparent hugepages hint (Linux).
2020-11-25 10:41:17 +03:00
Nekotekina 95b8467a76 perf_meter.hpp: move logic to noinline function
May improve performance if perf meter is disabled.
2020-11-25 10:41:17 +03:00
Nekotekina 2b674d4d8c utils::shm: allow 2M hugepages on demand 2020-11-25 10:41:17 +03:00
Nekotekina 487b572aa6 Linux: remove assertions on MADV_HUGEPAGE
It's a hint and is allowed to fail.
2020-11-25 10:41:17 +03:00
Nekotekina 600c0ea5ba atomic.cpp: fix windows/std path
Always check condition after rearming internal semaphore.
2020-11-25 10:41:17 +03:00
Nekotekina 00e64920c8 Implement "slow mutex" without spin-waiting.
Benefits: only 1 byte.
Testing atomic wait.
2020-11-25 10:41:17 +03:00
Megamouse 9efedbe76a Minor changes related to Emu.Stop() 2020-11-25 00:11:07 +01:00
Nekotekina d8e9382573 asm.hpp: constexpr refactoring
Removed asm (what an irony), made many functions constexpr.
Removed some unused function, readding them should be trivial.
2020-11-24 13:20:40 +03:00
Nekotekina ab248e170c vm_native.cpp: add MADV_HUGEPAGE
It enables Transparend Huge Pages for some regions on Linux.
Although it can't be actively useful, it seems to do something.
Maybe it's even harmful for recompilers.
2020-11-24 12:31:11 +03:00
Nekotekina 27097cbcfe atomic.hpp: alter atomic_storage<>::store a bit
Always fallback to exchange. May improve codegen on gcc.
2020-11-24 12:31:11 +03:00
Nekotekina 43952e18e2 Implement prefetch_write() and prefetch_exec() wrappers
Do some refactoring to prefetch_read() in util/asm.hpp as well.
Make all these function constexpr because they are no-ops.
2020-11-24 12:31:11 +03:00
Megamouse 5076da8f77 Fix auto exit
- Don't quit on stop if force boot was set
- Don't stop the emulator on gs_frame close when it was already stopped. This would remove the force boot flag by mistake.
2020-11-24 11:17:03 +03:00
kd-11 8228a4adcd gl: Disable depth test before rendering text to the backbuffer which does have a Z buffer 2020-11-24 11:10:43 +03:00
Nekotekina 721883f64e Azure: attempt to produce clang artifact 2020-11-24 08:11:45 +03:00
Nekotekina b55c759f71 Remove any mentions of scam CI 2020-11-24 08:11:45 +03:00
Eladash 3f028fbb83 Fix SPU LS MMIO 2020-11-24 03:44:30 +03:00
Nekotekina f0cba1371c vm: adjustments
Increase max range lock size (less than 512 MiB)
Remove "range_executable" flag, make it reserved.
2020-11-24 01:09:04 +03:00
Nekotekina 14fa96fdef atomic.cpp: don't use empty notify callback
Instead, allow setting it to null and check for null.
Similar could be done for wait cb, but it's set for all named threads.
2020-11-24 01:09:04 +03:00
Nekotekina b954a41f2a Threads: minor simplification 2020-11-24 01:09:04 +03:00
kd-11 f1c65dcefc vk: Improve support for RDNA
- Add support for RDNA2
- Add RDNA MSAA workaround
2020-11-23 19:20:00 +03:00
Nekotekina d4c17ecda5 Simplify communication with thread pool
Add "entry_point" member to "thread_base".
Don't use "m_thread" to exchange values.
2020-11-23 11:32:34 +03:00
Nekotekina a4458e2c8c Clean thread pool at exit.
Execute TLS destructors.
Test atomic wait list.
2020-11-23 10:20:42 +03:00
Nekotekina 16cc88dd0e atomic.hpp: fix atomic_wait::list regression
Typo-regressions. Also improve static asserts.
2020-11-23 09:26:25 +03:00
Nekotekina 280f5f0b54 atomic.hpp: redefine op::ne to actually mean "not equal"
WTF is "native endianness", it's native by default.
2020-11-23 09:24:16 +03:00
Nekotekina e38eaa7cd7 Remove old travis badge (kill it with fire) 2020-11-23 09:22:51 +03:00
Zion Nimchuk a27bd2275c Pushing master AppImage Artifacts to GitHub Releases via Azure 2020-11-23 06:50:27 +03:00
Nekotekina 7d00c69a4f Attempt 2: Try to make Azure push linux builds 2020-11-22 19:24:54 +03:00
Nekotekina a2c189b45a Azure: try to deploy GCC artifact (upload to github) 2020-11-22 18:29:46 +03:00
Nekotekina 41320688b7 Removed .travis.yml
Non-functional CI
2020-11-22 17:03:35 +03:00
Nekotekina f85c8584b0 Attempt to fix #9316 2020-11-22 12:57:50 +03:00
Nekotekina 6cf50f8f6c Second attempt to fix hanging RPCS3 process
Now fix exit logic a bit.
Remove Init() call from Stop().
Remove Stop() call from Quit().
2020-11-22 12:45:19 +03:00
Nekotekina d70ab11477 atomic.cpp: remove redundant constexpr
Static initialization is all-zeros anyway.
But constexpr was killing my intellisense.
And probably also affected compile time.

Also make some internal structures hidden ("static").
2020-11-22 12:07:49 +03:00
kd-11 cab4c78b7b rsx: Some shader compiler threads tuning
- Allow more threads for wide CPUs
- Simplify 'auto' selection a bit
2020-11-21 20:43:15 +03:00
kd-11 14358d5e84 qt: Add shader compiler threads to GUI 2020-11-21 20:43:15 +03:00
kd-11 7553429130 gl: Thread shader source compilation dispatch
- glCompileShader is in itself much slower than anticipated
2020-11-21 20:43:15 +03:00
kd-11 3ddfa288cf rsx: Use multithreaded shader compiler backend 2020-11-21 20:43:15 +03:00
Nekotekina e89a568765 Attempt to fix Emu.Quit()
There was some kind of "initialization order fiasco" of g_fxo.
Not only should it be used after main, but also destroyed before exit.
2020-11-21 18:27:16 +03:00
Nekotekina 71f1021648 Fix thread pool entry point and get_cycles()
Fix possible race between thread handle availability.
Don't treat zero thread as invalid one.
Now entry point is full is assembly.
Attempt to fix #9282
Also fix some TLS.
2020-11-21 17:18:42 +03:00
Nekotekina 60cff6f3d4 Attempt to fix #9271 2020-11-21 07:09:48 +03:00
Nekotekina 5f010c2f4c atomic.cpp: optimize "cond" allocation with TLS
Billions of events can reduce to thousands, saving CPU time a few s.
Only 4 slots are available (arbitrarily), and only 1 is usually used.
Other slots are used only for waiting on multiple atomics.
2020-11-20 19:13:22 +03:00
Nekotekina c0f3d1f06d Basic constexpr support for u128 (MSVC)
Added explicit conversion op to u64.
Added constexpr path for +,-,>>,<< ops.
Make almost all methods constexpr.
Removed a lot of redundancy.
2020-11-20 15:04:17 +03:00
Nekotekina 6c18e00977 atomic.cpp: use deterministic "cond" allocation
Takes ~80 ns instead of ~40 ns, same about deallocation.
Loops don't exist here, only 4-level semaphore tree.
Worst case only happens with concurrence, not from looping.
This optimization is not really necessary at current state of RPCS3.
This is more like to test C++ compilers and MSVC u128 implementation.
2020-11-20 15:04:17 +03:00
Nekotekina 72ac1aa537 atomic.cpp: use some actual hash for hashtable (std::minstd_rand)
Should only take about 5ns for initialization.
Should also make collisions almost impossible.

I also suspect I fixed some bad bug in process...
2020-11-20 15:04:17 +03:00
Nekotekina 5bcaa25c02 CPU: remove descheduled threads from suspend_all list 2020-11-20 13:53:34 +03:00
Eladash 85880ffded SPU: Log STOP full opcode (#9292)
Co-authored-by: Ani <ani-leo@outlook.com>
2020-11-20 13:53:16 +03:00
Megamouse 5b207c3b95 hotfix for infinite loop when booting game data 2020-11-19 23:53:10 +01:00
Megamouse 3087f15dd8 Update disc boot detection and hope it works 2020-11-19 21:55:06 +01:00
Nekotekina 36f1193497 Fix u128 type on MSVC (subtraction, minus)
All subtraction operations were broken.
2020-11-19 16:38:06 +03:00
Nekotekina 292af1e4cd CPU: use u128 in bit counter
Apparently, u64 was not enough.
2020-11-19 16:05:08 +03:00
Nekotekina d4d5dc99f3 Fix perf_meter<> after adding thread pool.
Print and reset sorted information after emulation stop/pause.
Print useless average value.
2020-11-19 14:44:58 +03:00
Nekotekina 3e1344e4e4 vm.cpp: minor optimization for filling stack guards
Use REP STOSQ on all compilers.
2020-11-19 14:44:58 +03:00
Nekotekina 6d37bc62a5 CPU: remove cpu_counter from g_fxo
Convert it to a namespace, simplify add/remove functions.
Don't add() threads just creates, they are trapped in check_state() anyway.
Don't add() threads which are leaving check_state() because stopped.
2020-11-19 09:46:22 +03:00
Nekotekina e9f7c100a0 CPU: update suspend interface (dummy) 2020-11-18 19:15:56 +03:00
Nekotekina 190676c982 CPU: Fix g_suspend_counter waiting logic 2020-11-18 14:38:01 +03:00
Eladash 28cbba5a7d SPU LLVM: fix AND instruction family (#9290)
Incorrect immediate test (looks like copypasta)
2020-11-18 14:36:26 +03:00
kd-11 0e7a705254 rsx: Resolution scaling overhaul
- Enforce square pixels instead of per-axis scaling
2020-11-18 09:29:34 +03:00
Nekotekina 68931b4c43 Debugger: fill stack guard with STACKGRD 2020-11-17 16:32:59 +03:00
Nekotekina a4e28df9cf Update hidapi 2020-11-17 15:40:09 +03:00
Nekotekina 65c81c5e83 Fix memory viewer for SPU LS 2020-11-17 15:22:04 +03:00
Nekotekina ccd0d2046d SPU: increase max SPU count
According to max SPU TG count.
2020-11-17 15:22:04 +03:00
Nekotekina 0fec99e75b SPU: absolutely unacceptable hack for SPU LS
Make normal threads inaccessible in PS3 memory.
2020-11-17 15:22:04 +03:00
Nekotekina f8d1f070f5 sys_memory: HORRIBLE HACK for sys_memory_get_page_attributes 2020-11-17 15:22:04 +03:00
Nekotekina 3dd48a24ce atomic.cpp: remove tiny redundancy 2020-11-17 15:22:04 +03:00
Nekotekina 984e97cbdc Potential fix for Linux compilation 2020-11-17 15:22:04 +03:00
Eladash 50ea1a12c9 Debugger: Fix scrolling in first registers panel 2020-11-17 09:39:39 +01:00
Eladash 992a372fc7 cellGame fixes 2020-11-17 09:04:35 +01:00
Nekotekina d789250976 Add thread_ctrl::get_thread_stack
Returns addr and size of current thread's stack.
2020-11-17 05:33:46 +03:00
Nekotekina d7e1cf7dd2 vm: respect initial protection for allocation mapping
Unused yet.
2020-11-17 05:33:46 +03:00
Nekotekina ea5f5aea5f vm: memory locking rewritten
Added vm::lock_sudo method (wrapper for utils::memory_lock).
Put locking outside of vm::g_mutex scope.
Prelock sudo memory for RSX, vm::stack, vm::main.
Prelock sudo memory for shared memory objects.
Don't check for TSX path.
2020-11-16 12:46:15 +03:00
Nekotekina eaf0bbc108 SPU: don't allocate SPU LS in vm::main
Create its own shared memory object.
Use vm::spu to allocate all SPU types.
Use vm::writer_lock for shm::map_critical.
2020-11-16 12:46:15 +03:00
Eladash b1710bb712 SPU Debugger: Implement float registers view + General debugger fixes (#9265)
* SPU Debugger: Fix try_get_insert_mask_info
* Debugger: Always update thread state on context's data change
No longer needing to press on thread's instructions for actions to work!
2020-11-15 08:45:28 +03:00
Nekotekina dfae7bd073 SPU: Fix some stat printing 2020-11-15 04:41:16 +03:00
Nekotekina 333fe9a561 atomic.cpp: fix notification on windows 2020-11-15 04:40:44 +03:00
Nekotekina badb3dc2dd atomic.cpp/threads: remove old wait callback
Add new wait callback which simply collects statistics.
Shift workarounds towards actual problem detection.
2020-11-14 18:16:27 +03:00
Nekotekina 3ac819ee70 atomic.cpp: fix waiting on multiple variables
Silly bugs are so silly...
2020-11-14 17:25:02 +03:00
Nekotekina 00f877e812 atomic.cpp: fix rare overload scenario
If slot allocation fails, increase reference counter in every slot.
This prevents search routine from "losing" some slots.
2020-11-14 13:56:23 +03:00
Nekotekina 1e269751bf Temporarily disable memory locking if TSX is not used
It's a very heavy operation that could cause some problem under mutex lock.
2020-11-14 11:12:58 +03:00
Nekotekina 5b69eda39a Fix suspend_all bug (TSX, TSX-FA)
Could cause freezes.
2020-11-14 10:56:05 +03:00
Nekotekina 71ca413067 Don't add lonely cpu_flag::memory on TSX path (bug) 2020-11-14 09:03:33 +03:00
Nekotekina 0c7f9458c0 Fix thread pool resource management.
Make sure no tail call happens (change ret address to a trampoline).
Make sure thread handles don't leak if the pool is full.
2020-11-13 17:17:45 +03:00
Nekotekina ab365fe494 Fixed thread pool a bit
Use 128-bit allocator instead of queue.
When pool is full (128), threads just terminate as before.
2020-11-13 13:32:44 +03:00
Nekotekina e48f160a29 atomic.cpp: continuation of fixing all-ones masks
Also added missing const noexcept.
2020-11-13 12:40:02 +03:00
Nekotekina cfda4d0ade atomic.cpp: optimize raw_notify() for unspecified pointer mode
Remove unnecessary optimization from cond_alloc().
Optimistic case was absolutely dominating anyway.
Although the whole function is a dirty hack.
Now scanning through all threads is faster.
2020-11-13 07:05:33 +03:00
RipleyTom debfae06a8 Improve disconnected state handling of dns queries 2020-11-13 07:05:06 +03:00
RipleyTom e6f2f8ad0d Add some error checking in sceNp2.cpp 2020-11-13 05:28:00 +03:00
Nekotekina 67785a918c Implement simple thread pool 2020-11-13 03:32:24 +03:00
Nekotekina 50d80c64fa Add .gdbinit config file
Set to ignore SIGSEGV and SIGPIPE signals.
2020-11-12 23:43:38 +03:00
RipleyTom 1378645413 Adds SIGPIPE to ignored exceptions(unix) 2020-11-12 07:08:59 +03:00
Nekotekina 3888b0429c atomic.cpp: print some stats on stop 2020-11-12 05:52:22 +03:00
Nekotekina 70761a4ef0 atomic.cpp: fix notification bug from few commits before
Make sure forced notification ignores mask comparison.
Also fix masks provided by smaller types to correct ones.
2020-11-12 05:01:44 +03:00
Nekotekina e37df998e9 atomic.cpp: minor optimization
Silly MSVC emits unnecessary initialize-on-first-use code guards.
Didn't check other compiler. But workaround just works anyway.
2020-11-12 03:41:19 +03:00
Nekotekina c30cdfb3a7 atomic.cpp: merge more atomic variables for simplicity
Compress 16-bit ref counter and two 48+64 bit slot allocators.
This allowed to remove some weird unnecessary logic paths.
Adjust hashtable size to keep it the same.
2020-11-12 03:39:05 +03:00
Nekotekina 350b704cd7 atomic.cpp: combine two atomics (ref ctr and wait ptr)
Should fit into cache line perfectly.
Also makes ptr check more robust.
2020-11-12 01:06:12 +03:00
Nekotekina ad013d59f4 atomic.cpp: don't load actual memory on empty mask
It's not an optimization. It just allows some tricks safely.
2020-11-11 23:59:09 +03:00
Nekotekina d391133524 atomic.cpp: minor notification improvement
Check mask before locking the reference.
Can help to not bother non-eligible waiters.
2020-11-11 23:51:41 +03:00
Nekotekina 4b823469f7 atomic.cpp: restore notify_all() behaviour
Restore batch notification with non-blocking attempts.
2020-11-11 22:43:13 +03:00
Nekotekina 7cd1e767be atomic.cpp: implement some atomic wait operations.
Instead of plain waiting while equal to some value,
it can be something like less, or greater, or even bitcount.
But it's a draft and untested. Hopefully doesn't break anything.
2020-11-11 20:46:37 +03:00
Eladash 829a697c39 Fix vm::check_addr calls in Thread.cpp 2020-11-11 17:40:46 +03:00
Eladash fefab50e06 Fix vm::range_lock, imporve vm::check_addr 2020-11-11 10:30:09 +03:00
Eladash 6e27ab60ca Registers Editor: Implement SPU/PPU register value broadcast 2020-11-11 10:27:45 +03:00
Eladash 74274f6d77 Debugger: Improve SPU/PPU vector registers 2020-11-11 10:27:45 +03:00
RipleyTom 908b2703f3 Fix missing controller mapping 2020-11-11 07:16:45 +03:00
Nekotekina c047ab6147 atomic.cpp: waitable atomics got brutally rewritten
Hashtable increased and flatten, tree-alike extensions removed.
Some things simplified, so it can actually decrease perf a bit.
But most platforms shouldn't be affected.
Removed limit of 56 waiters per pointer.
Real limit now is about 65535.
2020-11-11 05:35:27 +03:00
Eladash 52fa69d93d SPU Debugger: Improve registers panel 2020-11-10 22:51:52 +03:00
RipleyTom a83df01bfd rpcn 0.3.5 (#9227) 2020-11-10 08:55:49 +00:00
Eladash b32d989a10 Fix PPU stack contents on allocation 2020-11-10 06:30:35 +03:00
Nekotekina d1ee7c651f Make memory locking optional (mlock, VirtualLock).
Fix desired locking operation (to fix "sudo" memory).
It was discovered that some systems have outdated configuration.
With too tight limit, it's almost impossible to lock anything in memory.
2020-11-10 06:05:37 +03:00
Nekotekina dcbe8ef5f4 Import VirtualAlloc2 if available (Win10+)
Import MapViewOfFile3 as well.
Unused, this crap is tricky.
2020-11-10 03:04:38 +03:00
Nekotekina bd5253047b Improve DYNAMIC_IMPORT
Don't call get_proc_address every time if if failed.
Also rename Utilities/dynamic_library.h to util/dyn_lib.hpp
2020-11-10 01:44:31 +03:00
Nekotekina cdaa8cb5c4 CPU: Improve suspend_all g_suspend_counter handling
Increase in two stages, giving more chances to use it.
Second stage is when all wait flags have been seen.
2020-11-09 23:54:36 +03:00
Nekotekina 083397a555 vm: lock memory under "sudo" addr
Remove memory touching from transactions.
2020-11-09 23:54:36 +03:00
Nekotekina e98eb4659e Implement utils::memory_lock 2020-11-09 22:57:36 +03:00
Nekotekina d1988d384c vm: remove unnecessary memset() on stop 2020-11-09 22:57:36 +03:00
Nekotekina bc61835d97 CPU: use unsigned (u8) priority in suspend_all 2020-11-09 22:57:36 +03:00
RipleyTom 8a50880613 Fix path not being saved on install pkgs 2020-11-09 14:23:54 +03:00
Nekotekina b05d12df0e Hotfix for shm->map_self()
Make sure mmap returns 64K-aligned results, as on Windows.
2020-11-08 22:15:59 +03:00
Nekotekina 733b46d51a sys_semaphore: add state check to sys_semaphore_get_value
Also to sys_semaphore_create, although we don't do it.
2020-11-08 19:03:41 +03:00
Nekotekina 8bc9868c1f SPU/vm: Improve vm::range_lock a bit
Use some prefetching
Use optimistic locking
2020-11-08 17:23:17 +03:00
Nekotekina 3507cd0a37 SPU: improve spu_thread::reservation_check
Use optimistic locking and optimistic loop (expecting 1 iteration).
2020-11-08 16:43:15 +03:00
Nekotekina 21ec32b465 vm: implement g_shmem for range locks
Renamed from g_shareable. Contains pointers instead of bits.
Used in range locks to prevent any "collision" between memory.
2020-11-08 16:43:15 +03:00
Nekotekina 1c99a2e7fb vm: add map_self() method to utils::shm
Add complementary unmap_self() method.
Move VirtualMemory to util/vm.hpp
Minor associated include cleanup.
Move asm.h to util/asm.hpp
2020-11-08 16:43:15 +03:00
Nekotekina b68bdafadc vm: refactor vm::range_lock again
Move bits to the highest, set RWX order.
Use only one reserved value (W = locked).
Assume lock size 128 for range_locked.
Add new "Size" template argument that replaces normal argument.
2020-11-08 16:43:15 +03:00
Eladash bacfa9be19 Debugger fixups (#9226)
Fix logic error in callstacks handling code, always set first to false after first iteration.
 Add explicit check for zero return addresses. Current code validity checks may not check for it properly when it sits on interrupt handler entry point (which may contain valid code).
 Do not allow 0x3FFF0 to be a back chain address because it needs space for LR save area, only 0x3FFE0 and below satisfy this criteria.
2020-11-08 16:42:20 +03:00
Eladash 5265eb81e0 kernel-explorer: Add basic process info 2020-11-08 09:17:13 +03:00
Eladash 516da4ecdd Debugger: Improve SPU/PPU callstack handling 2020-11-08 09:17:13 +03:00
Megamouse 6fcc68699a unify patch log 2020-11-07 19:22:40 +01:00
Eladash 3cb5fd8ebc Debugger: Implement SPU callstack, fix PPU callstack 2020-11-07 20:45:57 +03:00
Nekotekina fd7ea82965 atomic.cpp: fix 3-arg notify functions
Third arg forces comparison with itself, and possibly forced wakeup.
2020-11-07 19:18:14 +03:00
Nekotekina 0bd989b118 atomic.cpp: allow waiting on multiple variables simultaneously
Arbitrary maximum set to 8, but really we need 2, maybe 3.
Added atomic_wait::list object for multi-waiting.
Added atomic_wait::get_unique_tsc just in case.
2020-11-07 18:18:02 +03:00
Nekotekina bd0b292b39 atomic.cpp: adjust assumed pointer mask
Increase waiter mask (allow 65535 waiters).
Assume 47-bit pointers instead of 48-bit.
2020-11-07 15:08:46 +03:00
Nekotekina 31f0a0c064 atomic.cpp: add minor safety check 2020-11-07 15:08:46 +03:00
Nekotekina 3e445eff8e atomic.cpp: maintenance of wait() function
Move hashtable allocation into another function.
2020-11-07 15:08:46 +03:00
Eladash 6dcd482dd0 SPU reservations: Do not illegally dereference reservation data 2020-11-07 14:03:09 +03:00
Morgan Creekmore a28ab0a408 Set AccountAge to 18 to fix age restriction checks, fix incorrect logged function name (#9218) 2020-11-07 09:47:44 +00:00
Megamouse a3eb5c2d63 More Header cleanup 2020-11-06 22:14:05 +01:00
Jan Beich e2303f3378 CI/FreeBSD: switch TravisCI to Clang 11 2020-11-06 18:20:23 +00:00
Jan Beich acb17b0298 CI/FreeBSD: enable on TravisCI as ccache works nowadays 2020-11-06 18:20:23 +00:00
Jan Beich fde7cf1fab CI/FreeBSD: switch CirrusCI to 12.2-RELEASE 2020-11-06 18:20:23 +00:00
Jan Beich c2cb7e1004 CI/FreeBSD: avoid downloading commit history in submodules 2020-11-06 18:20:23 +00:00
Jan Beich 4075f5c497 CI/FreeBSD: clear ccache stats, so new hits are easier to notice 2020-11-06 18:20:23 +00:00
Jan Beich debd44fa9b CI/FreeBSD: stop forcing ccache after f528aada24 2020-11-06 18:20:23 +00:00
Nekotekina 0a5742587a atomic.cpp: upgrade raw_notify()
Now it searches all semaphores if data arg is nullptr.
Also it tries to wake up all threads if thread_id is 0.
2020-11-06 17:15:40 +03:00
Nekotekina ad4df2d946 atomic.cpp: refactor native signaling functions
Add native_alert() and try_native_alert()
2020-11-06 17:15:40 +03:00
Nekotekina bfe9580551 atomic.cpp: fix cond_handle data structures
Fix a critical bug with possible id out of range.
2020-11-06 16:56:59 +03:00
Nekotekina 1e45437498 Remove unused atomic with lock bit 2020-11-06 16:48:43 +03:00
Ani f9c8f78000 llvm: Update submodule (Zen3 workaround) (#9212) 2020-11-06 11:41:51 +00:00
RipleyTom 4554eedd19 Extend timeout on travis 2020-11-06 13:54:59 +03:00
Nekotekina 557f0c5a8a atomic.cpp: remove load() from notify functions
Only compare masks for overlap for second overload (with mask provided).
Explicit "new value" can be provided in new 3-arg overloads.
Also rename atomic_storage_futex -> atomic_wait_engine.
2020-11-06 04:44:31 +03:00
Nekotekina 9fb8d449fe atomic.cpp: more improvements
Add ref counters for internal semaphores for concurrent notifying.
Lack of them could result in loss of notification.
2020-11-06 00:14:53 +03:00
Nekotekina 1bb7c74c93 atomic.cpp: various cleanups and fixes
Add pointer comparison to notifiers (to prevent spurious wakeups).
Fix a bug with a possible double notification in raw_notify().
Fix a bug with incorrect allocatin bit slots for cond_handle.
Add a semaphore counter to track max allowed number of threads.
Use #define for some constants to STRINGIZE them in errors.
Add some error messages when certain limits are reached.
Fix a bug with a wrong check simply throwing std::abort.
Use "special" notify_all patch with batch processing for every arch.
Fix Win7 bug who no one probably noticed.
2020-11-06 00:10:16 +03:00
Nekotekina cc07e5306e Improve shared_mutex
Wait/notify only on c_sig, should reduce spurious wakeup noise.
2020-11-06 00:10:16 +03:00
Nekotekina 34fa010601 Improve cond_var notifiers
But nobody uses it anyway, so clean up includes.
2020-11-06 00:10:16 +03:00
Nekotekina 7d56069243 Fix HAS_OVERCOMMIT usage in JIT.cpp 2020-11-05 18:50:19 +03:00
Nekotekina fc77fb9b4c Update LLVM commit id 2020-11-05 06:45:43 +03:00
Nekotekina ebdf93e5dc Fix 1 warning in MSVC 2020-11-05 06:45:01 +03:00
Nekotekina 5248240e10 atomic.cpp: improvements.
Reduced static memory amount for waitable atomics.
Allow notifier to skip notifications if wait/notify masks don't overlap.
Improve raw_notify to wake up the thread by its id, add thread_id arg.
Add optional mask argument to notify_one() and notify_all().
2020-11-05 05:51:43 +03:00
Nekotekina b66628baca Improve low-level mmap utilities (Linux/BSD)
Add madvise (MADV_WILLNEED) on utils::memory_commit
Add madvise (MADV_FREE or MADV_DONTNEED) on utils::memory_decommit
Improve shm_open pseudo-random name (not used on Linux)
2020-11-04 14:59:26 +03:00
Nekotekina ba5ed5f380 Fix vm::lock_range wrong check
Minor header refactoring.
2020-11-04 14:59:26 +03:00
Nekotekina 8d5e119582 Improve cpu_flag::temp handling
Ignore cpu_flag::suspend
Ignore cpu_flag::signal
2020-11-04 14:59:26 +03:00
Nekotekina d022e7cd27 sys_prx: add cpu_flag::wait 2020-11-04 14:59:26 +03:00
Nekotekina 5d7acda80e vm: minor refactoring
Renamed internal main range locking method.
2020-11-04 14:59:25 +03:00
Nekotekina 9b595c68a5 Fix some switch warnings 2020-11-04 14:59:25 +03:00
Nekotekina 2d38d8a639 Fix NEVER_INLINE attribute
Similarly to FORCE_INLINE, it doesn't imply inline on some compilers.
2020-11-04 14:59:25 +03:00
Nekotekina dea8aa675a Optimize cpu check_state() a bit
Move cpu_flag::dbg_pause check from the start.
To the moment before it actually goes to sleep.
2020-11-04 14:59:25 +03:00
Megamouse 027eba2b59 Add Quadro to fast version of VK get_driver_vendor 2020-11-04 12:13:56 +01:00
Megamouse 91b8e7504e Set some things to log level always 2020-11-04 12:13:56 +01:00
Megamouse 088931525d Add option to log qDebug 2020-11-03 06:42:51 +01:00
Megamouse ef9638e094 Log Qt version 2020-11-03 06:42:51 +01:00
Ani 09a9d08466 rpcs3_version: Bump to 0.0.13 (#9192) 2020-11-02 20:20:12 +00:00
Nekotekina 1b8bf081b5 Upgrade to LLVM 11 Stable 2020-11-02 21:23:25 +03:00
Nekotekina 06ecc2ae68 vm::range_lock cleanup and minor optimization
Removed unused arg.
Linearized some branches.
2020-11-01 23:29:33 +03:00
Nekotekina 46d3066c62 Optimize vm::range_lock
Only test address on `range_locked`
Don't check current transaction
Remove vm::clear_range_locks completely
2020-11-01 16:46:06 +03:00
Nekotekina 8d12816001 TSX: fix transaction limit settings 2020-11-01 14:58:04 +03:00
Nekotekina fe03b55046 TSX: tiny optimization of transaction functions
Because new memory manager puts them in first 2G.
2020-11-01 14:44:59 +03:00
Nekotekina ca57f25f26 Fix vm::page_protect and range flags
Should fix assertion in vm.cpp
Minor refactoring of internal locking
2020-11-01 02:30:10 +03:00
Eladash 3c639ff8e1 SPU: Fix Accurate DMA edge case 2020-11-01 00:35:48 +03:00
Nekotekina 78c986b5dd Improve vm::range_lock
Not sure how it ever worked
Clear redundant vm::clear_range_lock usage
2020-10-31 23:53:14 +03:00
Megamouse a42663b09b Qt: Pass events to dialog when not remapping 2020-10-31 20:44:09 +01:00
Megamouse 36149fd986 overlays: kinda fix performance graph margins (#9181) 2020-10-31 16:32:31 +00:00
Eladash c2c559f8d9 Disasm: do not allow to access previous instructions in non-interpreter mode 2020-10-31 17:15:47 +03:00
Eladash 5e8419af0d SPU Debugger: SHUFB insertion patterns 2020-10-31 17:15:47 +03:00
Nekotekina 86fc842c89 TSX: new fallback method (time-based)
Basically, using timestamp counter.
Rewritten vm::reservation_op with the same principle.
Rewritten another transaction helper.
Add two new settings for configuring fallbacks.
Two limits are specified in nanoseconds (first and second).
Fix PUTLLC reload logic (prevent reusing garbage).
2020-10-31 15:34:14 +03:00
Nekotekina 80530e8aef vm: rename g_addr_lock to g_range_lock
Reduce size to 29 bits and use 3 bits to communicate some information.
This information can be used to to a very cheap lock-free access tests.
2020-10-31 15:08:49 +03:00
Nekotekina ba26e16411 Rename vm::reservation_light_op -> light_op
Rename vm::reservation_peek_op -> peek_op
Also remove overkill assertion for cpu_flag::temp.
2020-10-31 15:08:49 +03:00
Megamouse 2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
Megamouse 5d55e509ec cellSubDisplay: Add some constants (#9178) 2020-10-31 01:40:38 +00:00
Megamouse 4984e87776 implement interception for cellKb and cellMouse
this needs to be tested
2020-10-31 02:11:27 +03:00
Megamouse c65b7d0aea HLE: Add some constants 2020-10-31 02:11:27 +03:00
Megamouse 54fd224fd8 Add License Area Setting 2020-10-31 02:10:30 +03:00
Megamouse 5ca2b1200d Qt: Fix Resolution combobox default value 2020-10-31 02:08:42 +03:00
Eladash b5014d56ab rsx: Fix transform contants load 2020-10-31 02:08:03 +03:00
Nekotekina c4e89f8bb4 Actually start rsx replay thread 2020-10-30 22:25:33 +03:00
Nekotekina 7dd85b207f vm: optimize range lock slot allocations
Doesn't seem to need a barrier.
2020-10-30 22:20:20 +03:00
Nekotekina cb0431d960 sys_fs/sys_usbd: add cpu_flag::wait 2020-10-30 20:14:32 +03:00
Nekotekina 58adb6a1aa sys_ppu_thread: add cpu_flag::wait 2020-10-30 18:27:15 +03:00
Nekotekina 13c564f2af sys_memory: add cpu_flag::wait 2020-10-30 18:09:30 +03:00
Nekotekina 95aeebe4b5 sys_rsx: add cpu_flag::wait 2020-10-30 18:00:25 +03:00
Nekotekina 605d57c541 sys_event: cleanup (replace vm::temporary_unlock)
Also made minor changes in sys_rsx.cpp.
Removed unused exception std headers.
2020-10-30 17:49:07 +03:00
Nekotekina f972fa26a4 Derive RSX Replay thread from cpu_thread
Its id is set to 0, so fix some id_type() usages.
2020-10-30 17:36:11 +03:00
Nekotekina 150e18539c Allow cpu_thread& arg passed to the syscalls
Minor cleanup. cpu_mem(), cpu_unmem() removed.
2020-10-30 17:03:32 +03:00
Eladash f03d4cf8fd PPU: Optimize reservation load for success 2020-10-30 10:49:47 +02:00
Nekotekina 3419d15878 vm: add extern clear_range_locks function
Allows to wait for range locks to clear for specified range.
vm::range_lock now monitors specified reservation lock as well.
2020-10-30 07:58:16 +03:00
Nekotekina 0da24f21d6 CPU: improve cpu_thread::suspend_all for cache efficiency (TSX)
Add prefetch hint list parameter.
Workloads may be executed by another thread on another CPU core.
It means they may benefit from directly prefetching the data as hinted.
Also implement mov_rdata_nt, for "streaming" data from such workloads.
2020-10-30 05:22:09 +03:00
Nekotekina e794109a67 perf_meter.hpp: fix double rdtsc bug, add restart() method 2020-10-30 03:19:13 +03:00
Nekotekina 006c783aba SPU: make do_dma_transfer() static with _this arg
Instead of this, nullptr will be passed from another thread.
MMIO via MMIO is disabled if it even possible.
2020-10-30 02:58:39 +03:00
Nekotekina 4378a09867 PPU: reload old data on STCX failure
In 128-byte reservation mode, it can reload the whole cache line.
2020-10-30 02:58:39 +03:00
Nekotekina fb24b06a5d PPU: add LARX perf counter
Also refactor ppu_store_reservation a bit.
2020-10-30 02:58:39 +03:00
Nekotekina 425fce5070 SPU: load previous data on PUTLLC failure
Since it will most likely execute GETLLAR to load it again.
Only implemented for TSX at moment.
2020-10-30 02:58:39 +03:00
Nekotekina d5667a859a CPU: improve cpu_thread::suspend_all (TSX)
Try to make more clever busy-waiting on cpu_flag::pause.
2020-10-30 02:58:39 +03:00
Nekotekina 95dbcf2fd7 Logs: add callback for cpu_thread to set cpu_flag::wait
May improve waiting time in critical suspend_all ops.
2020-10-29 18:57:57 +03:00
Nekotekina 8ce0819b42 SPU: add stx/ftx counters
Just count pure transaction successes and failures.
2020-10-29 18:57:57 +03:00
Nekotekina 688a456642 TSX tweaks
Allow to do more in first-chance transactions.
Give PUTLLC +1 priority (minor change).
2020-10-29 18:57:57 +03:00
Megamouse 59b3a3d26b Qt: Add "Configure Game Patches" to game list (#9154) 2020-10-29 06:02:05 +00:00
Ani ea1cdbfdd8 ci: Update docker to 1.6
Bumps Windows VulkanSDK version to 1.2.154.1 to stay synchronised with
docker
2020-10-29 03:57:39 +00:00
Ani 3641926333 ci: Use system cURL on Linux build 2020-10-29 03:57:39 +00:00
Nekotekina 280958ee74 Revert "TSX: adjust transaction logic"
This reverts commit ff550b5c3c.
2020-10-28 21:59:12 +03:00
Bevan Weiss f4070731a8 NET: Add SO_RCVBUF / SO_SNDBUF defaults to .._bnet_socket
The OS defaults for SO_RCVBUF / SO_SNDBUF may not match what the defaults for the PS3 are.
And the code may be happy with the PS3 defaults, so may not set this explicitly.
So we'll do it when we establish the socket.
It also looks like the Windows recv behaviour is different for the MSG_PEEK option (and possibly in all situations where a smaller buffer is provided). I believe other platforms will return the size of the data received into the socket buffer, even if the supplied user buffer is smaller. Windows returns WSAEMSGSIZE instead. For the length of '1' MSG_PEEK request that is currently seen, we just mask this and return the full size of the buffer. This might need to be the case in all situations, I assume there will be applications that will supply an artificially small buffer and resize it as necessary based on the size of the received packet.
Add some additional translations from native->PS3 error codes

Rewrote handling of MSG_PEEK to just be a copy of what GalCiv suggested
Added WSAESHUTDOWN, and WSASetLastError as done by Cygwin
2020-10-28 20:54:29 +03:00
Eladash e791678dfc atomic.cpp: fix memory ordering loads and release stores 2020-10-28 20:45:13 +03:00
RipleyTom 6f5bbf550a Revert part of CellHddGameCheck 2020-10-28 20:44:38 +03:00
Nekotekina ff550b5c3c TSX: adjust transaction logic
Allow more in first-chance transactions.
Allow abandonment of PUTLLC as in original path.
Make PUTLLUC unconditionally shared-locked.
Give PUTLLC +1 priority (minor change).
2020-10-28 14:00:09 +03:00
Nekotekina d6daa0d05b Fix cpu_flag::temp, make sure it removes cpu_flag::wait 2020-10-28 14:00:09 +03:00
Nekotekina 86785dffa4 SPU: make vm::check_addr checks safe under vm::range_lock
Reuse some internal locking mechanisms.
Also fix vm::range_lock missing check.
2020-10-28 14:00:09 +03:00
Nekotekina c491b73f3a SPU: improve accurate DMA
Remove vm::reservation_lock from it.
Use lock bits to prevent memory clobbering in GETLLAR.
Improve u128 for MSVC since it's used for bitlocking.
Improve 128 bit atomics for the same reason.
Improve vm::reservation_op and friends.
2020-10-28 03:47:41 +03:00
Nekotekina c50233cc92 atomics.cpp: add support for waiting on 128-bit atomics
Complementarily.
Also refactored to make waiting mask non-template arg.
2020-10-28 03:47:41 +03:00
Nekotekina 13de773486 Remove some vm::reservation_lock instances 2020-10-27 17:56:19 +03:00
Nekotekina 4966f6de73 vm: improve range_lock and shareable cache (Non-TSX)
Allocate "personal" range lock variable for each spu_thread.
Switch from reservation_lock to range lock for all stores.
Detect actual memory mirrors in shareable cache setup logic.
2020-10-27 17:56:19 +03:00
Nekotekina 6806e3d5c7 atomic.cpp: implement notify callback
Notification can be very heavy, especially if we need to wake many threads.
Callback is set for cpu_thread in order to set wait flag accordingly.
2020-10-27 17:56:19 +03:00
Megamouse 0a121e9d26 DS4: Add error logging and remove some unused code 2020-10-27 15:25:08 +01:00
Megamouse 15e8cba398 Qt: fix never played nonsense 2020-10-27 12:50:43 +01:00
kd-11 b32eecb5a7 rsx: Driver compatibility improvements (#9131)
* rsx: Refactor vertex clip emit to avoid using f64 unnecessarily

- Fixes driver crash on intel

* vk: Add NVIDIA driver version check

- Warn if user has outdated drivers with known problems
2020-10-27 13:22:15 +03:00
Megamouse 8ce0eaa9d0 Qt: move TTY option to TTY tab (#9147) 2020-10-27 02:47:07 +00:00
Ani 8307f82f86 ci: Set glslang checksum back to auto-builds
Forgot to set on #9124
2020-10-26 06:16:08 +03:00
Cebtenzzre 2b6a56c21c Partially revert "Fix debug build gcc/clang linker."
This reverts commit 4599d58413.

The issue this works around was fixed in 3265772 ("idm: Implement
creation/destruction invalidation counter") by making the variables
constexpr.

Fixes #6896
2020-10-26 04:12:04 +03:00
Nekotekina f1e66085cd Fixup for cpu_flag::temp
Wrong check_state() result was triggering assertion.
2020-10-26 01:18:26 +03:00
Nekotekina d344701fd5 atomic.cpp: add sparse atomics
Set alignment as second template argument (typically cache line).
2020-10-26 01:15:31 +03:00
Nekotekina 130a0ef20e Implement cpu_flag::temp flag
Accompanies wait flag, indicating that it was set in limited conditions.
Such condition don't allow thread to terminate after its removal.
2020-10-25 21:48:20 +03:00
kd-11 18ca3ed449 rsx: Block-level reservation access 2020-10-25 20:21:04 +03:00
Nekotekina af6fcb19a8 atomic.cpp: add std primitive fallback for other platforms
Other platforms = not Windows or Linux.
2020-10-25 16:45:22 +03:00
Ani eec2dfad7b ci: Set GLSLANG_URL back to auto-builds 2020-10-25 16:44:06 +03:00
Eladash 0fcf767ee9 SPURS: Implement spursJobchainPopUrgentCommand 2020-10-25 16:43:38 +03:00
Eladash 1e7bf218e0 CellSpurs: Minor fixes 2020-10-25 16:43:38 +03:00
Eladash 4ea7628204 SPU: Fix LS capture entry point 2020-10-25 16:39:40 +03:00
Nekotekina 7db77a5580 atomic.cpp: use new thread alerting API (Win8+)
Win7 will remain using old API (keyed events).
2020-10-24 19:06:02 +03:00
Nekotekina 97ae5ab561 Add imports for some undocumented NTDLL functions
Some of them are available only since Windows 8.
2020-10-24 14:16:32 +03:00
Nekotekina 89d9813a45 Fix UTF-8 strings in perf_meter files 2020-10-24 14:16:32 +03:00
Nekotekina 2b52b4a749 SPU: use normal notify() thread function
Using raw_notify() everywhere was overkill.
2020-10-24 14:16:32 +03:00
Nekotekina c479d431a4 atomic.cpp: experimental optimization (Win7+)
Try non-blocking wake up function first.
2020-10-24 14:16:32 +03:00
Nekotekina 8628fc441d atomic.cpp: rewrite internals (again)
Use individual semaphore for each thread.
Unfortunately, limit max thread waiting for single address (60).
If limit is reached, use busy waiting.
2020-10-24 14:16:32 +03:00
Nekotekina d48d67767a atomic.cpp: integrate callback check in ptr_cmp function 2020-10-24 14:16:32 +03:00
Nekotekina 10caa2981f Improve raw_notify a bit 2020-10-24 14:16:32 +03:00
Eladash 49610f52f5 SPU: Save LS capture executable in one segment 2020-10-24 14:13:19 +03:00
Megamouse 27643cb715 HLE: improve cellHddGameCheck 2020-10-24 00:26:41 +03:00
Megamouse fe3c7926f7 Qt: add custom game icons
This shouldn't interfere with emulation as replacing actual files would
2020-10-23 23:13:22 +02:00
Eladash 552d8e6aec Debugger: Fix SignedHex
It didnt take into account INTx_MIN. (UB for std::abs)
2020-10-23 13:13:04 +03:00
Eladash 0bb3609cad Debugger: Simplify thread pause state change 2020-10-23 13:13:04 +03:00
Eladash b56bc7e087 SPU: cleanup channels logging 2020-10-23 13:13:04 +03:00
Eladash abcf265bc7 SPU Debugger: Implement basic instructions's constants propagation
Only functional in WRCH and ILHU+IOHL pattern atm.
ILHU+IOHL is extremely common pattern to create 32-bit constants such as SPPU libraries error codes.
2020-10-23 13:13:04 +03:00
Eladash 6d3c421823 Debugger: Optimize thread disasm type select
Some correctness fixes as well: dont use raw pointers where its not compatible, use std::weak_ptr instead.
2020-10-23 13:13:04 +03:00
Eladash e70f430b5a SPU Debugger: Add made-up MR mnemonic 2020-10-23 13:13:04 +03:00
Eladash 8c927d3cc8 kernel-explorer: Add SPURS wkl arg 2020-10-23 13:13:04 +03:00
Eladash b998852385 LV2: cleanup syscall table (#9106)
Remove old ppu_get_syscall_name from PPUFunction.cpp for deduplication.
2020-10-21 10:04:34 +03:00
Nekotekina 59d9e7ce98 Revert "Atomics: use WaitOnAddress if available (Win8+)"
This reverts commit f0fd7e2e19.
2020-10-21 09:59:08 +03:00
Nekotekina 306593a0c5 Revert "atomic.cpp: fixup for WaitOnAddress path"
This reverts commit 3b8bce1bed.
2020-10-21 09:54:22 +03:00
Nekotekina 3b8bce1bed atomic.cpp: fixup for WaitOnAddress path
Also fix wait quantum.
2020-10-21 08:18:27 +03:00
Nekotekina f0fd7e2e19 Atomics: use WaitOnAddress if available (Win8+) 2020-10-21 00:22:08 +03:00
Nekotekina 4384ae15b4 Improve vm::reservation_op
Remove XABORT, sync status handling with SPU/PPU transaction.
Limit max number of transaction attempts in loop.
Add Ack template parameter, as in vm::reservation_light_op.
Remove utils::tx_abort, improve utils::tx_start as well.
2020-10-20 09:10:21 +03:00
Nekotekina dc8252bb9f Remove XABORT in PPU/SPU transactions.
It's expensive for unknown reason. Simply XEND is usually much cheaper.
Add some minor improvements. Use g_sudo_addr.
2020-10-20 09:10:21 +03:00
Nekotekina 182a998cb6 Add "Enable Performance Report" debug setting 2020-10-20 07:09:24 +03:00
Nekotekina ea8e435b32 Fixup for perf_meter.hpp
Don't try to push reports if they are empty.
2020-10-19 21:25:42 +03:00
Nekotekina 72d1ac22aa SPU: report too many PUTLLC attempts (TSX)
Mirrored to PPU STCX code and PUTLLUC (STORE128).
2020-10-19 19:41:28 +03:00
Nekotekina 8ce5392390 TSX: add prefetchw instruction in transaction code 2020-10-19 19:41:28 +03:00
Nekotekina 311682b341 SPU: fix GETLLAR regression
Misplaced mov_rdata
2020-10-19 19:41:28 +03:00
Nekotekina 44c90c060a TSX: improve transaction repeat handling
Handle status 0 as fatal.
2020-10-19 19:41:28 +03:00
Nekotekina a5eb11d79f Improve cpu_thread::suspend_all (TSX-FA)
Add prefetching of cpu->state fields.
2020-10-19 19:41:28 +03:00
Nekotekina 120849c734 Implement perf stat counter for PPU/SPU reservation ops
Adds Emu/perf_meter.hpp header file.
Uses RDTSC for speed.
Prints stats at exit.
2020-10-19 19:41:28 +03:00
Nekotekina adf50b7c4b Implement cpu_thread::if_suspended
Use it for opportunistic guaranteed GETLLAR execution (TSX-FA).
2020-10-18 20:10:48 +03:00
Nekotekina f5c575961f Implement priorities for cpu_thread::suspend_all tasks
Give PUTLLUC increased priority.
2020-10-18 20:10:48 +03:00
kd-11 a90801e2aa vk: Add VK_FORMAT_D32_SFLOAT to format conversion table
- This format is required to emulate RSX_FORMAT_CLASS_D16_FLOAT
2020-10-18 19:30:40 +03:00
Eladash 402e8b12a6 SPU: Touch unmapoed memory in reservation mismatch 2020-10-18 11:42:54 +03:00
Eladash 701f7f39d6 Improve SPURS debugger (#9090) 2020-10-18 11:07:01 +03:00
Eladash 6590366f8e PPU Debugger: fix typo in STDX 2020-10-17 22:00:22 +03:00
Eladash fa0b02ed30 PPU Debugger: Improve move from/to CR registers instructions 2020-10-17 22:00:22 +03:00
Nekotekina 15efb73aae Add assert in build_function_asm to not ignore errors 2020-10-17 21:55:22 +03:00
Nekotekina d0057c92e4 Fix spu_putlluc_tx (insignificant) 2020-10-17 21:27:19 +03:00
Nekotekina 4078f43984 Fix ppu_stcx_accurate_tx (operand size mismatch) 2020-10-17 21:26:17 +03:00
Nekotekina 3d980a9f66 Reimplement ASMJIT runtime
Try to emplace generated code in lower address area.
Protect generated code from writing.
2020-10-17 21:25:43 +03:00
Bevan Weiss a0d95a823e BUGFIX: LibUSB Transfer list deletion (#9084)
It looks like I was too hasty in picking the latest libusb commit (to fix a few Windows build warnings) prior to landing my merged PR.
libusb commit eee6998 had a transfer list bug.  Have just tested on c33990a and it's resolved now.
2020-10-17 13:41:59 +01:00
RipleyTom 9e14d240a8 Implement ethernet address determination 2020-10-16 22:53:48 +03:00
RipleyTom 1393bb2caf Fix getsockname on windows for unbound sockets 2020-10-16 22:53:48 +03:00
RipleyTom e9914f3004 Add sys_net error for EISCONN 2020-10-16 22:53:48 +03:00
RipleyTom 073772a801 Fixes setsockopt 2020-10-16 22:53:48 +03:00
RipleyTom 2babe4c236 Add better handling of RTT for STREAM_P2P 2020-10-16 22:53:48 +03:00
RipleyTom bbda618beb Improve poll for p2p sockets 2020-10-16 22:53:48 +03:00
RipleyTom 344c813eb1 Avoid double locking with start_sig 2020-10-16 22:53:48 +03:00
RipleyTom abaa8f855f sceNpManagerGetAccountRegion impl 2020-10-16 22:53:48 +03:00
RipleyTom ea1171f624 Add notification logging 2020-10-16 22:53:48 +03:00
Bevan Weiss 1e83d2a4e9 LibUSB: Update to upstream master (and turn off YAML_CPP_INSTALL CMake property)
May resolve some outstanding issues around libusb/hidapi (i.e. DS4 not being released on rpcs3 shutdown etc..) or may not.
Fixes three outstanding compile warnings on non-Windows OS... introduces a few more warnings in WindowsOS (issue raised upstream with libusb around WINAPI_CHECK macro)
Re-ordered the 3rd party CMake so libusb is in file order above hidapi (just to have document flow match logical flow)

Also took this opportunity to remove the YAML INSTALL action (by setting YAML_CPP_INSTALL to OFF)
Provided capability to use system library for libusb by providing USE_SYS_LIBUSB option to CMAKE

Tested under:
- [X] Windows 10 2004 OS with DS4 controller
- [X] Windows 10 2004 OS with GCon3 controller
- [X] Linux (Mint 20) with DS4 controller
2020-10-16 22:51:52 +03:00
Eladash 443c2b920d PPU: Handle cache line inconsistencies (PPU 128 reservations) 2020-10-16 22:51:30 +03:00
Eladash 953663e00b Fix ppu_execute<Func> for HLE functions 2020-10-16 22:48:02 +03:00
Eladash 5185ddb8b5 CellSpurs: JobChain functions and some more (#9080) 2020-10-16 18:35:20 +01:00
Nekotekina 583ed61712 SPU: return some give-up behaviour for PUTLLC (TSX)
Despite using concept of "shared" lock, allow only first to proceed.
This is similar how conditional stores for PPU are implemented.
2020-10-16 12:14:42 +03:00
Nekotekina 492ed27495 RSX: fix rsx::nv406e::semaphore_release partially
Properly release reservation (non-TSX path).
At least update and notify reservation (TSX).
2020-10-15 20:58:59 +03:00
Nekotekina facde63460 PPU: fix ppu_stcx_accurate_tx
Don't destroy xmm6/xmm7 state on exit.
Improve addr arg handling (simplify).
2020-10-15 19:24:00 +03:00
Nekotekina 494953997e PPU/SPU: give up on conditional stores if locking fails
Restores Non-TSX behaviour partially.
2020-10-15 17:18:49 +03:00
Nekotekina 1b89ad00e7 SPU: restore some LR event setting logic after #9048 2020-10-15 17:18:49 +03:00
Nekotekina 40558e7ac1 Use std::invoke in cpu_thread::suspend_all 2020-10-14 02:53:58 +03:00
Nekotekina 3bddba0c7a SPU: fix spu_getllar_tx
Was not executing.
2020-10-14 02:53:29 +03:00
Nekotekina 97cd641da9 TSX: reimplement spu_getllar_tx
Only used as a backup method of reading reservation data.
Increase long GETLLAR reporting threshold.
2020-10-13 21:10:04 +03:00
Nekotekina 91db4b724c SPU: fix PUTLLC (TSX-FA)
Some forgotten checks may affect performance.
2020-10-13 17:46:03 +03:00
Nekotekina dcff8c2637 Fix remaining vm::reservation_lock usages (for now)
Optimization can be restored later.
2020-10-13 12:04:59 +03:00
Nekotekina 7a76fb1469 PPU: Add loop logging in STWCX/STDCX 2020-10-13 11:06:58 +03:00
Nekotekina 17f805ae64 PPU: cleanup for TSX path remnant 2020-10-13 10:54:10 +03:00
Nekotekina 1606f97177 CPU: print and reset suspend_all statistics 2020-10-13 00:33:20 +03:00
Nekotekina dc39a9b84f SPU: Report 'GETLLAR took too long'
Also move similar code in PPU.
2020-10-13 00:12:11 +03:00
Nekotekina 4ff23a9943 sys_fs: fix file opening from /app_home
Typo.
2020-10-12 21:41:57 +03:00
Nekotekina a806be8bc4 SPU: Implement S1/S2 (SNR) events (closes #8789)
Add TSX path in push_snr()
Add locks bits in ch_events
2020-10-12 21:41:57 +03:00
Nekotekina b57a9c31f0 Implement utils::tx_start (for TSX)
Implement utils::tx_abort helper.
2020-10-12 15:20:24 +03:00
Eladash 95c1443e30 SPU: Validate reservation in GET commands (Accurate DMA) (#9062) 2020-10-12 15:20:06 +03:00
Nekotekina 5bd5a382c0 PPU: fix LDARX/LWARX in accurate mode (closes #9058)
Fixup after #9048
Use SSE intrinsics in mov_rdata.
2020-10-11 19:52:10 +03:00
Nekotekina 1885e4345c Improve vm::reservation_update
Only respect unique lock.
2020-10-11 17:22:28 +03:00
Nekotekina 2f329cf7b5 PPU: minor improvement for LWARX/LDARX
Improve chances of loading actual data in memory.
2020-10-11 17:22:28 +03:00
Nekotekina f2d2a6b605 JIT cleanup for PPU LLVM
Remove MemoryManager3 as unnecessary.
Rewrite MemoryManager1 to use its own 512M reservations.
Disabled unwind info registration on all platforms.
Use 64-bit executable pointers under vm::g_exec_addr area.
Stop relying on deploying PPU LLVM objects in first 2G of address space.
Implement jit_module_manager, protect its data with mutex.
2020-10-11 17:22:28 +03:00
Eladash 3c935f7834 SPU: Fix minor segfaults (#9015)
SPU: Remove "RawSPU Not Found" exception.
Fix edge case in access violation handler.
2020-10-11 14:59:18 +03:00
Bevan Weiss 2c8b3f05ac FIX: MAX_PATH is used within Windows headers, we should use a different define internally
Replace MAX_PATH usage with EMU_MAX_PATH, this prevents the redefine warning, and ensures that we don't mess up other usages (which will likely want MAX_PATH as 260, like Windows defines, not 4096 like we do).
The replacement has been done based on what MSVC was telling me the define values were at each point (i.e. whether we wanted it or not, these usages were using our 4906 value, not the 260 value from Windows)
2020-10-10 23:09:05 +03:00
Nekotekina e8e3a3b2a2 PPU: improve LWARX/LDARX progression
Should reduce spam ("...took too long")
2020-10-10 17:36:41 +03:00
Nekotekina ec7d243ee9 More optimization for cpu_thread::suspend_all
Try to not pause inactive threads.
2020-10-10 14:22:12 +03:00
Nekotekina b74c5e04f5 Optimize cpu_thread::suspend_all
Reduce internal thread status polling.
Refactor utility functions.
2020-10-10 14:12:49 +03:00
Nekotekina 050c3e1d6b Rewrite cpu_thread::suspend_all
Now it's a function of higher order.
Make only one thread do the hard work of thread pausing.
2020-10-10 13:58:48 +03:00
Nekotekina 6d83c9cc0e PPU: remove ppu_stcx_tx
Very small transaction, benefit questionable.
2020-10-10 13:58:48 +03:00
Nekotekina 346a1d4433 vm: rewrite reservation bits
Implement classic unique/shared locking concept.
Implement vm::reservation_light_op.
2020-10-10 13:58:48 +03:00
Bevan Weiss d962bb018d wolfssl: Add WC_NO_HARDEN suppression to compiler defines, and remove duplicate defines in MSVC
Silence the wolf from telling us:
#warning "For timing resistance / side-channel attack prevention consider using harden options"

Also removed duplicate defines for Visual Studio project, to remove some additional warnings there.
2020-10-10 13:57:24 +03:00
kd-11 bca3a3f4ed vk: Open CB before doing frame cleanup so that callbacks work (#9041) 2020-10-10 10:02:55 +01:00
Eladash ffea52dc36 Add some more info to SPURS kernel explorer 2020-10-08 19:05:14 +03:00
Eladash 865464f607 SPU Local Storage capture 2020-10-08 19:05:14 +03:00
Eladash 73f96f48ee Fix SPU ELF loader 2020-10-08 19:05:14 +03:00
Nekotekina 89f1248140 Implement vm::reservation_op
Implement vm::reservation_peek (memory load)
Implement vm::unsafe_ptr_cast helper
Example use in cellSpurs.cpp
Fix dma_lockb value and description
2020-10-07 20:11:59 +03:00
Eladash 59be63167f Prettify SPU image name of dumped images 2020-10-07 01:12:45 +03:00
Eladash c628147521 cellSpurs: Implement more HLE functions (part 1) 2020-10-07 01:12:21 +03:00
Eladash a5cff8b186 kernel-explorer: Initial SPURS debugger 2020-10-06 14:20:23 +03:00
Eladash 983547af7e SPU: Embedded PRX/overlay image patching and dumping 2020-10-06 13:06:25 +03:00
kd-11 d5f7e7b179 vk: Reimplement GPU query management 2020-10-06 12:02:53 +03:00
Eladash 2a258dc21e Fix GCC compilation (#9035) 2020-10-05 06:39:56 +01:00
Eladash ec1244bb82 Minor cellSpurs fixup 2020-10-04 19:54:56 +03:00
Eladash ac6e042223 Implement sys_process_is_spu_lock_line_reservation_address 2020-10-04 19:54:56 +03:00
Eladash a0b387e0a9 cellSpurs: Fix HLE workload signalling, taskset fixes 2020-10-03 22:35:59 +03:00
Eladash 4cafd5a31c SPU: Remove dead additions in Accurate Xfloat 2020-10-03 20:31:35 +03:00
Eladash 888b520b31 sys_fs: return ENOENT for relative paths 2020-10-03 19:09:09 +03:00
Eladash 493e57837b SPU: Fix extremely rare bug of GETLLAR (#9011) 2020-10-03 09:31:28 +01:00
Roman bddfa76b2e Update BUILDING.md
Wrong link to the VS Qt Plugin (2017 instead of 2019)
2020-10-02 22:46:07 +03:00
Nekotekina ee00fdb61b fs: improve handling root mountpoint
Path such as simply "/" falls into this category.
2020-10-02 14:37:58 +03:00
Nekotekina 9b22661c19 fs: improve mountpoint detection
Properly handle . and .. path components in mountpoint detection.
Remove app_home mountpoint and use mountpoint from argv[0] instead.
Add dev_root mountpoint for special purposes.
2020-10-02 12:32:35 +03:00
Nekotekina 0ac3dbfec9 Improve Trophy Installer robustness
Relax paranoidal mount point locking and temp dir creation mechanism.
It was incompatible with a setup where user directory is symlinked.
Instead, create temp dir as close to target as possible (see savedata).
2020-10-01 22:00:57 +03:00
Eladash 56cebd99c2 SPU: Simplify logging of MFC commands (#9004) 2020-10-01 19:52:39 +03:00
Eladash 04c3d8d1bb Set max PPU threads to 100 2020-10-01 19:51:56 +03:00
Eladash 7fdf3dd760 cellSpurs: Add CellSpursJobOpcode definitions 2020-10-01 18:16:13 +03:00
Eladash 1f28bee86a cellSpurs: Add error codes formatting (unused) 2020-10-01 18:16:13 +03:00
Eladash aed560b630 Implemnt various HLE CellSpurs functions 2020-10-01 18:16:13 +03:00
Eladash 871b15f6e1 PPU: fixup for Accurate 128-byte reservations (#8998) 2020-10-01 18:15:07 +03:00
Megamouse ef0faf03fd Overlays: Use Back instead of Cancel 2020-10-01 12:26:18 +02:00
Megamouse 5226076676 Emu: use vulkan as default renderer 2020-10-01 09:19:13 +02:00
Megamouse 046923d9f7 Add Accurate PPU 128 Reservations to Debug tab 2020-09-29 10:26:23 +02:00
Megamouse 531eb04fd7 cellGameSetParamString: fix string sizes 2020-09-29 08:44:25 +02:00
Eladash f4ca6f02a1 PPU: Implement support for 128-byte reservations coherency 2020-09-28 22:34:42 +03:00
Eladash 3f7eba19c8 PPU: Upgrade reservations to 8-byte always 2020-09-28 22:34:42 +03:00
kd-11 04ff7913b4 rsx/codegen: Workaround for borked hardware
- Bitwise or does not evaluate correctly for some hardware.
  Substitute with subtraction instead.
2020-09-28 22:18:36 +03:00
Eladash 09cddc84be SPU/PPU: Implement Atomic Cache Line Stores 2020-09-27 20:09:21 +03:00
kd-11 9baef8c705 rsx: Emit simpler fragment program code
- Optimize clamp16
- Use bfe instead of shift-and
2020-09-27 18:56:04 +03:00
kd-11 a14a358b73 rsx: Optimize vertex decoder to generate simpler code
- Significantly improves compilation speed by simplifying most of the code and doing something similar to LICM.
  * Actual decoding is now vectorized and performed in one step rather than in a loop.
  * Switches inside loops are removed and replaced with simple comparison. Generates much nicer (and smaller) GCN bytecode.
2020-09-27 18:56:04 +03:00
kd-11 259844f4f3 vk: Disable spirv optimizer
- I've not found it to be very useful and it just breaks good code right now.
  TODO: Re-enable when things improve.
2020-09-27 18:56:04 +03:00
Bevan Weiss 264df11132 xxHash: Update to v0.8.0 xxHash (#8980)
* xxHash: Update to v0.8.0 xxHash

Removed build of XXHSUM test application for xxHash also.
2020-09-27 01:10:31 +01:00
Eladash 53c8ed6a63 vm: Fix stack memory release, always reset memory flags 2020-09-26 21:48:12 +03:00
Eladash f22348a9f9 sys_memory: Improve sys_memory_get_page_attribute for stack 2020-09-26 21:48:12 +03:00
Eladash 83d71519e0 Implement HLE sys_config stack allocation 2020-09-26 21:48:12 +03:00
Eladash 8ad36e2526 Fix fs::delim type, fix "." and ".." processing in fs::get_parent_dir (#8975)
* Fix fs::delim type

* Fix fs::get_parent_dir: "." and ".." processing
2020-09-26 19:18:32 +01:00
Eladash 0f67c68993 sys_mmapper: return ENOMEM on memory greater than UINT32_MAX (#8982) 2020-09-26 18:06:06 +01:00
Eladash b79d236bfa cellSearch: use std::hash (#8981) 2020-09-26 17:28:19 +01:00
Bevan Weiss 92efaf0bba GUI: Fix exception on invalid AudioRenderer
The findData() on the invalid value correction wasn't working, and was still returning -1.
This was then used in the enable_buffering lambda as the IndexChanged callback, and throwing the Assert.

Have replaced this usage with a lambda to manually find the appropriate entry. Since we localise the text displayed, neither findData nor findText of the combo box did the job.
I haven't touched the is_ranged use of findData.
2020-09-25 16:40:32 +02:00
Eladash 3b11f22062 MSVC bug workaround 2020-09-25 13:26:08 +03:00
Eladash 6164b3d2e2 Compilation fix 2020-09-24 21:00:23 +03:00
Eladash c806da51f8 Implement cellGameDeleteGameData (#8962) 2020-09-24 20:13:19 +03:00
Eladash 183aa31319 cellSysCache: Global hdd1 lock
Take advantage of recursive locking.
2020-09-24 18:06:51 +03:00
Eladash 7b3c0a69f3 kernel-explorer: Implement Filesystem Destcriptors information 2020-09-24 18:06:51 +03:00
Eladash 6b11d82dd0 Win32 FS: Always use FILE_SHARE_DELETE 2020-09-24 18:06:51 +03:00
Eladash d0f1b29b39 Win32 FS: Fix fs::utime for directories 2020-09-24 18:06:51 +03:00
Eladash b8fa6fb4c4 Win32 FS: Rewrite (fix) vfs::host::rename 2020-09-24 18:06:51 +03:00
Eladash 22269ca0d7 Registers Editor: Implement PPU/SPU reservation control (#8968) 2020-09-24 11:44:17 +02:00
kd-11 9ea478008c vk: Properly initialize float64 support for SPIRV 2020-09-24 01:30:21 +03:00
Bevan Weiss 20f1eb865b Update rpcs3/Emu/system_config.h
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-09-23 21:15:45 +02:00
Bevan Weiss 53212ba7a9 Core: Add date/time offset capability for console time
Provides a setting which can be applied per game, and allows for a custom date/time to be set.
The console time will then apply this as an offset to the computer wallclock.

This allows for games which look at the console time to determine their gameplay to be adjusted.
2020-09-23 21:15:45 +02:00
Eladash 3372409590 cellGameContentPermit: Fix missing PARAM.SFO writeback (#8934) 2020-09-23 20:35:06 +03:00
Morgan Creekmore 4fe2951509 Fixed formatting 2020-09-23 20:27:30 +03:00
Morgan Creekmore ff8a94714f Add additional NV4097 methods to gcm_printing 2020-09-23 20:27:30 +03:00
Morgan Creekmore b45d6fee2d Fix methods_name indentation 2020-09-23 20:27:30 +03:00
Morgan Creekmore f44e696edf Added missing NV methods for gcm_printing 2020-09-23 20:27:30 +03:00
Eladash 5a049322ed HLE: Always return empty paths if game content does not exist in cellGameContentPermit 2020-09-23 20:24:21 +03:00
Bevan Weiss 04deb97f94 MSVC 16.8 Preview 3.1 compiler fix
The latest MSVC 16.8 Preview 3.1 cl.exe no longer likes the implicit conversion from false->std::shared_ptr
But it's happy with nullptr

Not the ideal solution, but it will kick the can down the road a little.
2020-09-23 12:44:32 +02:00
Eladash 0c3c34179e TROPUSR.DAT fixup (#8960) 2020-09-23 03:47:54 +01:00
Silent e938ddda2c Add playtime to the value from settings
Fixes playtime being wiped out when running
the game with --no-gui.
2020-09-23 00:06:29 +02:00
Eladash 97e26f9d6c Trophy fixup 2020-09-22 22:42:43 +03:00
Eladash bfa78870cb SPU: Fix unregistered channels in RCHCNT
Shouldn't throw exception on realhw.
2020-09-22 19:47:47 +03:00
Eladash ad37259ccc SPU: Implement many missing channel counts 2020-09-22 19:47:47 +03:00
Eladash 418968d974 sceNpTrophy: Add logging of commSign 2020-09-22 19:46:52 +03:00
Eladash 89905bc1c4 sceNpTrophyRegisterContext: Implement SCE_NP_TROPHY_STATUS_NOT_INSTALLED 2020-09-22 19:46:52 +03:00
Eladash 3a96d99187 sceNpTrophyRegisterContext: Atomically create trophy data 2020-09-22 19:46:52 +03:00
kd-11 a50ea09053 rsx: Properly pass format_class information during RTV/DSV resource barrier
- Also takes the opportunity to remove repeating code in a minor refactor.
2020-09-22 12:19:54 +03:00
kd-11 d012abd924 vk: Improve image transfer and scaling
- Handle typeless src and dst with aliased typeless format
- Optimize typeless transfers by only dealing with affected texels.
  * Eliminates redundant dst->typeless transfer of full image (very expensive)
  * Eliminates full src->typeless transfer of full image and replaces with only affected region
  * Requires significantly smaller output buffers, saving on VRAM cost
2020-09-22 12:19:54 +03:00
kd-11 7ed82c0791 rsx: Always force typeless copy if memory is crossing aspect boundary 2020-09-22 12:19:54 +03:00
Eladash cf61198fe3 HLE: Implement ERROR_BROKEN in cellGameDataCheck (#8945) 2020-09-22 10:30:31 +02:00
Megamouse 5d50602397 Qt/Input: fix default pad handler
We accidentally always saved keyboard to Player 1 if null was selected.
The new code will only apply keyboard by default if the config file was not found.
2020-09-22 06:59:38 +02:00
Megamouse 34eff440eb Qt: Fix playtime datatype 2020-09-21 22:17:40 +02:00
Megamouse 0b42cf06f8 sceNpTrophyCreateContext: improve commId logging 2020-09-21 15:32:02 +02:00
Megamouse 4c4be331f5 HLE: Fix sceNpTrophyCreateContext
fixes #7431 Soldner-X
Assuming that a SceNpCommunicationId should have a format like "TEST12345", then there is no need to delete termination characters after we already created a truncated string with 9 characters + null terminator.
The current behaviour does not work at all, because in case that we actually have a non-null termination character, deleteTerminateChar will step over the last x chars in the already truncated ID until it forcefully finds a character of its liking. eg. term='2': "TEST12345" => "TEST1" => "TEST1_00"
2020-09-21 15:32:02 +02:00
Megamouse 511e9920c2 patch_engine: Apply patch when APP_VER is unknown 2020-09-21 11:59:57 +02:00
Eladash 75c3fdcb6f Fix cellGameBootCheck PARAM.SFO reads 2020-09-21 06:36:34 +03:00
Eladash 9031c5a6e0 Win32 FS: Fix fs::stat for drives 2020-09-21 06:35:42 +03:00
Eladash 5ac6f090fc Fix cellGamePatchCheck (#8933) 2020-09-19 19:38:22 +01:00
Eladash 0d183a24be cellFs: Rewrite cellFsGetFreeSize 2020-09-19 13:53:04 +01:00
Eladash a21790b992 sys_fs: Fix sys_fs_disk_free 2020-09-19 13:53:04 +01:00
Eladash 762ceaf87e sys_fs: Do not expose real hard drive available space!!!!!!!!!!!!! 2020-09-19 13:53:04 +01:00
Eladash 2620a51cc9 cellSaveData: Minor fix 2020-09-19 13:53:04 +01:00
Eladash f1e8739608 Always reset size in cellGameGetSizeKB
Reversed.
2020-09-19 13:53:04 +01:00
Eladash b31a0115b2 cellFsStat Improvements 2020-09-19 13:53:04 +01:00
Eladash ed032dc985 cellGame: Improvements 2020-09-19 13:53:04 +01:00
Eladash c436ef0c6f SPU: Implement channels 70, 71, add naming for channel 69 (#8932) 2020-09-19 13:08:35 +01:00
kd-11 9db97278f3 rsx: Lower error message to warning
- Mismatched texture handling is a TODO that will be handled with texturing rewrites
2020-09-19 01:55:59 +03:00
kd-11 d3898fda57 rsx: Release misconfigured texture memory before attempting reupload 2020-09-19 01:55:59 +03:00
eladash 36ac68b436 SPU: Implement events channel count, minor interrupts fixes 2020-09-18 21:57:24 +03:00
Bevan Weiss cdc3ee6c1c GUI: Small changes to terminology
In line with #4259
Trophies are changed to be 'Earned' / 'Not Earned', which also matches both the RSX displays the notification frame
And changed window title of Screenshot Preview -> Screenshot Viewer because as mentioned in the issue, the screenshot has been taken already, so it's not a preview (it is the view).
2020-09-18 08:21:39 +02:00
Megamouse 6540393df5 Look for rap file for network license
A network license should be the same as a local license, with the difference that a local license is only checked online once, while a network license is checked online on each boot.
Since we don't check online anyway, the two should theoretically be identical for our purposes.
2020-09-17 00:39:41 +02:00
Megamouse 3f534b33ec Qt: allow handling of the game window while the settings dialog is open (#8921)
This should make it easier to handle dynamic settings.
2020-09-16 23:32:27 +02:00
SEt 9a6aac1662 Improve pad support (#8800)
* Add support for another DS3 HID Report ID for Win7
* Add support for reading accel/gyro pad data over SCP
2020-09-16 22:36:06 +02:00
Megamouse 4c70864588 Add rsx capture shortcut 2020-09-16 21:57:55 +02:00
Eladash 17c8b34088 atomic.cpp: Optimize sema_get to not always use atomic instruction (#8907) 2020-09-16 22:15:14 +03:00
kd-11 7900780cea vk: Fix nul section crash due to unexpected format (B8) 2020-09-16 20:14:44 +03:00
Eladash 0eb739756e kernel-explorer: Account for PPU IDs invalidation in lwmutex 2020-09-16 14:31:15 +02:00
Eladash 05364908f3 kernel-explorer: Fix lwmutex owner display 2020-09-16 08:07:49 +02:00
kd-11 92d65ff3c2 rsx: Add support for mixed data types when sampling shadow coordinates 2020-09-15 17:37:52 +03:00
Eladash a52a16807f PPU: Use SEQ-CST memory barrier in reservation load 2020-09-15 11:20:17 +02:00
Megamouse 8df1d74395 Add disambiguations to the new translations
We need this in case there are identical strings in the same file
2020-09-14 18:24:18 +02:00
Megamouse f84697ad5c move localized_string_id to own file
I dont know if there was a circular dependency issue
2020-09-14 18:24:18 +02:00
Megamouse a2da187615 HLE: localize most - if not all - exposed strings 2020-09-14 18:24:18 +02:00
Megamouse d0ffbbfc4d Qt/overlays: use Argument list for translatable strings
This is somewhat crippled for now. It only takes a single argument in the callback
2020-09-14 18:24:18 +02:00
Megamouse 460a933267 Qt/overlays: Localize most rsx overlays 2020-09-14 18:24:18 +02:00
Eladash fe9c61fe73 atomic.hpp: Fix atomic_storage_futex::raw_notify 2020-09-12 22:11:40 +03:00
Eladash 3206378ae6 sys_spu: Fix overexecution of cpu_return() 2020-09-12 22:11:40 +03:00
Eladash 7ce790f369 SPU: Use ASM for AVX2 coompilation instead of intrinsics 2020-09-12 18:49:49 +03:00
Eladash 5db1427923 cellGame: Implement cellHddGameCheck2 2020-09-12 11:00:24 +02:00
Eladash 81eceb1728 cellSysUtil: Implement CELL_SYSUTIL_SYSTEMPARAM_ID_LICENSE_AREA 2020-09-12 11:00:24 +02:00
Megamouse 639650c65a Add more defines to cellSysutil 2020-09-12 09:56:51 +02:00
Eladash 9d034ea4a2 Register Editor: Allow to modify PPU priority 2020-09-11 21:54:24 +02:00
Eladash 9ff0b460a2 SPU: Make PUTLLUC LR event accurate 2020-09-11 09:02:18 +02:00
Eladash 4f0125a0e9 SPU: Remove "Accurate PUTLLUC" setting (always accurate) 2020-09-11 09:02:18 +02:00
RipleyTom 54493747a8 Updates wolfssl and curl to official repos 2020-09-10 23:09:36 +02:00
Eladash b48c036636 Fix bitfield operator &= 2020-09-10 19:04:53 +02:00
Eladash d489b02fc1 PPU: Do not allow unaligned/unmapped reservation addresses 2020-09-10 13:35:57 +02:00
Megamouse 595fdb2f57 patch_manager: fix downloader location
it was spawning on the main window instead of the patch manager
2020-09-10 09:13:39 +02:00
Megamouse 8d56dd1969 patch_manager: use rename to back up old patch file 2020-09-10 06:58:44 +02:00
Megamouse 44371dedd9 fix fs::copy_file on linux 2020-09-10 06:58:44 +02:00
Megamouse fb62c297fa patch_manager: log g_tls_error 2020-09-10 06:58:44 +02:00
RipleyTom 676fed7cfc Only bind 3658 with RPCN 2020-09-09 23:56:25 +02:00
RipleyTom d9d354c981 Makes DNS processing more consistent 2020-09-09 23:56:25 +02:00
Eladash 8c8048f037 Win32 FS: Use FindFirstFileExW in fs::stat, fs::exists, fs::is_dir, fs::is_file
Co-Authored-By: Bevan Weiss <bevanweiss@users.noreply.github.com>
2020-09-09 21:57:01 +02:00
kd-11 da6760ed98 vk: Simplify shadow comparison operations for non-integer formats
- Just use hardware PCF, it makes everyone's life easier.
2020-09-09 22:11:12 +03:00
Megamouse 1d04f14a53 patch_manager: fix success message 2020-09-09 20:34:17 +02:00
Megamouse 570eee3202 patch_manager: handle sha256 checksum 2020-09-09 20:34:17 +02:00
Megamouse ca07605835 patch_manager: layout fixes 2020-09-09 20:34:17 +02:00
Megamouse 46e8b4f561 patch_manager: add download button 2020-09-09 20:34:17 +02:00
Eladash 1e4655aef6 SPU: Remove STOP 0x0 hack (#8873) 2020-09-09 11:36:04 +01:00
Megamouse 3e1b76258e Qt: Update tooltip for "disable keyboard hotkeys" 2020-09-09 00:22:48 +02:00
Megamouse a845a0395a Input/Qt: Properly reset mouse hide timer 2020-09-09 00:22:48 +02:00
Megamouse f0053bfc1a Input/Qt: Dont lock unused mouse in keyboard pad 2020-09-09 00:22:48 +02:00
Ani 22dc2947b3 hle: Implement ID_CURRENT_USER_HAS_NP_ACCOUNT (#8864) 2020-09-08 15:12:47 +01:00
Eladash 43fce92aa9 PPU: reduce LARX logging level to warning 2020-09-08 15:23:55 +02:00
kd-11 6380e67af9 rsx: Fix depth clipping
- Fix special case where n=f making (f-n) = 0
- Dynamically update depth range by setting dirty bits
- Fix depth bounds when n=f and bounds test is disabled
2020-09-08 15:33:08 +03:00
kd-11 dc465df3bc rsx: Enable support for extended range in depth buffer
- Software clipping emulation is used here as OpenGL does not have explicit clip control.
- Hardware clip control for vulkan to be enabled after this.
2020-09-08 15:33:08 +03:00
kd-11 2e88924cb9 rsx/gl: Refactoring and cleanup
- Fix incorrect memory requirement calculation for D32FS8X24_PACK64 data type on GL
- Removes a lot of spaghetti code in GL backend from years of accumulation
- Retires several now-useless methods from RSX util toolbox
2020-09-08 13:53:06 +03:00
Megamouse fee96ec92d fix some warnings 2020-09-08 12:05:51 +02:00
Bevan Weiss c39ad1ee12 Fix Windows UNC Path Handling
In Windows, when using Open Install Folder etc with UNC paths, nothing would happen.
This replaces the "file://"+path usage with QUrl::fromLocalFile(path) which appears to handle this better.
Needs testing under non-Windows.
2020-09-08 09:38:39 +02:00
Rafał Mikrut 5669c7497d Update Building.md for Ubuntu based distros 2020-09-08 09:12:24 +02:00
QuadDamage 60f8fc293d VFS: fix off-by-one error in vfs::escape() 2020-09-08 08:20:41 +02:00
Eladash 9134388f94 sys_process: Implement exitspawn error checking 2020-09-08 07:36:36 +02:00
RipleyTom 10820fa135 Implement sceNpSignaling & signaling improvements (#8836) 2020-09-07 22:50:17 +01:00
Eladash 2f3e0044f1 PPU: Cleanup & unify reservation loads (#8849) 2020-09-07 22:06:09 +01:00
Eladash 5060c779da SPU: Use unaligned instructions in mov_rdata_avx (MSVC) (#8851) 2020-09-07 21:32:44 +01:00
kd-11 6d2cb94e3e gl/vk: Support swizzled data for RCB/RDB 2020-09-07 22:31:57 +03:00
kd-11 85e5b077f7 gl: Overhaul upload and download routines for textures to go through shared image_to_buffer and buffer_to_image routines.
- This automatically adds support for depth float textures as well
2020-09-07 18:25:54 +03:00
kd-11 85dd1b4ea9 vk: Fix fconvert job issues
- Fix compilation bug caused by typo
- Invert to/from for consistent declarations
- Fix dst_swap when From == 2
2020-09-07 18:25:54 +03:00
kd-11 220e86bbd1 gl: Accelerate D24X8_UINT operations
- Adds compute decoding for D24X8_UINT on both download and upload routines
- Adds support for D24X8_UINT operations for typeless copy
2020-09-07 18:25:54 +03:00
Eladash abc715bc5c SPU: Make PUT transfers use SEQ-CST ordering on Accurate DMA (#8844) 2020-09-06 12:09:14 +01:00
Bevan Weiss e1adb18491 GUI: Additional translation entries
A few more items:
Standardising on 'OK' for all base language uses (rather than 'Ok', or 'Okay').
It's perceived as the 'most correct' variant, and importantly having a single variant is best from a translation perspective.

Added plurality handling for multiple PPU caches created.

Added plurality handling for multiple items deleted in save manager.

Capitalised trophy grade to align with Sony terminology.
Brought trophy name position into translatable string (for languages that might really want to deviate from SVO)
2020-09-06 11:50:27 +02:00
Eladash 2688081656 SPU: Use unaligned AVX instructions for cmp_data_avx 2020-09-06 07:51:12 +03:00
Eladash e4abd3dc5a SPU: Do not ignore pending PUT tranfers just becase GET may not be cache-line atomic
This is not the proper way to emulate non-atomic GET tranfers, as it makes it seems as if PUT atomic tranfers arent atomic. (TODO)
Incomplete GET cache line accesses still do not verify data though.
2020-09-05 22:23:55 +03:00
Eladash c7a185d4e7 SPU: Fix not acuiring reservation locks on DMA with more than one cache line (Accurate DMA) 2020-09-05 22:23:55 +03:00
Bevan Weiss baf96b3eb6 RSX: Update manual string creation -> std::string()
Replace manual string creation with call to std::string() constructor passing in char*
This appears to drastically reduce the cache impact here
2020-09-05 10:38:32 +03:00
Eladash 8e2b07ba9e sceNpDrm: Relax file extension checks 2020-09-04 22:35:18 +02:00
Eladash 0b023d4e28 SPU: Make Accurate GETLLAR, PUTLLUC settings dynamically adjustable 2020-09-04 10:20:44 +02:00
Eladash 4ffc58a8ce SPU: Cleanup for Accurate PUTLLUC
Should no longer affect GET commands because Accurate DMA is available for this functionality.
2020-09-04 10:20:44 +02:00
Eladash c5c9ea1b21 SPU: Make GET's full and aligned cache line accesses atomic with Accurate DMA 2020-09-04 10:20:44 +02:00
kd-11 3c43d8fe05 rsx: Fix execution barrier insertion
- In case of element re-arrangement, the barrier should obey the current insertion pointer
2020-09-04 09:34:13 +03:00
Megamouse 21f06e1074 improve tooltip coverage 2020-09-03 18:31:11 +02:00
Bevan Weiss 875e252db3 GUI: Tooltips for mouse hide if idle and resize on boot
The original commits for the mouse hide on idle included definitions for tooltips, but didn't assign them correctly.
This fixes that up, so that tooltips exist.

And the resize height / width settings didn't have any tooltip applied.
So this extends the current resize setting tooltip to also trigger on the height / width hover (at least indicating that they are associated with this setting).
2020-09-03 18:31:11 +02:00
Bevan Weiss 610e71b71b Internationalisation updates
Added description 'Never played' for games with no elapsed time indicated.

Tidied up game list times to handle translation for larger unit of time in each time pairing.
NOTE: Latin will be a problem (sorry for any native Latin speakers)
2020-09-03 11:49:21 +02:00
Eladash 73d23eb6e6 SPU: Implement Accurate DMA (#8822) 2020-09-02 23:58:29 +02:00
Jacques Yakoub ddfa077c3e Qt: simplify GetVerboseTimeByMs logic (#8824)
* Qt: simplify GetVerboseTimeByMs logic

Follow recommandation from QT : https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals
#8473
2020-09-02 18:06:16 +02:00
Megamouse 006f546e7c Fix idle timer 2020-09-02 14:22:00 +02:00
Megamouse 1dac01498c Update mouse lock logic
- fix headers
- update cursor whenever the mouse is moved
- unify cursor logic
- move m_mouse_hide_and_lock logic to handle_cursor (toggle_fullscreen is the trigger, not the handler)
- disable mouse lock and idle timer if the window is inactive
2020-09-02 14:22:00 +02:00
Bevan Weiss ae0e454fc2 Use dynamic_cast to convert QWindow m_target to gs_frame
Used to access get_mouse_lock_state rather than going through the QWindow property tables.

Modify mouse hide and lock to default OFF when entering Windowed mode, and to default ON when entering Fullscreen unless 'show cursor in fullscreen' is configured
2020-09-02 14:22:00 +02:00
Bevan Weiss ca3ee019cc GUI: Mouse Hide and Lock Keyboard Shortcut
This should address the second point of #4502.

A few notes:
1. it changes the current behaviour of the 'Fullscreen cursor'.  Currently it defaults to be captive.  This changes it so that it defaults to NOT being captive, but can be made captive with the CTRL+L key combination.
2. There are situations when in windowed mode it's possible to escape the captivity (it's like a minigame if you will).  This requires the mouse movement to exceed the bounds of the window in a single event scan.  It will just show up as a temporary visibility of the cursor when outside of the window bounds.  It's not too difficult to 'fix', but might not be a likely enough scenario to warrant either.
3. There currently isn't an ability to change what this keyboard combo maps to, but it's inline with a collection of other similar keyboard mappings.  I think adding such a more generic keyboard mapping system (not for just keypad items, but system items.. e.g. so that Emulator stop could be mapped to something other than CTRL+S etc) is a bit out-of-scope of this particular PR.
2020-09-02 14:22:00 +02:00
Ani a86a3d2fee rpcs3_version: Bump to 0.0.12 (#8815) 2020-08-31 23:38:51 +01:00
kd-11 a917f55ef8 vk/sdk: Sync with vulkan SDK v148 (#8814)
- Sync with vulkan SDK 148
- glslang library was split into several smaller libraries
- HLSL is no longer needed
2020-09-01 00:57:38 +03:00
Ani 21b535b5c5 gui/themes: Convert kot-bg to jpg (95%) (#8809)
No perceived loss of image quality, reduces size from 8.1 MB to 2.0 MB
2020-08-31 05:35:42 +01:00
kd-11 af9e217fa4 vk: Improve D16F handling
- Adds upload and download routines. Mostly untested, which is why the error message exists
2020-08-30 09:26:37 +03:00
Bevan Weiss 9a51f22265 Remove call to start m_mousehide_timer in gs_frame constructor 2020-08-29 16:14:11 +02:00
Bevan Weiss 144b185802 Woops... premature commit/push.
Fixed up the usage of connect
2020-08-29 16:14:11 +02:00
Bevan Weiss 3c0f6a2919 Used new Qt connect syntax
Fixed indenting
Renamed click callback argument from 'val'->'checked'
Converted m_gui re-usage to just reference ui
Removed implicit capture from spinbox lambda
Corrected millisecond acronym from mS->ms
Removed superfluous QTimer include in gs_frame.cpp
2020-08-29 16:14:11 +02:00
Bevan Weiss 22c33d4fb4 Added settings and logic for auto-hide of mouse cursor.
In line with the Show Cursor in Fullscreen settings, these settings are only updated when the render window is first launched, and not during the game.
This could be revised (along with the Fullscreen Cursor) if it's more desired.
2020-08-29 16:14:11 +02:00
kd-11 e9cdb248a0 glsl: Properly implement shadow filtering when running emulated shadow compare
- Previous code was completely borked
2020-08-29 02:03:09 +01:00
kd-11 e8274d5a59 vk: Fix depth format mismatch detection in copy_image 2020-08-29 02:03:09 +01:00
Eladash 6952be5ce4 Debugger: Replace SPU register perefix '$' with 'r' 2020-08-28 20:44:13 +02:00
RipleyTom 4317291827 tcp_timeout_monitor deadlock fix (#8783) 2020-08-28 01:06:01 +01:00
Nekotekina bd40430d2b Fix some warnng in lv2.cpp 2020-08-28 01:54:39 +03:00
Nekotekina ebc4a0188a Restore some code 2020-08-28 01:54:39 +03:00
Nekotekina bfa4fcf584 Use g_fxo for progress_dialog_server 2020-08-28 01:54:39 +03:00
Eladash 48f70fbf10 Fix UB in Emulator::Load 2020-08-27 23:52:37 +01:00
Eladash 019d2d5dcf Implement HLE cellSpursAddUrgentCommand 2020-08-27 23:52:37 +01:00
Eladash 17f7f329a8 Log PRX segment end for usage with kernel explorer 2020-08-27 23:52:37 +01:00
Eladash 933737e8f0 PPU: log LR in HLE functions 2020-08-27 23:52:37 +01:00
Eladash 47b545282e SPU: Fix events ACK, minor optimizations (#8771) 2020-08-27 21:36:54 +01:00
RipleyTom 190822c2b2 RPCN Client (#8663) 2020-08-27 20:47:04 +01:00
kd-11 d000d648b0 vk: Fix some minor spec violation
- Stencil clear pass does not consume an image, do not bind one.
- Add push_barrier to allow push-pop semantics for texture barrier insert.
2020-08-27 12:52:28 +03:00
kd-11 d257ba5156 vk: Add some more diagnostic messages for unoptimized image transfer setups 2020-08-27 12:52:28 +03:00
kd-11 9828d6146b rsx: Fix format matching when aggregating textures
- When copying depth-depth, prefer own format over depth int format
2020-08-27 12:52:28 +03:00
kd-11 9e4bec8cec vk: Fix some missing render target declarations 2020-08-27 12:52:28 +03:00
kd-11 65ead08880 rsx: Refactor and improve image memory manipulation routines 2020-08-27 12:52:28 +03:00
kd-11 f6c6c04648 vk: Implement transport for D24S8_FLOAT data 2020-08-27 12:52:28 +03:00
kd-11 794378d5e9 rsx: Do not create depth textures as blit engine targets. 2020-08-27 12:52:28 +03:00
kd-11 a5ac5a9861 rsx: Separate uint depth formats from float depth formats 2020-08-27 12:52:28 +03:00
kd-11 faaf28b41d rsx: Basic support for creating depth float formats 2020-08-27 12:52:28 +03:00
GooseWing 700c540434 Add Nekotekina skin (#8776)
* adding kots

* More sharper neko on background

Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-08-27 07:15:24 +02:00
RipleyTom c177bf7480 Forces MSVC Toolkit to 14.25.28610 in Azure Pipelines 2020-08-27 06:39:46 +02:00
Eladash bccfb1cda7 Fix empty input in Registers Editor 2020-08-26 08:20:16 +02:00
Eladash c099bb817f Debugger: Disable PPU address redirection
It causes more confusion than it helps.
2020-08-25 17:43:07 +02:00
Eladash 7fe98d8d66 Debugger: Add missing PPU stack register checks 2020-08-25 17:43:07 +02:00
Eladash d356e0d1e7 Debugger: Register Editor Improvements 2020-08-25 17:43:07 +02:00
Eladash 3ce7fd7894 Debugger: Fix instructions editor 2020-08-25 17:43:07 +02:00
Eladash 6f42297b58 Debugger: Fix scrolling using PageUp, PageDown, KeyUp, KeyDown 2020-08-25 17:43:07 +02:00
Eladash c5aebe4564 Debugger: Implement PPU SLWI, SRWI, SLDI mnemonics 2020-08-24 02:10:51 +03:00
Eladash 841b8fad38 SPU: Fix timer events 2020-08-24 01:57:32 +03:00
Bevan Weiss ab0df0a0f5 Support for Namco GCon3 gun (#8757)
This gun now works (passes calibration) in Time Crisis 4.
2020-08-22 15:41:08 +02:00
Eladash 27e3317449 [HOTFIX] Fix UB in Emu/System.cpp 2020-08-22 11:55:08 +02:00
Eladash edc09e22b4 PSF: Avoid redundent string copies in psf::array/string/get_string (#8707) 2020-08-21 23:55:17 +01:00
Megamouse b487c09d34 Revert "Qt: speed up list refresh"
This reverts commit 715f4f0669.
2020-08-21 09:51:36 +02:00
Eladash 4a40ef6a19 Debugger: Use Signed Hexadecimal formatting (#8751) 2020-08-20 22:07:31 +01:00
Eladash bcddbc15f0 Debugger: Fix PPU stepping on non-TSX 2020-08-19 19:48:35 +01:00
Eladash 2a19d0a579 kernel-explorer: Add RSX handlers events info 2020-08-19 09:09:24 +02:00
Megamouse 9af66e22da evdev: log axis information in pad settings 2020-08-18 18:29:35 +02:00
Megamouse 715f4f0669 Qt: speed up list refresh 2020-08-18 11:00:04 +02:00
Megamouse e6e753f37f Qt/Linux: fix QT_AUTO_SCREEN_SCALE_FACTOR typo 2020-08-18 10:04:31 +02:00
Megamouse e958c3cc6a Qt: fix YoRHa QTreeWidget item style for CheckBoxes 2020-08-18 10:04:31 +02:00
Eladash 19500ac9ad Fix truncation warning in sys_cond.cpp 2020-08-17 17:36:27 +01:00
Eladash 25dee4a78e Fix bitops test 2020-08-17 17:36:27 +01:00
Eladash ee953f7953 Fix vm::reservation_update 2020-08-16 22:58:49 +03:00
Zion Nimchuk acee590733 Ensure pushing builds to Github is only done on master branch 2020-08-16 17:35:19 +01:00
Zion Nimchuk cd94d9849d Windows GitHub release hotfix
Improve id variable parsing and print release.json to catch error
2020-08-16 17:35:19 +01:00
Zion c3709fa744 Manually upload Windows Github Release using curl. Actually fixes #7938 (#8715)
For some reason Azure would evaluate the GitHub release instantly and
complain about missing/invalid GitHub Release deployment and fail to
even start the build, this fixes the issue by just manually uploading it
via the GitHub API and curl.
2020-08-15 20:46:53 +01:00
Eladash 853e2b90a3 rsx: Minor rsx::ceil_log2 bugfix 2020-08-15 20:39:21 +03:00
Eladash 995cb8125e SPU LLVM: Improve approx FCGT (#8728) 2020-08-14 19:33:35 +01:00
Bevan Weiss 01d3585bf3 Bring back the non-compliant define, but version limited
As noted, we've done something we shouldn't have with MSVC compiler specific defines.  But to avoid breaking the MSVC build environment, leave this define in there until the MSVC version when it is actually exposed by the compiler itself (v16.8).
2020-08-14 18:34:34 +01:00
Bevan Weiss a11afe05bf MSVC changes
Add support for compilation on x64 toolchain (x86 cl.exe was running out of heap space in vm.cpp)

Also took the opportunity to change compile optimisation from /Ox to /O2, as /O2 provides better optimisation than does /Ox

Also, we shouldn't be explicitely setting compiler tool defines (__cpp_lib_bitops), so remove that from types.h
2020-08-14 18:34:34 +01:00
Whatcookie 9e4f43f4d1 SPU LLVM: Add icelake optimized paths for SHUFB (#8712) 2020-08-13 15:00:56 +01:00
Eladash 8cdfe5952a SPU/PPU LLVM: Improve 0 addend FMA detection (#8709) 2020-08-13 04:13:08 +03:00
Eladash 0f8ca1f7c5 SPU: Implement RSX accurate reservations on TSX (#8721) 2020-08-13 00:00:37 +01:00
kd-11 fd2607ad52 rsx: Fix XBGR vs XRGB screenshots 2020-08-12 20:19:19 +03:00
kd-11 7e1b24224d rsx: Support XBGR flip image load from Cell memory 2020-08-12 20:19:19 +03:00
kd-11 56c63170b9 vk: Warn if GPU does not support RGBA8 natively 2020-08-12 20:19:19 +03:00
kd-11 b41349546c rsx: Proper support for typeless transform of ABGR framebuffers using the RGBA8 format 2020-08-12 20:19:19 +03:00
kd-11 6850533b50 rsx: Unify composite texture creation and management
- Some texture accesses require image compositing steps to assemble the requested image from existing subresources.
  Handle all the common routines in a unified manner to avoid having one broken path (e.g mipmap gather not supporting bitcast operations)
2020-08-10 13:31:22 +03:00
Whatcookie 4ce2ad54a8 PPU LLVM: Use VPERM2B to emulate VPERM (#8704)
- The VPERM2B instructions are a match of VPERM's behavior, besides operating in reverse byte order
2020-08-09 01:50:26 +01:00
Eladash 0c85d4c0d0 cellSaveData: Fix loss of "BLIST" and files' information in PARAM.SFO (#8706) 2020-08-08 23:40:47 +01:00
Eladash 57471f8c94 SPU LLVM: Fix signed zeroes handling on Accurate xfloat 2020-08-08 22:21:22 +01:00
Eladash 7e11855330 SPU/PPU LLVM: Fix FMA signed zeroes handling 2020-08-08 22:21:22 +01:00
Malcolm Jestadt f188589685 Utils: Add detection for Icelake-client tier AVX-512
- Implies support for everything that Skylake-X supports as well as AVX512IFMA, AVX512VBMI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, AVX512VPCLMULQDQ, AVX512GFNI, AVX512VAES
2020-08-08 00:33:22 +02:00
Megamouse 96428a7555 Log username 2020-08-07 21:57:08 +02:00
illusion d3585e1f80 move accurate rsx reservation to advanced 2020-08-07 09:34:27 +02:00
illusion c0c86521a2 add missing settings to configure 2020-08-07 09:34:27 +02:00
kd-11 22f5e7a9be vk: Generate valid image+image_view combinations for placeholder texture descriptors 2020-08-06 20:34:49 +03:00
Megamouse 06c42bba5d Qt: fixup for PKG installation 2020-08-06 17:32:29 +02:00
Bevan Weiss ada6db2df4 Replace ppu_module_manager Function Static with Class Static variable (static module map) (#8669)
* Replace ppu_module_manager Function Static with Class Static

Makes for a slightly 'cleaner' interface in my opinion, may also assist with adding thread read/write concurrency support in future if ever required (have left that out of this commit to match existing function).

Very slight performance improvements were seen in representative testing.
https://quick-bench.com/q/GMbgeNc-mZc21aqOKCofnbzPZvg

I didn't investigate whether static initialisation of the static_modules might actually be possible here, perhaps there's a way to do a constexpr / consteval of this.

* Fix up for old style cast syntax..

* Fixups from PR comments

Plus remove spurious type_traits include (from me) not picked up in previous PR

* Remove old code

* Update rpcs3/Emu/Cell/PPUModule.h

Co-authored-by: Eladash <elad3356p@gmail.com>

* Fix naming of static variable

Co-authored-by: Eladash <elad3356p@gmail.com>
2020-08-06 12:34:08 +02:00
Bevan Weiss eee5e812f7 Fix for incorrect assignment of ghlguitar
found_ghltar was potentially being overwritten if multiple USB devices were present
2020-08-06 12:01:21 +02:00
Bevan Weiss eb5ae94c24 sys_usbd tidy ups
Tidy up fake transfer iterator handling. erase invalidates all iterators including the current iterator (i.e. 'it'), given precedence ordering this was UB prior to C++17.  Splitting out to use return iterator from erase seems cleaner.
Also added some additional info to usb debug message to potentially help with #8666, and used the atomic (dev_counter) less often
2020-08-06 12:01:21 +02:00
kd-11 7109fe9889 rsx: Improve swizzled layout detection
- Reset swizzle flag to false automatically on section reset.
- Detect render target payload and extract swizzle information from it.
2020-08-05 23:23:38 +03:00
Megamouse 17557df9f4 Qt: unify package installation logic 2020-08-05 08:10:22 +02:00
Megamouse fab1f7d939 Qt: add rap files to pkg install file dialog 2020-08-05 08:10:22 +02:00
Megamouse 815d6f4223 Qt: fix input lag in pad settings
Looks like repainting stuff inside a resizeable layout is slow AF
2020-08-04 16:15:13 +02:00
Megamouse 25d73f5a70 Try to fix ugly GUIs 2020-08-03 22:03:15 +02:00
Megamouse d633a266c1 Add config override as cli arg: --config <path>
And add some more logging
2020-08-03 21:31:53 +02:00
dio-gh 938bf8624c make some cfg logs error instead of fatal
- in case there's a default value to fall back to, log with error
  instead of with a fatal
2020-08-03 20:59:47 +02:00
Megamouse 2cdb46b167 Qt: do not use on_<obj>_<action> syntax for slots
Qt tries to auto connect those
2020-08-03 20:17:35 +02:00
Megamouse 8799eebfe1 Qt: move some more settings to persistent_settings 2020-08-03 20:17:35 +02:00
Eladash 70fb5712e5 PPU interpreters: Fix VMAXFP NaN and signed zeroes handling 2020-08-03 15:43:00 +01:00
Eladash 6a51c27fde PPU LLVM: Fix VMAXFP, VMINFP NaN handling 2020-08-03 15:43:00 +01:00
Eladash 17f965c171 lv2: Minor fix of "unspecific ppu" path of _sys_lwcond_signal 2020-08-03 02:57:20 +03:00
kd-11 bd21930d1a rsx: Decode swizzled GPU data on CPU readback
- Currently this conversion is being done on the CPU to reuse as much code as possible.
  The expectation is that this almost never happens, so there is not point in increasing maintenance burden by adding compute paths
2020-08-02 16:14:11 +03:00
kd-11 4df933275b rsx: Propagate raster type of fbo sourced data throughout the pipeline.
- Tracks which kind of raster was done (Z-ordered vs linear) throughout the application.
- This allows to identify if data is in the expected format or not.
2020-08-02 16:14:11 +03:00
Megamouse 107129f95a Fix missing GPU in game window title 2020-07-31 01:13:00 +02:00
JohnHolmesII e11734f971 CI: Avoid trying to publish builds on forks 2020-07-30 23:36:10 +02:00
Megamouse 3bba9708d9 Gracefully abort headless mode with unsupported video renderers
Also fix no_return bug
2020-07-30 20:03:51 +02:00
Eladash dd497625a5 PPU LLVM: Fix constant folding of BitCast 2020-07-30 17:06:24 +01:00
Eladash f6764767f6 SPU/PPU LLVM: Fix cpu_translator::get_const_vector<v128>() 2020-07-30 17:06:24 +01:00
Eladash e52dd9dc6f SPU: Implement SYS_SPU_THREAD_OPTION_DEC_SYNC_TB_ENABLE (#8657) 2020-07-30 14:01:25 +01:00
Megamouse 03ae1481fb Don't open an error dialog in headless mode 2020-07-30 12:17:35 +02:00
Eladash 82068cf802 SPU: Fix spu_thread::cpu_stop() missed executions (#8656) 2020-07-30 10:07:18 +01:00
Megamouse ebf832214e cheat_manager: notify if no game is running 2020-07-29 13:18:33 +02:00
Megamouse 4315363f4b cheat_manager: make sure that the patches path exists 2020-07-29 13:18:33 +02:00
Megamouse f073ff8fe8 overlays: fix minor warning 2020-07-29 13:18:33 +02:00
Megamouse 47040be3ad cheat_manager: improve parser errors 2020-07-29 13:18:33 +02:00
Megamouse d0bb9d2b62 cheat_manager: move cheats.yml to patches folder 2020-07-29 13:18:33 +02:00
Megamouse cb6e536fbd cheat_manager: use enum values for columns 2020-07-29 13:18:33 +02:00
Megamouse f820a7a205 cheat_manager: disable search buttons if nothing was entered in the search field 2020-07-29 13:18:33 +02:00
Megamouse 16212854b4 cheat_manager: fix long search result lists 2020-07-29 13:18:33 +02:00
Megamouse 1c6003acd5 Improve error handling of config nodes
These conditions are most likely only gonna be met during development
2020-07-29 11:28:16 +02:00
Megamouse ef3e8d26ce Improve error handling during config loading 2020-07-29 11:28:16 +02:00
Eladash 21a1072117 SPU LLVM: Minor cleanup after #8559 2020-07-29 03:32:21 +03:00
MSuih 2ce49e3674 Improve error messages in firmware install 2020-07-28 20:55:33 +02:00
Megamouse e58e1ebfd9 Qt: fix download menu visibility 2020-07-28 20:07:21 +02:00
Bevan Weiss 609182b131 Update cellAudio to use float constants instead of doubles
Another simple Clang recommendation
2020-07-26 17:23:02 +03:00
Bevan Weiss 7898ae6fe6 VK_REMAP enum is signed.. but later case comparison is unsigned
another clang directed fix up... might be involved with swizzle..
2020-07-26 15:27:51 +03:00
Malcolm Jestadt a9d0ffcac1 SPU LLVM: Avoid additional endian swapping
- Avoid additional endian swapping with the ROTQBY and ROTQBYBI instructions
- ROTQBYI is left out intentionally, since it caused worse codegen
2020-07-26 11:36:50 +01:00
Malcolm Jestadt 824be77bba SPU LLVM: Avoid redundant endian swapping
- PSHUFB operates in reverse byte order from SHUFB, so we can take advantage of that to swap endianness without additional transformations in some situations
2020-07-26 11:36:50 +01:00
Ani 74c8a44d84 rsx: Fix cache skipping shaders on load+compile (#8633)
When on single worker mode (OpenGL or an hypothetical scenario of a 
single core PC with Vulkan), load and compile would skip 10% of the 
shaders on queue each stage.

Co-authored-by: kd-11 <karokidii@gmail.com>
2020-07-26 08:47:50 +01:00
Whatcookie 9f829b375a SPU/PPU LLVM: Optimize VSEL/SELB with constant mask (#8559) 2020-07-25 17:59:35 +01:00
Eladash da44d5f10d PPU: Fix DIVW, DIVWU, MULHW, MULLW, MULHWU when op.rc is set (#8630) 2020-07-25 17:13:58 +01:00
kd-11 be4b71b805 vk: Fixup for PR #8590
- This change was lost during rebase
2020-07-25 14:48:11 +03:00
kd-11 b0c7ca6d1f vk: Improve video memory manager to attempt recovery in out of memory situations 2020-07-25 14:48:11 +03:00
kd-11 4d8de282f9 vk: Improve typeless texture succession
- Ensure incoming texture is large enough that the original one fits inside it to avoid back-and-forth succession.
- Make use of the resource manager to remove the obsolete textures to avoid holding on to the them which "leaks" VRAM.
  The memory isn't leaking, it's just wasting space in temporary pool until renderer is closed.
2020-07-25 14:48:11 +03:00
Bevan Weiss c5d39ace2b Update types.h to fix static_cast test (#8627)
Trivial fix up to resolve invalid is_constructible test (To,To) to match desired (To,From)
2020-07-25 09:46:47 +01:00
Megamouse de80a4b6c7 overlays: try to fix unexpected font crop 2020-07-25 10:21:52 +03:00
Eladash 917069e31a PPU Precise/LLVM: Support NJ modes (#8617) 2020-07-25 07:41:41 +01:00
Eladash 3354c800d7 SPU/PPU LLVM: Improve expressions matching (#8620) 2020-07-24 16:53:48 +01:00
Megamouse bb3ac62126 cellMic: use s32 consistently 2020-07-24 14:47:10 +02:00
Megamouse 6e25fea16a use not_an_error in sys_spinlock_trylock 2020-07-24 14:47:10 +02:00
Megamouse 5e7c6853c2 fix truncation warnings 2020-07-24 14:47:10 +02:00
Megamouse f76a011ba0 fix sceNpCommerce2CreateCtx log message 2020-07-24 14:47:10 +02:00
Megamouse d854a39500 add a gazillion more error_code 2020-07-24 14:47:10 +02:00
Megamouse a00ebacef3 cellFont: add error_code 2020-07-24 14:47:10 +02:00
Megamouse c2f4244c4d cellMic: error_code, random cleanup and stubbing 2020-07-24 14:47:10 +02:00
Megamouse 7437c324c6 cellMusic: add error_code 2020-07-24 14:47:10 +02:00
Eladash 54b87b6dbb cellSaveData: Increase sleep time 2020-07-23 13:45:58 +03:00
Eladash a029a94c73 SPU: Use waitable atomics for SPU channels interface 2020-07-23 13:45:58 +03:00
illusion 3157a10428 move executable hash log level to success 2020-07-22 10:51:19 +02:00
Eladash f8d2d8ca11 SPU/Windows: Fix LS memory mirrors
This is a workaround but this is because of how utils::shm works on Windows path.
2020-07-19 17:58:49 +03:00
Eladash 0d8152cd4e SPU/Linux: Ensure aligned 64k allocations in utils::memory_reserve 2020-07-19 17:58:49 +03:00
Eladash c37bc3c55c SPU: Make spu_thread::offset private 2020-07-19 17:58:49 +03:00
Malcolm Jestadt 6cc0fe4221 SPU LLVM: Avoid negative clamping when the input is known to be positive 2020-07-19 17:56:59 +03:00
Eladash af1ceb1151 SPU LLVM: LS Memory Mirrors (Optimize loads/stores) 2020-07-18 02:01:33 +03:00
Eladash c1a80b8146 Minor fixup after #8501 2020-07-16 21:52:08 +03:00
Eladash 268bcd1c7b rsx: Fix false desync events 2020-07-16 19:26:10 +02:00
kd-11 42a9ac9e6c rsx: Brute-force removal of superseded surfaces 2020-07-16 19:11:26 +03:00
kd-11 182b20c33d rsx: Fix draw count append when draw ranges are out of order
- It is common for draw counts to truncate at 256 even when it makes no sense to do so.
- e.g 256 is not a multiple of 3 so triangles will glitch out
2020-07-14 16:04:44 +03:00
Eladash 58e2465369 Make std::bit_cast hack-implementation constexpr in simple cases 2020-07-14 12:14:44 +03:00
Eladash 07a44d0ff9 Implement constexpr byteswapping 2020-07-14 12:14:44 +03:00
Jan Beich d00f882c23 Qt/input: unbreak with Qt 5.15 after 881e8e4723
rpcs3/rpcs3qt/pad_settings_dialog.cpp:674:16: error: variable has incomplete type 'QPainterPath'
                QPainterPath path;
                             ^
/usr/local/include/qt5/QtGui/qmatrix.h:54:7: note: forward declaration of 'QPainterPath'
class QPainterPath;
      ^
2020-07-14 08:33:56 +02:00
Megamouse e70e534bfa Qt: Fix YoRHa background for some widgets 2020-07-14 02:08:15 +02:00
Megamouse d345916241 Qt: Fix Skyline's QSpinBox and QDoubleSpinBox buttons 2020-07-14 02:08:15 +02:00
Megamouse fe8bcac270 Qt/input: add tooltips to pad settings 2020-07-14 00:06:43 +02:00
illusion 60f05fdbf3 move applied patch log level to success 2020-07-13 22:33:03 +02:00
Megamouse ad0f12c742 Qt/input: add checkbox for emulated stick values 2020-07-13 21:23:48 +02:00
Megamouse 2f2a03b37b Qt/input: fix stick preview for disconnected pads 2020-07-13 21:23:48 +02:00
Megamouse 881e8e4723 Qt/input: show emulated sticks in pad settings 2020-07-13 21:23:48 +02:00
Megamouse e1af6dc4af Qt/input: add squircle to pad settings dialog 2020-07-13 21:23:48 +02:00
Megamouse 4d9533ea54 input: use left and right squircle values 2020-07-13 21:23:48 +02:00
Eladash d6623e0f22 RSX debugger: fix command count on non-method commands (#8578)
* RSX debugger: fix command count on non-method commands

* fixup

* constants and variables
2020-07-12 12:40:47 +02:00
kd-11 ab3d36f0f3 rsx: Fix depth bounds test
- Allow depth bounds test to access the Z buffer even when depth test is disabled.
2020-07-10 15:59:15 +03:00
kd-11 632af8d723 rsx: Support partial texture descriptors
- It is safe to declare w > pitch and it works as long as sampling inside the legal 2D area is obeyed.
2020-07-10 15:26:07 +03:00
Eladash 282b00674a SPU LLVM: Optimize non-constant Tag Update requests 2020-07-10 02:52:02 +03:00
Eladash 235d12aa6b SPU MFC: Never clear tag status in WrTagUpdate 2020-07-10 02:52:02 +03:00
Eladash 5d1fc546a8 SPU MFC: Fix MFC_WrTagUpdate channel count
Always report available, in realhw this is just a hint if the previous tag update hasnt been checked yet by the MFC, avoiding blocking writes and allowing the SPU to execute some code while it processes the previous update request.
Except for MFC_TAG_UPDATE_IMMEDIATE, where it also waits for MFC to process it.
2020-07-10 02:52:02 +03:00
Eladash eb993781ef RawSPU: Log MMIO access 2020-07-09 23:24:47 +03:00
Megamouse 0756fd9c7e Qt: fix pad settings resize when switching tabs 2020-07-09 08:20:37 +02:00
Megamouse a3e79fc105 Qt: fix scrollArea focus during pad button choice
Assigning arrow keys was broken because of this
2020-07-09 08:20:37 +02:00
Eladash 84470c34db SPU: Disable PUTLLC NOP transfers detection on TSX path 2020-07-09 03:17:35 +01:00
Eladash f8dbfa1d1e SPU: Implement GETLLAR polling detection 2020-07-09 03:17:35 +01:00
Eladash d9750e8f9f SPU/PPU reservations: Optimizations for reservation locks and check_state() (non-TSX) 2020-07-09 03:17:35 +01:00
Megamouse e09c4b72c8 Qt: fix update menu for linux 2020-07-08 22:21:27 +02:00
Megamouse 53b95fea19 audio: rename audio channels to audio downmix
The setting does not actually define the channels themselves, only the downmix option that the PS3 provides.
Channels might be changed seperately in the future.
2020-07-08 21:11:23 +02:00
Megamouse e2fd4e46f7 Only reboot audio if a relevant setting changed 2020-07-08 21:11:23 +02:00
Megamouse 20d6664dc1 Try to make most audio configs dynamic 2020-07-08 21:11:23 +02:00
Megamouse 8ee953ef8e XAudio2: Call CoInitializeEx to prevent errors
I could not properly reset the audio backend and call CreateMasteringVoice without getting errors
2020-07-08 21:11:23 +02:00
Megamouse 5b7ee43352 XAudio2: print readable errors 2020-07-08 21:11:23 +02:00
Megamouse 8add57f8e9 VS: show linux audio backends in solution explorer 2020-07-08 21:11:23 +02:00
Megamouse bb0aaea92d cellAudio: implement downmix to 5.1 2020-07-08 21:11:23 +02:00
kd-11 987ede2e6c vk: Inject memory barrier upon conclusion of a framebuffer feedback loop
- Do not write to the texture until previous draw call is completed using it.
- This is usually not much of a problem until blending operations come into play.
2020-07-08 19:23:29 +03:00
Megamouse 5fae1b3637 HLE: fix sceNpDrmGetTimelimit invalid param error 2020-07-07 09:43:32 +02:00
Derrik Touve cb08c53f2f sys_net: Use np_handler dns if possible for sys_net_infoctl (#8557)
Without this, cellHttpSendRequest will use the hardcoded dns 192.168.1.1, which won't work if you're not on that network.
2020-07-07 08:25:29 +02:00
Megamouse 171e4fafed Emu: simplify Emu::Stop some more 2020-07-06 21:14:16 +02:00
Megamouse 8d2ce2815c Emu: Make prevent_display_sleep dynamic 2020-07-06 21:14:16 +02:00
Megamouse d91551c277 Emu: always use Emu.Quit() to quit RPCS3
This creates a single possible point of failure for calling quit()
2020-07-06 21:14:16 +02:00
Megamouse 332f9cae77 Qt: Remove obsolete main window close()
The gui settings aren't part of the main window anymore
2020-07-06 21:14:16 +02:00
Eladash dc25a3fa2a PPU debugger: Show stack address of each function 2020-07-06 18:58:16 +02:00
Eladash c98ec4d014 PPU debugger: Fix functions stack bounds check 2020-07-06 18:58:16 +02:00
kd-11 05dc6ad610 gl: Silence warnings 2020-07-05 16:58:44 +03:00
kd-11 3fe8499956 rsx: Improve ZCULL queued requests finalization
- Unifies the code
- Allows conditionals to be evaluated with a forwarder present
2020-07-05 16:58:44 +03:00
Megamouse f1b1c9053c Input/Qt: Check if gui callbacks are nullptr 2020-07-04 14:28:19 +02:00
Megamouse ea4cc0b395 Qt: use button box for most buttons 2020-07-04 14:28:19 +02:00
Megamouse be8980fc23 Qt: add scrollarea to pad settings dialog 2020-07-04 14:28:19 +02:00
Megamouse e4a9c177e6 Qt: Random unimportant stuff 2020-07-04 14:28:19 +02:00
Megamouse 99be645fcc Qt: Add stick multipliers to the pad dialog 2020-07-04 14:28:19 +02:00
Megamouse f8920edb2e patch_manager: save "owned games only" state 2020-07-03 18:09:06 +02:00
kd-11 acf51f0ead rsx: Fix transfer descriptors for partially overlapping slices in head
- Height must be corrected to skip the piece that exists before the current slice
2020-07-03 14:29:54 +03:00
Megamouse ddd202b5ff Qt: fix signal_update_available
m_update_message has to be non empty
2020-07-03 00:21:58 +02:00
Megamouse 78eb7e73bc Qt: remove automatic param from update logic
At that point we already had user interaction, so there is no point in hiding the error dialogs
2020-07-03 00:21:58 +02:00
Eladash 72337f2678 SPU LLVM: Fix barrier commands enqueuing 2020-07-02 22:46:02 +03:00
Megamouse 14200c1a1f Qt: refactor curl stuff into a downloader
And add 'Background' updater
2020-07-02 20:22:58 +02:00
Megamouse c495ef10b0 Qt: fix random QWinTaskbarProgress crashes 2020-07-02 20:22:58 +02:00
Megamouse 3bdce6050b Qt: random cleanups 2020-07-02 20:22:58 +02:00
kd-11 c9c0d7361d rsx: Implement fast ZCULL barrier when query object is already known 2020-07-02 20:11:57 +03:00
kd-11 d7ffc8b4ac rsx: Fix leaking ZCULL queries after a barrier
- Multiple queries can be queued up, process them all before completing the barrier
2020-07-02 20:11:57 +03:00
Megamouse b5f01372ee Windows: distinguish left and right modifiers
This is just some workaround until we either use a different input api for keyboards or until we refactor the keyboard_pad_handler to use Qt with native scan codes
2020-07-02 12:55:27 +02:00
Megamouse bec6bde919 Qt/Input: update keyboard_pad_handler shortcuts
This is just some patchwork before the shortcuts get refactored eventually
2020-07-02 12:55:27 +02:00
Megamouse 1f25924384 Qt/Input: remove unused function: GetModifierCode 2020-07-02 12:55:27 +02:00
Jacques Yakoub 36cf5dca82 localized.h: follow Sony Naming Conventions (#8539)
* localized.h: follow Sony Naming Conventions

See this : https://github.com/RPCS3/rpcs3/issues/4259 (Main Window -> (Localized) Replace the category names with either something more gramatically correct or something used in Sony Naming Conventions)
2020-07-02 09:39:10 +02:00
Bird Egop eea12bad07 Implement Caret upwards and downwards move in overlay_edit_text (#8342)
* Implement caret upwards and downwards move in overlay_edit_text

* Optimize caret up and down movement

Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-07-02 09:06:37 +02:00
Ani 6a9fe8e3c4 rpcs3_version: Bump to 0.0.11 2020-06-30 22:35:17 +01:00
Megamouse 55e907385b patch_manager: warning for incompatible patches (#8535)
* patch_manager: warning for incompatible patches

This will open a warning dialog whenever the patch manager is opened and incompatible patches are detected.

* Apply suggestions from code review

Co-authored-by: Bird Egop <sampletext32@bk.ru>

Co-authored-by: Bird Egop <sampletext32@bk.ru>
2020-06-30 21:35:15 +02:00
kd-11 bd14429f20 vk: Disable primitive restart for old GCN cards
- Also adds more Navi 14 chips to detection table
2020-06-30 15:00:07 +03:00
Megamouse 5867b3b72e patch_manager: fix items across refreshs 2020-06-30 03:04:35 +02:00
Megamouse 45e1a8756f patch_manager: fix import dialog close button 2020-06-30 03:04:35 +02:00
Megamouse 6742fad753 patch_manager: fix import, use constants as keys
And improve import logging again
2020-06-30 00:45:17 +02:00
Megamouse c6190fa95d patch_manager: improve import logging
imported_patch.yml has to be the latest version too
2020-06-29 23:56:27 +02:00
Megamouse 372eff2d8f patch_manager: fix sorting of item counters >= 10
This only deals with less than 100 items (that amount is undesirable in the first place)
2020-06-29 23:56:27 +02:00
Megamouse 98eb0cd3f2 patch_manager: fix legacy patches again 2020-06-29 23:56:27 +02:00
Megamouse 541e20cbec patch_manager: allow Notes as sequence 2020-06-29 23:56:27 +02:00
Megamouse ef203f6bcb patch_manager: fix owned games o. for all versions 2020-06-29 23:56:27 +02:00
Megamouse a5368d766a patch_manager: prefer specific > global (per hash) 2020-06-29 23:56:27 +02:00
Megamouse cf2e2a0511 patch_manager: one patch per group across hashes 2020-06-29 23:56:27 +02:00
Megamouse e5bb5f02e0 patch_manager: Always move All titles to the top 2020-06-29 23:56:27 +02:00
Megamouse 3a17eefde7 patch_manager: restrict All serials to All titles 2020-06-29 23:56:27 +02:00
Megamouse 7d2ecbf29a patch_manager: don't hide "All Serials" in 'owned' 2020-06-29 23:56:27 +02:00
Megamouse c72a6f8e6f patch_manager: prefer serial patches over All 2020-06-29 23:56:27 +02:00
Megamouse 6a486d3402 patch_manager: only apply one patch per group
So far this was purely handled in the GUI
2020-06-29 23:56:27 +02:00
Megamouse e43db24b2c patch_manager: add All override
All can now be used as a key for title, serial and/or app version.
If you check a patch for all ... then the patch will be applied regardless of what's checked for the game specifically, because we do not save 'Unchecked' patches.
2020-06-29 23:56:27 +02:00
Megamouse 3ea33763bc patch_manager: add expand and collapse
Also reorder the context menu and remove some options if not applicable
2020-06-29 23:56:27 +02:00
Megamouse 695cfead16 patch_manager: add option to only show owned games
and remove the app version level from the gui
2020-06-29 23:56:27 +02:00
Megamouse 12dded403f patch_manager: implement serials and app_versions 2020-06-29 23:56:27 +02:00
Eladash a7a5034958 remove redundent include in Crypto/unedat.cpp (#8527) 2020-06-29 18:03:38 +01:00
Megamouse fa81146b79 Use proper install paths depending on pkg content 2020-06-29 10:36:24 +02:00
Megamouse 5269b69bc5 cellAudio: use downmix formula based on documentation 2020-06-29 09:06:36 +02:00
Eladash d9e3f0ccfa types.h: Fix ASSUME macro side-effects mismatch between compilers 2020-06-29 03:10:05 +01:00
Eladash 2483cc6f8d Fix race in Crypto/unedat.cpp, Make NPDRM keys usage atomic 2020-06-28 23:26:10 +01:00
Eladash 97717defa5 Remove devKlic/rifKey reset 2020-06-28 23:26:10 +01:00
kd-11 5e29bdbe22 vk: Add more GPUs to nvidia chip table
- Registers more TU116 and TU117 variants
- Registers GA100
2020-06-28 22:54:58 +03:00
kd-11 b437794e92 vk: Improve nvidia speedhack for non-turing cards
- Inverts the chip family check to skip any unidentified GPUs altogether
2020-06-28 22:54:58 +03:00
Eladash 9fcbad326a debugger: Fix registers editor 2020-06-28 11:51:24 +02:00
Eladash 2c93fecd8b SPU: Use named constants for MFC tag updates 2020-06-27 20:42:41 +01:00
Eladash 20fcc6530f SPU LLVM: Fix WRCH instruction to WrTagUpd 2020-06-27 20:42:41 +01:00
illusion 11e75853a6 ui: add rsx some options to gui (#8512)
disable hw fp16 to advanced
3d tv support to gpu
2020-06-27 19:19:35 +01:00
Eladash 9cb4402c16 Make error_code::value member private 2020-06-27 09:02:55 +01:00
Eladash f29589e5cf SPU debugger: Add atomic status and tag update channels information 2020-06-27 07:04:37 +01:00
Eladash d7842b7de2 SPU LLVM: Fix WRCH instruction to WrTagMask 2020-06-27 07:04:37 +01:00
Megamouse 5a8eb9d3d7 Input: skip keyboard input when pads are disabled 2020-06-26 09:28:58 +02:00
Megamouse ab4c40c988 pad_thread facepalm 2020-06-26 09:28:58 +02:00
kd-11 5ea6535fd5 rsx: Force flushing of NaN/INF to zero
- This option was always enabled for NVIDIA cards, but it seems some games would benefit from the option on other GPUs as well.
- TODO: Hwtest to verify correct behavior and plan how to safely implement in hw
2020-06-26 09:24:15 +03:00
Megamouse 76faaf43f7 Input: Use global variables for pad modifications 2020-06-26 04:42:52 +02:00
Megamouse 9679ae68cb patch_manager: more information for branch nodes 2020-06-25 22:14:18 +02:00
Megamouse 7d3389d548 patch_manager: save widget layout 2020-06-25 20:49:57 +02:00
Eladash ab9cdc70ad cellSaveData: Emulate PPU processing of auto/list post-fixed callback 2020-06-25 19:50:33 +03:00
Eladash e45d37073a debugger: Shortend SPU/PPU thread names 2020-06-24 17:44:06 +02:00
JohnHolmesII e353ad3557 Update BUILDING.md
Change Qt version to reflect the fact that nothing older or newer than 5.14.2 will build. Sad times.
2020-06-24 16:10:26 +02:00
Megamouse abec850379 patch_manager: add hash to applied log message 2020-06-24 15:31:55 +02:00
Megamouse 431e0eb30c patch_manager: fix missing config path 2020-06-24 15:31:55 +02:00
kd-11 628cb1c779 rsx: Validate blend factors according to hardware testing 2020-06-23 12:15:02 +03:00
kd-11 a14e0a0104 rsx: Validate stencil op to match realhw behavior 2020-06-23 12:15:02 +03:00
kd-11 f3637cdfdb rsx: Fix surface options hint mechanism
- Silly typo
2020-06-23 12:15:02 +03:00
kd-11 c6a9a5d5d7 rsx/fixup: Fix color clear logic
- Enable fast clears on ABGR formats in vulkan
- Fix disabling color clears for unsupported formats in GL
2020-06-23 12:15:02 +03:00
Megamouse 7e3ece7d9f Update readme badges 2020-06-23 03:34:36 +02:00
kd-11 7f917c8ba5 rsx: Fix ABGR decoding for colormask and clear color
- The bytes in these values are based on the format according to hw tests
- G8B8 is unaffected as the first two bytes are already G8B8 for A8R8G8B8 standard layout (BGRA)
- A8B8G8R8 and its derivatives have words 0 and 2 exchanged.
2020-06-22 20:12:41 +03:00
kd-11 e992cbe01b rsx: Support DRGB8 sampling of render targets 2020-06-22 20:12:41 +03:00
Megamouse 1974911a71 patch manager: Skip legacy patch.yml in the GUI
The legacy patches aren't supposed to be shown in the GUI anyway.
2020-06-21 15:48:30 +02:00
Megamouse 8659994b2c patch manager: Fix load order 2020-06-21 15:48:30 +02:00
Megamouse 5affc459a2 patch manager: Allow partial patch file import 2020-06-21 15:48:30 +02:00
Megamouse cd4ed11700 patch manager: Add patch removal to context menu
Also avoid saving empty patch maps
2020-06-21 15:48:30 +02:00
Megamouse c4fe418f66 patch manager: fix tree refresh and item expansion 2020-06-21 15:48:30 +02:00
Megamouse 7d9d58f38f patch manager: Properly hide legacy patches 2020-06-21 15:48:30 +02:00
Megamouse b212f29cf2 patch manager: "Show Patch File" in context menu 2020-06-21 15:48:30 +02:00
Megamouse fd2cd84555 patch manager: Skip lower patch_versions 2020-06-21 15:48:30 +02:00
Megamouse bf978ac8ca patch manager: properly check patch versions
Also abort patch import of lower patch versions
2020-06-21 15:48:30 +02:00
Megamouse d3c6472c0f patch manager: replace Version and Title keys
With Patch Version and Game Title
2020-06-21 15:48:30 +02:00
Megamouse 1c7a318413 patch manager: move try catch block to yaml.cpp 2020-06-21 15:48:30 +02:00
Megamouse 591624b96c patch manager: avoid patch import inconsistencies
Save the original patch value instead of the interpreted value
2020-06-21 15:48:30 +02:00
Megamouse 2323cd2a2d patch manager: move title + serials to patch level
Also bump patch file version to 1.1
2020-06-21 15:48:30 +02:00
Megamouse cc5c89539b patch manager: improve error handling
There shouldn't be much left that can crash this thing
2020-06-21 15:48:30 +02:00
Megamouse a7ee059419 patch manager: import patches 2020-06-21 15:48:30 +02:00
xperia64 7d5c8fe553 Change DLL permissions so Windows clients which respect permissions set them correctly (#8470) 2020-06-20 21:44:38 +01:00
Megamouse fd048a75da Qt: Improve update manager messages
- Add restart hint to success message
- Use days to measure time greater than 24 hours
2020-06-20 17:12:45 +02:00
Oschowa 5c1ce6350b FAudio: remove 4x volume factor
Same as commit 66d13da2ac for the XAudio2 backend
2020-06-20 12:42:56 +02:00
Eladash d86c9a2549 sys_mmapper: rewrite page fault thread notifications
* Fix a corner case where SPU thread has the same ID as a PPU thread.
* Fix a potential deadlock on Emu.Stop() while sending event in EBUSY loop.
* Thread specific notifications.
2020-06-18 20:13:54 +03:00
sampletext32 249686708c Update Github Issue Template: Regression 2020-06-18 06:49:59 +03:00
Eladash 3ee1d8aed1 fixup 2020-06-18 06:47:07 +03:00
Eladash 5c6dae498b SPU LLVM: Avoid bad optimization in FCGT 2020-06-18 06:47:07 +03:00
kd-11 2086e7f2e8 rsx: Account for subpixel precision when converting DST coordinates to
SRC coordinates

- When extracting a 1x1 texture from another texture of a different
  format, width conversion can result in a dimension of 0 if the
extracted texel is not a full texel in SRC
2020-06-17 22:18:47 +03:00
sampletext32 4092e3e95f Update Github Issue Template: Bug 2020-06-17 15:46:33 +03:00
kd-11 c764925b4d rsx: Properly handle conversion of G8B8 and related formats
- These formats are 16-bit packed, not separate 8-bit channels. Conversion requires byteswap for them.
2020-06-16 22:36:38 +03:00
kd-11 83d818d96f rsx: Improve mipmap gathering
- Account for source offsets when grabbing subregions
- Scale input accordingly when sourcing from fbo in all paths
2020-06-16 19:12:03 +03:00
RipleyTom 3d3c91d654 std header guard in BEType.h (#8448) 2020-06-16 01:06:15 +01:00
sampletext32 0ad4e91001 Avoid string reallocation in swizzle CgBinaryProgram 2020-06-15 22:26:49 +03:00
Eladash 731d4330fe v128: A few optimizations (#8432) 2020-06-15 17:24:04 +03:00
Eladash 5777a1d426 SPU: Implement EBUSY error on non-empty mailbox (sys_spu_thread_send_event/sys_event_flag_set_bit)
Write into inbound mailbox under mutex.
2020-06-15 17:08:57 +03:00
Eladash 5fda9a4efb sus_lwcond_signal_all: use protocol specified in lwmutex
Trying to fix a nearly impossible corner case.
2020-06-15 17:08:57 +03:00
Eladash c15b5f1eca SPU: Move check_state() outside of mutex scope
Can result in a deadlock in some cases, cpu flags are checked after this function as well anyways.
2020-06-15 17:08:57 +03:00
Eladash 314dc4c5de sys_cond: Fix spurious EBUSY in sys_cond_destroy
Increment waiters count inside IDM's mutex lock scope.
2020-06-15 17:08:57 +03:00
Eladash a0f0f58fc5 sys_event_queue: Fix IPC support 2020-06-15 17:08:57 +03:00
Eladash 92b7c56f29 sys_cond/mutex: Fix race between sys_cond_create and sys_mutex, Fix IPC support in sys_cond/mutex 2020-06-15 17:08:57 +03:00
kd-11 8d8fb4a2e4 rsx: Remove ARGB->D24S8 conversion shader which has been deprecated for years since compute capabilities were added to the emulator 2020-06-15 14:18:12 +03:00
sampletext32 717e851a99 Create Github Issue Template: Feature Request 2020-06-15 00:46:48 +03:00
kd-11 2e737ad483 rsx: Fix surface option invalidation
- Depth buffers can be in special "read" state when writes are disabled. Account for this.
2020-06-14 23:30:03 +03:00
Eladash 88a0e0fe2d cellAudio: Minor fixup 2020-06-14 18:45:46 +01:00
Eladash e2248332ae rsx: Make "Disable ZCull Occlusion" setting dynamic 2020-06-14 18:45:46 +01:00
kd-11 3663a8ab4d rsx: Improve surface options invalidation 2020-06-14 20:13:12 +03:00
Eladash 5430892052 sys_vm: Limit total process vsize to 256MB (#8431) 2020-06-14 15:27:34 +01:00
Eladash ff04cd6d69 cellAudio: Fix event queue attachment 2020-06-14 02:31:23 +03:00
Eladash aa4fdff82c Fix lv2_obj::name64 regression 2020-06-14 02:25:29 +03:00
Eladash 5bc4f9df0d debugger: Always show zeroes on no thread's instructions positions 2020-06-14 02:08:04 +03:00
Eladash 5d0066029f debugger: Fix instructions foreground/background color changes on non-executable memory 2020-06-14 02:08:04 +03:00
Eladash 56962a58da Fix debugger breakpoints 2020-06-14 02:08:04 +03:00
Malcolm Jestadt 746615a937 Fix embedded spu elf patching 2020-06-13 23:18:44 +02:00
Nekotekina e485c9c79c Atomically overwrite config.yml
Protection against data corruption.
2020-06-12 22:41:50 +03:00
Eladash bd6fdf3f2d rsx: Optimize rsx::rsx_iomap_table construction 2020-06-12 22:40:58 +03:00
Eladash e1f8573c68 sys_net: Fix sys_net_bnet_setsockopt page faults 2020-06-12 22:39:13 +03:00
Eladash 4bc157881d sys_net: Stub sys_net_infoctl command 9 2020-06-12 22:39:13 +03:00
Eladash f0d526411c IDM: Implement idm::clear<typename> 2020-06-12 22:12:36 +03:00
kd-11 e1183f6919 gl: Fix depth buffer byteswap hint
- uint24_8 is not actually swapped, it is decoded in a special way
2020-06-12 20:49:47 +03:00
kd-11 f4ec28d932 rsx: Merge instruction expand flag with the other sign expand flags
- Avoids double expansion when both the exp_tex flag is set AND the texture also is sampled as signed
- Should fix missing eyeballs in Mass Effect 1 with the previous sign expansion fix
2020-06-12 20:19:20 +03:00
kd-11 ce587f43a0 rsx: Implement signed normalized texture formats
- Already partially supported via EXP option in the shader opcode, but format decoding was disabled.
- Noticed in some UE3 games which use _SNORM variants on PC but _UNORM on rpcs3
2020-06-12 20:19:20 +03:00
Eladash 6892399699 kernel_explorer: More Improvements 2020-06-12 09:28:23 +02:00
Megamouse 22b1cc765a patch manager: hotfix for legacy patches
Assignment of invalid YAML nodes is not possible after all
2020-06-11 22:23:02 +02:00
Eladash b9cb181691 sys_memory: Improve allocation/deallocation syscalls 2020-06-11 20:03:32 +03:00
Megamouse 4a03f06175 patch manager: add checkbox for "enable legacy" 2020-06-11 16:31:49 +02:00
Ilya 768bb8d31f Workaround broken Azure badge link
Looks like Azure has broken API a bit, so link to the full list of the latest builds in the meantime
2020-06-11 14:08:11 +02:00
Eladash 0bf8f2a527 PPU interpreters: Fix VRFIM, VRFIN, VRFIP, VRFIZ 2020-06-11 14:31:38 +03:00
Megamouse 2dca8d84e1 patch manager 2020-06-11 13:15:25 +02:00
JohnHolmesII 1668900fb8 Update Azure config to fix Windows Azure build (#8399)
Co-authored-by: Eladash <elad3356p@gmail.com>
2020-06-11 04:14:09 +01:00
Megamouse 66f1cbfb34 kernel_explorer: keep existing trees expanded 2020-06-09 16:48:20 +02:00
sampletext32 b75af69cf9 Improve tooltips 2020-06-08 05:51:52 +03:00
Eladash c36c425fb9 kernel explorer: Improvements 2020-06-08 05:46:36 +03:00
sampletext32 f75b26d1c9 Unify Azure artifacts names and produce them only on successful build. 2020-06-08 05:38:39 +03:00
Nekotekina bfee541540 Atomically overwrite games.yml
Reduce chances of losing information.
2020-06-07 22:44:07 +03:00
Nekotekina 3d7c38ff9d Remove lambda in sys_net_bnet_poll 2020-06-07 22:44:07 +03:00
Nekotekina 5d27f1c732 PPU: implement VNMSUBFP (precise variant) 2020-06-07 22:44:07 +03:00
Nekotekina 3b8e7d0967 Implement v128::fma32f 2020-06-07 22:44:07 +03:00
kd-11 ebbf329b6a gl: Improve async compiler synchronization with initialization
- On multithreaded mesa, the program initialization routine was not
  being flushed correctly. Set up synchronization fence after initialization
is complete.
2020-06-07 12:54:34 +03:00
kd-11 87cc937d4e rsx/fp: Separate SRC precision modifiers
- SRC0, SRC1 and SRC2 have different bits for precision modifiers all stored inside SRC1
- This explains the strange observed behavior of the MAD instruction which has 3 inputs
2020-06-07 12:07:27 +03:00
Malcolm Jestadt dcf5c06d6d SPU LLVM: Optimize FM when op.ra == op.rb 2020-06-06 22:27:48 +03:00
Malcolm Jestadt 8357523ec0 SPU LLVM: Additional FCGT optimizations 2020-06-06 22:27:48 +03:00
Malcolm Jestadt 39149fd84d SPU LLVM: Partial revert for FM/FMA changes and other improvements
- Revert changes to FM and FMA instructions
- Allow non accurate/approx FMA family instructions to use native FMA
- Minor optimization for FMA ops with a constant 0 multiply
2020-06-06 22:27:48 +03:00
Malcolm Jestadt 289c594187 SPU LLVM: Fix theoretical issue with FCGT optimizations 2020-06-06 22:27:48 +03:00
kd-11 d47d597b34 vk: Make the depth-convert pass multisample aware 2020-06-05 17:19:24 +03:00
kd-11 69c2150fbd vk: Fix query reset when renderpass is active
- Performs delayed query reset on-demand
2020-06-05 17:19:24 +03:00
Bird Egop 334d0bbc86 Add Cirrus CI FreeBSD badge (#8350) 2020-06-05 01:45:21 +01:00
Megamouse 1cb4fb9c50 stub cellPngEnc 2020-06-04 23:13:40 +03:00
Megamouse 413f87b737 Add error_code to cellPngDec 2020-06-04 23:13:40 +03:00
Megamouse 8a8edb1b62 stub sceNpCommerce2 2020-06-04 23:13:40 +03:00
Megamouse caa1324457 stub sceNpTus 2020-06-04 23:13:40 +03:00
ibrakap 776c2ada6a Remove mentionbot config 2020-06-04 23:10:54 +03:00
Megamouse 41eb6d4461 cellAudio improvements
- use CELL_AUDIO_BLOCK_32 where possible
- use CELL_AUDIO_BLOCK_SAMPLES where possible
- remove redundant logging
- return CELL_AUDIO_ERROR_AUDIOSYSTEM in cellAudioGetPortConfig (probably unreachable code anyway)
- return CELL_AUDIO_ERROR_PORT_OPEN in cellAudioPortOpen
- stub cellAudioSetPersonalDevice cellAudioUnsetPersonalDevice and cellAudioMiscSetAccessoryVolume
2020-06-04 23:09:47 +03:00
illusion 0315781306 Audio dumper: append filename with titleid and date-time
prevents overwrite of old file

Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-06-04 20:10:56 +03:00
sampletext32 437f374bae Fix some checks 2020-06-04 19:48:08 +03:00
Ani 9657b3f1d4 Fix sys_net_bnet_poll regression (#8337)
Co-authored-by: Eladash <elad3356p@gmail.com>
2020-06-04 17:30:11 +01:00
kd-11 650152e05f rsx: Fix fragment state updates
- Fix copypasta for POLYGON_STIPPLE_PATTERN vs SET_POLYGON_STIPPLE method binding
- Use proper enums for ROP_control bits to avoid confusion
2020-06-03 22:05:33 +03:00
kd-11 73fe9b51de rsx/fp: Ignore self-referencing register writes.
- Sometimes, usually with shaders that do pack/unpack operations, there is a write-to-self operation.
  For example r0.xy = r0.xy
  Obviously no new data was introduced into "r0" by this, so we should not mark the register as having new data.

- TODO: Investigate on realhw if self-reference is needed to "cast" the overlapping half registers to their full register counterparts.
2020-06-03 09:45:02 +03:00
kd-11 26b2e4253d rsx: Properly account for memory sizes of reused surfaces 2020-06-02 21:37:57 +03:00
kd-11 b353bf6c56 rsx: Improve surface cache resource management
- Do not allocate too many objects. This is a problem in games using dynamic memory allocators that can make it rare for a surface to fall on the same address twice, keeping zombie RTVs and DSVs alive much longer than needed.
- Current limit used is 256M of virtual VRAM which is impossible on retail PS3
2020-06-01 22:24:27 +03:00
Malcolm Jestadt c601374b1f SPU LLVM: Use clamping helpers for FMA32x4 and FM 2020-06-01 21:39:28 +03:00
Megamouse 66d13da2ac XAudio2: remove nasty 4x volume factor 2020-06-01 19:05:48 +03:00
Nekotekina 938ca90a02 Improve Stop Watchdog
Prevent termination if PPU LLVM compilation is in progress.
2020-06-01 02:27:33 +03:00
Nekotekina 2d2ed7efd0 Add game patch support in 'Create PPU Caches'
Try to compile patched version of EBOOT.BIN
2020-05-31 23:06:54 +03:00
Nekotekina 1507a59786 SPU LLVM: fix spu_cache dependency
Should fix possible crash on exit.
2020-05-31 21:54:04 +03:00
Eladash 675fde69aa Avoid copying std::shared_ptr in sys_semaphore 2020-05-31 21:02:52 +03:00
Megamouse 99895471ae cellAudio: make master volume dynamic 2020-05-31 07:37:59 +02:00
Megamouse 3e2aede85c VS: randomly changed project files 2020-05-31 07:37:59 +02:00
Nekotekina 377ad9887c Compile EBOOT.BIN on 'Create PPU Caches' 2020-05-31 02:26:40 +03:00
kd-11 c9a978a03e Typo fix
Co-authored-by: Megamouse <studienricky89@googlemail.com>
2020-05-30 14:47:10 +03:00
kd-11 59d44cd1cc gl: Fix shader logging 2020-05-30 14:47:10 +03:00
kd-11 542a6aed51 rsx: Add stippled rendering support to interpreters 2020-05-30 14:47:10 +03:00
kd-11 1677618c75 rsx: Implement stippled rendering 2020-05-30 14:47:10 +03:00
Eladash 3df83e03a9 SPU: Fix possible deadlock after access violation via DMA transfers 2020-05-28 23:23:11 +03:00
Eladash a199c71a55 SPU: Fix page faults notifications (non-TSX) 2020-05-28 23:23:11 +03:00
Eladash 3d20ce70f5 rsx: Fix possible case NULL zcull_ctrl in on_exit() 2020-05-28 11:56:02 +02:00
Eladash f0cdd8ace6 PPU: Implement PPU Traps Stubbing option 2020-05-27 22:39:29 +03:00
Nekotekina 8e9d2fa70e SPU LLVM: implement get_segment_base()
Fake function used to compute 32-bit offset of local functions.
2020-05-27 18:53:09 +03:00
Nekotekina abf9a08ee3 Fix warnings 2020-05-27 18:41:17 +03:00
ZeeWanderer 9d02231074 [CI, Cache] Add proper cache versioning (#8285) 2020-05-26 00:33:59 +01:00
xddxd f56b362769 rsx: Copypasta fix (#8289) 2020-05-25 20:07:11 +01:00
Eladash 865180e63e sys_mmapper: Fix possible memory leak on error of create_lv2_shm 2020-05-24 19:24:07 +03:00
Eladash 3265772ae4 idm: Implement creation/destruction invalidation counter
* "Ensures" newely created IDs won't have the same ID as old destroyed objects for lv2_obj. (256 tries cycle)

Similar to how the kernel implements it.
2020-05-24 19:24:07 +03:00
kd-11 224a0e4b1a rsx: Fix data format remapping
- Includes missing 0xEE and 0x44 variants of the 2-component data format remapper
2020-05-24 13:51:19 +03:00
kd-11 bd41a108d8 nv3089: Account for subpixel addressing
- Those strange offsets noted in some games seem to match to subpixel addressing.
  For example, when scaling down by a factor of 4, a pixel offset of 2 will end up inside pixel 0 of the output
2020-05-24 11:31:37 +03:00
ZeeWanderer 695b6e8f46 [MSVC 16.6] Microsoft.MakeFile.Targets(46,5) :thisisfine: (#8279) 2020-05-23 14:53:49 +01:00
Maxim Kulyk ab6942d974 [CI, sh, Windows] Do shallow submodule init. History is not needed. 2020-05-23 11:52:17 +01:00
Maxim Kulyk 6efc735728 [CI, Windows] build SPIRV-Tools separately 2020-05-23 11:52:17 +01:00
Jan Beich 3048bb1a75 Add FreeBSD to CI (#8261)
* CI: add FreeBSD job

* CI: add FreeBSD job on CirrusCI

* CI: disable Travis on FreeBSD due to broken ccache
2020-05-23 00:54:28 +03:00
Eladash b8f86eb78d SPU: Fix page faults notifications 2020-05-23 00:48:28 +03:00
Mrlinkwii 68bee397eb Update cellSpurs.h 2020-05-22 22:19:04 +03:00
Eladash a703f6febb kernel explorer: Add information about first PRX/overlay segment 2020-05-22 17:37:22 +03:00
Eladash 81749f4353 SPU/PPU disasm: replace unknown instructions message with question marks 2020-05-22 17:37:22 +03:00
Eladash 2d1d36678d SPU/PPU disasm: replace "illegal address" with question marks 2020-05-22 17:37:22 +03:00
Eladash 0e6abd66ca PPU disasm: do not disassmble non-executable memory 2020-05-22 17:37:22 +03:00
kd-11 7080305d82 vk: Implement masked stencil buffer clears
- Partial stencil buffer clears were not implemented. This is for example where a game can choose to clear only some bits from the stencil buffer.
- Vulkan does not support masked stencil clears natively, it has to be implemented as a graphics operation.
- Also refactors vulkan overlay passes to use global resource system instead of forcing the render backend to own all of them and manage lifetimes.
2020-05-21 19:27:23 +03:00
Eladash 7c3166a0c6 SPU MFC: Fix MFC_WrListStallAck on interpreters 2020-05-20 22:55:30 +03:00
Eladash 4405f46aec SPU MFC: Fix SN interrupts 2020-05-20 22:55:30 +03:00
Eladash 81684919f5 SPU MFC: Implement MFC_SDCRZ_CMD 2020-05-20 22:55:30 +03:00
sampletext32 1a8fb61373 Fix some misspells
Note: in main.cpp there are many dirs similar to Program Files, so tip should be appropriate.
2020-05-20 22:53:24 +03:00
Malcolm Jestadt c47d04fd2f SPU: Optimize FCGT
- Optimize FCGT to a single signed integer comparison when possible
- Add is_spu_float_zero helper
2020-05-20 21:55:01 +03:00
ZeeWanderer 91ee480e56 [msbuild] only link llvm libs to Applications (#8262)
Previously llvm libs were linked into all lib pjojects that import `rpcs3_llvm.props` which resulted in 200+ MB libs and probably longer compile time.
2020-05-20 07:40:14 +01:00
sampletext32 3d320aea2c Optimize Qt properties in about_dialog
https://doc.qt.io/qt-5/qt.html#TextInteractionFlag-enum
2020-05-19 08:18:21 +02:00
Megamouse 703841e251 Qt: disable TSX in the config.yml if not supported 2020-05-18 17:46:31 +02:00
Megamouse 1fffffad7a Qt: properly handle strict rendering mode switch 2020-05-18 17:46:31 +02:00
Nekotekina 72fedccaba rsx_utils.h: fix signed/unsigned comparison 2020-05-18 00:51:57 +03:00
Nekotekina ae519200ed Implement std::countl_zero and friends
Trying to fix macos build.
2020-05-18 00:51:57 +03:00
Eladash 201d54ee08 PPU interpreters: Implement AltiVec NaNs precedence and data preservation 2020-05-18 00:35:06 +03:00
JohnHolmesII 2591d99db1 Dev: Switch to dropbox for Vulkan SDK for reliability 2020-05-17 22:01:59 +01:00
JohnHolmesII a2327de3cb Dev: Switch to alternate Qt host for reliability 2020-05-17 22:01:59 +01:00
Ani 581176fb1a gl: Restrict insert_vertex_input_fetch workaround to Intel proprietary
It works fine on Mesa iris
Fixes detection of Mesa as recent Mesa does not have "x.org" on vendor string, allowing vendor_MESA to become true instead of vendor_INTEL on Mesa Intel
2020-05-17 17:49:14 +03:00
Eladash 377e2ce3e8 rsx: Write 4-byte long data to all semaphores (#8246)
* rsx: Write 4-byte long data to all semaphores
2020-05-17 17:48:35 +03:00
Eladash a2653532ef SPU reservations (TSX): Remove wait flag in PUTQLLUC 2020-05-17 14:20:21 +03:00
kd-11 37df3c6f96 rsx/fp: Fix precision clamping on MAD instruction 2020-05-17 09:11:26 +03:00
AniLeo a8bca8b2ed gl: Only log shaders if g_cfg.video.log_programs is enabled 2020-05-16 16:16:17 +01:00
AniLeo b0d3c4d75e gl: Refactor shader type usage
Use Common/GLSLTypes.h program_domain instead of duplicated own internal
type
2020-05-16 16:16:17 +01:00
AniLeo 3db2f23e02 gl: Refactor shader compilation 2020-05-16 16:16:17 +01:00
Ani 661636efef gl: Check for EXT_depth_bounds_test
Avoid glEnable/glDisable GL_DEPTH_BOUNDS_TEST_EXT flood that returns 
GL_INVALID_ENUM if the feature isn't supported
2020-05-16 14:50:05 +01:00
AniLeo 99f5145aab glsl: Avoid implicit int->uint conversions
Silences debug output regarding implicit int -> uint conversions
2020-05-16 11:45:59 +01:00
Eladash 8a0425570c rsx: Fix data written to RSX semaphores and the initial data of them (#8235) 2020-05-16 09:55:56 +01:00
AniLeo eecb22e749 gl: Remove older debug code
KHR_DEBUG path makes this obsolete, usage of this older path has been 
removed a long time ago
2020-05-16 08:29:00 +01:00
AniLeo 3ad12cf5f8 gl: Avoid issuing glDelete calls with m_id == GL_NONE
Applies GL_NONE macro usage where it makes sense
2020-05-16 08:29:00 +01:00
AniLeo d4333788e2 glext.h: update from 20180114 to 20200423
Include newly added khrplatform.h as well
2020-05-16 08:29:00 +01:00
AniLeo 308cdfac35 gl: Rewrite Debug Output
Remove Windows restriction, enable Debug Output for every supported OS
Filter our severity by Khronos severity
Handle and log source and type enums
2020-05-16 08:29:00 +01:00
illusion db4414ca87 GUI followup for https://github.com/RPCS3/rpcs3/pull/8148 2020-05-15 20:01:39 +03:00
Zion b5dbb2eb36 Bump Linux CI version (#8226)
This updates Qt to 5.14.2, Ninja to 1.10.0, SDL2 to 2.0.12
2020-05-15 04:04:24 +01:00
Nekotekina 67b002f586 Update Contributors 2020-05-15 01:46:12 +03:00
Nekotekina e186ef9490 Update Developers 2020-05-15 00:53:39 +03:00
Nekotekina cccc5bc18d Update Supporters 2020-05-15 00:50:13 +03:00
Nekotekina 7824419bbf Remove std::rotr usage for now
It seems to be missing on some std implementations.
2020-05-14 21:42:44 +03:00
Mrlinkwii c22d778143 Spelling fix in texture_cache.h (#8219)
heurestic_end -> heuristic_end
2020-05-14 21:42:21 +03:00
Eladash 61f43d78df SPU: Minor cleanup of exception in stop_and_signal 2020-05-14 16:58:50 +01:00
Eladash 54dd9f4eae sys_spu: Fix sys_spu_thread_group_terminate vs sys_spu_thread_group_exit race on values 2020-05-14 16:58:50 +01:00
Eladash 91d06a9729 SPU LLVM: fixup after #8175 (#8214)
Mask out RESULT cmd bit, do not create unbound branch blocks. (non-TSX)
2020-05-14 13:34:14 +01:00
kd-11 310f367fb1 rsx: Improve blit engine memory validation (#8215)
- In blit engine logic there is a tendancy to over-allocate so as to avoid having to sticth together textures later
- Sometimes this can lead to out of bounds access and crash applications, so memory must be validated
2020-05-14 12:57:58 +01:00
Nick Renieris b1fb5b6239 Emu/Config: Add option for accurate PPU LLVM vector NaNs
Turned off by default.
2020-05-14 11:14:28 +01:00
Nick Renieris 20d8d38e53 PPU Interpreter: Accurate vector instruction NaNs
Tested with https://github.com/RPCS3/ps3autotests/tree/master/tests/cpu/ppu_vpu.
This commit gets us from 2746 to 353 different lines compared to realhw.
2020-05-14 11:14:28 +01:00
Nick Renieris 78ac2a86bb PPU LLVM: Accurate vector instruction NaNs
Tested with https://github.com/RPCS3/ps3autotests/tree/master/tests/cpu/ppu_vpu,
results in that test improved by about half.
2020-05-14 11:14:28 +01:00
kd-11 cc723ed45c vk: Properly fix dynamic state descriptors 2020-05-13 22:20:43 +03:00
kd-11 ed82288c1b rsx/fp: Support more types of texture access
- Allows more instructions to correctly decode depth textures
2020-05-13 22:20:43 +03:00
Eladash 7680466e0d Minor EFAULT fix in sys_semaphore_get_value/sys_event_flag_get
ESRCH preceeds EFAULT in both syscalls.
2020-05-13 19:36:44 +03:00
Eladash 9266507e4c SPU: Implement spu_channel_(4_)t::try_read 2020-05-13 19:36:44 +03:00
Eladash 8cca113ef4 sys_spu: Add short sleep in sys_spu_thread_group_terminate 2020-05-13 19:36:44 +03:00
Eladash 7ff25588f4 sys_spu: Minor cleanup of group termination process 2020-05-13 19:36:44 +03:00
Eladash 93122196d9 vm: Fix vm::passive_lock regression (#8175)
possible broken signaling in rare occusions.
2020-05-13 16:53:59 +03:00
Eladash 5c4c8f4539 PPU: Use optimized reservation waiting for reservation load (non-TSX) 2020-05-13 16:53:59 +03:00
kd-11 118bfbbe98 rsx: Rewrite data texture remap expansion
- 16-bit channel formats have special 0x4|0xE encoding for only 2 channels, not 4
- float textures do not take any remapping and crash if you try it.
  Depth float textures work fine though.
2020-05-13 14:33:22 +03:00
Eladash 12f0278808 SPU LLVM: Improve MFC transfers recompilation for non-TSX 2020-05-13 11:10:13 +01:00
Eladash b38580bf32 SPU: Use optimized PPU signaling to SPU on reservation pause 2020-05-13 11:10:13 +01:00
Eladash 525453794f SPU/PPU reservations: Optimizations part 1
- Implement vm::reservation_trylock, optimized locking on reservation stores with no waiting. Always fail if reservation lock bitsa are set.
- Make SPU accurate GET transfers on non-TSX not modify reservation lock bits.
- Add some optimization regarding to unmodified data reservations writes.
2020-05-13 11:10:13 +01:00
Megamouse eb5ec211c2 Input: remember registered ldd controllers
- Don't reset ldd pads when saving a pad config
- Prevent configuration of registered ldd pads in the gui while ingame
2020-05-13 11:17:58 +02:00
JohnHolmesII 69ea573b0d vk: Remove more deprecated VK_DYNAMIC_STATE_RANGE_SIZE usage (#8206) 2020-05-13 02:52:01 +01:00
kd-11 dd9397473a vk: Remove deprecated enum VK_DYNAMIC_STATE_RANGE_SIZE (#8202) 2020-05-12 22:36:55 +01:00
sampletext32 86cf8a1717 Fix possible cur_ip nullptr usage in np_handler.cpp 2020-05-12 18:28:12 +02:00
Megamouse 6374a9f19b Qt: remove debug tab wall for Utilities menu
In order to make it easier for the user to take RSX captures.
2020-05-12 16:48:56 +02:00
Eladash f95b81574f sys_spu: Fix race in sys_spu_thread_group_destroy and other minor fixes (#8182)
* sys_spu: Fix race in sys_spu_thread_group_destroy and other minor fixes

* SPU: Wait for all threads to have error codes if exited by sys_spu_thread_exit

On last thread in group to run.

* sys_spu: Fix sys_spu_thread_group_start

* fixup ad fix sys_spu_thread_group_terminate

idk why "- !group->running" was put in the first place but its probably no longer relevant due to other changes and was causing other issues such as not always waiting for last SPU thread to set group state to INITIALIZED.
2020-05-11 21:24:04 +03:00
Maxim Kulyk d67e77899f [CI] xenial 1.2->1.3 2020-05-11 16:40:28 +03:00
RipleyTom dd5c54290c Improves skylander generation (#8177) 2020-05-11 11:57:13 +01:00
kd-11 b6e8560532 rsx/fp: Fix PK2/UP2 instruction
- These variants take unsigned scalar inputs, not signed.
- Fixes ARGB8->X16Y16 in SR: Gat out of Hell
2020-05-11 09:37:00 +01:00
Maxim Kulyk 5dc8b05275 [CI] Update VulkanSDK to 1.2.135.0 2020-05-10 21:13:04 +01:00
Maxim Kulyk 48ecc00368 [msbuild] Exctract Cmake cmd line to variable
Same change as was made for llvm_build
2020-05-10 21:13:04 +01:00
Maxim Kulyk 04ead3cba4 [msbuild] Change vulkan libs dir search priority
VulkanSDK 1.2.135.0+ comes with a lot more libs including glslang.lib and SPIRV*.lib. This allows to load all rpcs built libs first.
2020-05-10 21:13:04 +01:00
kd-11 79e2a87bc5 rsx: Fix NOP shader passing
- NOP shaders are used to stub rendering when a pass is supposed to be disabled
2020-05-10 21:54:34 +03:00
Eladash bd61347b21 sys_spu: reset group exit status in sys_spu_thread_group_start 2020-05-10 03:46:11 +01:00
Eladash 09797c3584 sys_spu: Improve sys_spu_thread_get_exit_status 2020-05-10 03:46:11 +01:00
kd-11 14969cd8d0 rsx: Disable SCA writes to output register if vec result flag is set.
- Noticed when debugging X-men origins: wolverine which has a bogus SCA op whilst writing vector to output
- It makes no sense for both SCA and VEC to both write to the same register in the same instruction as memory ordering becomes an issue
2020-05-08 14:35:07 +03:00
kd-11 79c54aeba9 rsx: Move analyser dump to its own config option 2020-05-08 14:35:07 +03:00
kd-11 a1b6415c5a rsx: Fix alpha ref
- The alpha ref register is compared directly to the ROP output register in realhw
- alpha ref content must match bit-width of ROP register, which means fp16 values are possible
2020-05-08 00:02:47 +03:00
Megamouse 8e2b2bc179 Don't load custom configs when adding games 2020-05-07 18:10:49 +02:00
Nekotekina e1042bc631 Get rid of "module" keyword
Workaround some intellisense problems.
2020-05-06 18:20:11 +03:00
Eladash a6025df7de vm: reset stack memory after deallocation 2020-05-06 18:03:37 +03:00
Megamouse 5c4b8e8dee Input: fix xinput deadzones 2020-05-06 09:33:38 +02:00
Megamouse f95bf01c78 Input: fix trigger scaling
this is not a problem at the moment, but if you increase the trigger_max then the old code reports values bigger than 255
2020-05-06 09:33:38 +02:00
Megamouse d4606cfdb9 Input: remame some functions 2020-05-06 09:33:38 +02:00
Nekotekina 907adc817e Fix some warnings (GCC) 2020-05-05 21:55:22 +03:00
Nekotekina a6f0b1b532 Fix get_thread_affinity_mask (Linux/BSD)
Uninitialized variable (facepalm).
2020-05-05 21:44:32 +03:00
Eladash 1bd6cb2105 SPU/PPU debugger: use ':' instead of '=' 2020-05-05 13:46:26 +03:00
kd-11 142a1da0e0 Fix windows build 2020-05-05 13:18:03 +03:00
kd-11 fb3d5827f0 Fix linux build 2020-05-05 13:18:03 +03:00
kd-11 a3f25bc7c7 rsx/interpreter: Fix DIVSQ instruction 2020-05-05 13:18:03 +03:00
kd-11 a0f63a31e3 vk: Enable optimization passes for generated SPIRV 2020-05-05 13:18:03 +03:00
kd-11 f72385b00c vulkan: Import spirv-tools subproject and update glslang 2020-05-05 13:18:03 +03:00
kd-11 4f7c020e63 glsl: Improve VGPR usage
- VGPR usage lowered from 159 -> 127 for texturing. Occupancy doubled from 1 to 2
- Eliminate most temporary registers
2020-05-05 13:18:03 +03:00
Pavel 9a4c26dc8c Qt: Option to disable keyboard hotkeys 2020-05-04 01:10:44 +03:00
Eladash edde748519 sys_event_queue: Fix forced event queue destruction
Add missing last existence check at sys_spu_thread_(try)receive_event and lv2_event_queue::send.
2020-05-04 01:10:19 +03:00
Eladash 37ce7056ac lv2: Minor optimization for "awake all" threads in sleep queue 2020-05-04 01:10:19 +03:00
Eladash b84b8f4db4 sys_cond_signal_all: Use SYS_SYNC_PRIORITY protocol to signal threads 2020-05-04 01:10:19 +03:00
Eladash 72bef8dd7f PPU: Clear reservation on context switch
Ensure that only 2 PPU reservations exist at maximum at a time.
2020-05-02 14:57:38 +03:00
Eladash 0e6937a359 SPU GETLLAR: Don't use loop detection for TSX 2020-05-02 14:57:38 +03:00
MSuih b18dcd7660 Add fs::error for when disk is full 2020-05-02 14:54:41 +03:00
Megamouse 2b69a68ef6 Qt: show mouse in fullscreen 2020-05-02 09:27:54 +02:00
Nekotekina fc68c508c8 LLVM DSL: fix FNeg pattern matching 2020-05-01 22:00:57 +03:00
Nekotekina cda8b3a59e RSX: fix new warnings 2020-05-01 22:00:57 +03:00
Nekotekina 31035608ee Use utils::get_cpu_brand when applicable 2020-05-01 22:00:57 +03:00
Nekotekina f6200ba635 Implement thread_ctrl::get_process_affinity_mask() 2020-05-01 22:00:56 +03:00
Malcolm Jestadt c1bd154bcd SPU: Optimize FMA ops with 0 addend 2020-05-01 17:52:10 +03:00
Megamouse a568c958af evdev: simplify evdevbutton madness a bit
I hope this doesn't regress anything
2020-05-01 12:03:06 +02:00
Megamouse 2de6a9bc44 evdev: revert facepalm change 2020-05-01 12:03:06 +02:00
917 changed files with 68976 additions and 34430 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh -ex
# Pull all the submodules except llvm
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
# libc++ isn't in llvm* packages, so download manually
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/libcxx-11.0.0.src.tar.xz
tar xf libcxx-11.0.0.src.tar.xz
export CC=clang11 CXX=clang++11
export CXXFLAGS="$CXXFLAGS -nostdinc++ -isystem $PWD/libcxx-11.0.0.src/include"
CONFIGURE_ARGS="
-DWITH_LLVM=OFF
-DUSE_PRECOMPILED_HEADERS=OFF
-DUSE_NATIVE_INSTRUCTIONS=OFF
-DUSE_SYSTEM_FFMPEG=ON
-DUSE_SYSTEM_CURL=ON
-DUSE_SYSTEM_LIBPNG=ON
"
# shellcheck disable=SC2086
cmake -B build -G Ninja $CONFIGURE_ARGS
cmake --build build
ccache --show-stats
ccache --zero-stats
+6 -7
View File
@@ -25,8 +25,8 @@ if [ "$COMPILER" = "gcc" ]; then
export CXX=${GXX_BINARY}
export LINKER=gold
# We need to set the following variables for LTO to link properly
export AR=/usr/bin/gcc-ar-9
export RANLIB=/usr/bin/gcc-ranlib-9
export AR=/usr/bin/gcc-ar-$GCCVER
export RANLIB=/usr/bin/gcc-ranlib-$GCCVER
export CFLAGS="-fuse-linker-plugin"
else
export CC=${CLANG_BINARY}
@@ -48,17 +48,16 @@ cmake .. \
-DCMAKE_CXX_FLAGS="$CFLAGS" \
-DCMAKE_AR="$AR" \
-DCMAKE_RANLIB="$RANLIB" \
-DUSE_SYSTEM_CURL=ON \
-G Ninja
ninja; build_status=$?;
cd ..
# If it compiled succesfully let's deploy depending on the build pipeline (Travis, Azure Pipelines).
# Travis only deploys on master, and it publishes to GitHub releases. Azure publishes PRs as artifacts
# only.
{ [ "$IS_AZURE" = "true" ] ||
{ [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; };
# If it compiled succesfully let's deploy depending on the build pipeline (Azure Pipelines).
# Azure publishes PRs as artifacts only.
{ [ "$IS_AZURE" = "true" ];
} && SHOULD_DEPLOY="true" || SHOULD_DEPLOY="false"
if [ "$build_status" -eq 0 ] && [ "$SHOULD_DEPLOY" = "true" ]; then
+3 -11
View File
@@ -41,7 +41,6 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
COMM_HASH="$(git rev-parse --short=8 HEAD)"
RPCS3_APPIMAGE="rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_linux64.AppImage"
curl -sLO https://github.com/hcorion/uploadtool/raw/master/upload.sh
mv ./RPCS3*.AppImage "$RPCS3_APPIMAGE"
# If we're building using Azure Pipelines, let's copy over the AppImage artifact
@@ -50,16 +49,9 @@ if [ "$DEPLOY_APPIMAGE" = "true" ]; then
fi
FILESIZE=$(stat -c %s ./rpcs3*.AppImage)
SHA256SUM=$(sha256sum ./rpcs3*.AppImage)
if [ -n "$GITHUB_TOKEN" ]; then
unset TRAVIS_REPO_SLUG
REPO_SLUG=RPCS3/rpcs3-binaries-linux \
UPLOADTOOL_BODY="$SHA256SUM;${FILESIZE}B"\
RELEASE_NAME=build-${TRAVIS_COMMIT}\
RELEASE_TITLE=${COMM_TAG}-${COMM_COUNT}\
REPO_COMMIT=d812f1254a1157c80fd402f94446310560f54e5f\
bash upload.sh rpcs3*.AppImage
fi
SHA256SUM=$(sha256sum ./rpcs3*.AppImage | awk '{ print $1 }')
echo "${SHA256SUM};${FILESIZE}B" > /rpcs3/GitHubReleaseMessage.txt
fi
if [ "$DEPLOY_PPA" = "true" ]; then
+2 -6
View File
@@ -1,7 +1,3 @@
# Variables set by Travis CI
TRAVIS_PULL_REQUEST
TRAVIS_BRANCH
TRAVIS_COMMIT
# Variables set by Azure Pipelines
IS_AZURE
BUILD_REASON
@@ -9,8 +5,8 @@ BUILD_SOURCEVERSION
BUILD_ARTIFACTSTAGINGDIRECTORY
BUILD_REPOSITORY_NAME
BUILD_SOURCEBRANCHNAME
# Variables for Travis build matrix
# Variables for build matrix
COMPILER
DEPLOY_APPIMAGE
# Private Travis CI variables
# Private variables
GITHUB_TOKEN
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh -ex
curl -L -o "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z.sha256"
curl -L -o "./glslang.lock" "https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z.sha256"
+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh -ex
ARTIFACT_DIR="$BUILD_ARTIFACTSTAGINGDIRECTORY"
generate_post_data()
{
body=$(cat GitHubReleaseMessage.txt)
cat <<EOF
{
"tag_name": "build-${BUILD_SOURCEVERSION}",
"target_commitish": "${UPLOAD_COMMIT_HASH}",
"name": "${AVVER}",
"body": "$body",
"draft": false,
"prerelease": false
}
EOF
}
curl -s \
-H "Authorization: token ${RPCS3_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
--data "$(generate_post_data)" "https://api.github.com/repos/$UPLOAD_REPO_FULL_NAME/releases" >> release.json
cat release.json
id=$(grep '"id"' release.json | cut -d ':' -f2 | head -n1 | awk '{$1=$1;print}')
id=${id%?}
echo ${id:?}
upload_file()
{
curl -s \
-H "Authorization: token ${RPCS3_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$2"/"$3" \
"https://uploads.github.com/repos/$UPLOAD_REPO_FULL_NAME/releases/$1/assets?name=$3"
}
for file in "$ARTIFACT_DIR"/*; do
name=$(basename "$file")
upload_file "$id" "$ARTIFACT_DIR" "$name"
done
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env -S su -m root -ex
# NOTE: this script is run under root permissions
# shellcheck shell=sh disable=SC2096
# RPCS3 often needs recent Qt5 and Vulkan-Headers
sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf
export ASSUME_ALWAYS_YES=true
pkg info # debug
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
pkg install llvm11
# Mandatory dependencies (qt5-dbus and qt5-gui are pulled via qt5-widgets)
pkg install git ccache cmake ninja qt5-qmake qt5-buildtools qt5-widgets qt5-concurrent glew openal-soft ffmpeg
# Optional dependencies (libevdev is pulled by qt5-gui)
pkg install pkgconf alsa-lib pulseaudio sdl2 evdev-proto vulkan-headers vulkan-loader
+7 -6
View File
@@ -7,18 +7,19 @@ PR_NUMBER="$SYSTEM_PULLREQUEST_PULLREQUESTID"
# Resource/dependency URLs
# Qt mirrors can be volatile and slow, so we list 2
#QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
QT_HOST="http://qt.mirror.constant.com/"
QT_HOST="http://mirrors.ocf.berkeley.edu/qt/"
#QT_HOST="http://qt.mirror.constant.com/"
QT_URL_VER=$(echo "$QT_VER" | sed "s/\.//g")
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt5_${QT_URL_VER}/qt.qt5.${QT_URL_VER}.win64_msvc2017_64/${QT_VER}-0-${QT_DATE}"
QT_SUFFIX="-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z"
QT_VER_MSVC_UP=$(echo ${QT_VER_MSVC} | tr '[:lower:]' '[:upper:]')
QT_PREFIX="online/qtsdkrepository/windows_x86/desktop/qt${QT_VER_MAIN}_${QT_URL_VER}/qt.qt${QT_VER_MAIN}.${QT_URL_VER}.win64_${QT_VER_MSVC}_64/${QT_VER}-0-${QT_DATE}"
QT_SUFFIX="-Windows-Windows_10-${QT_VER_MSVC_UP}-Windows-Windows_10-X86_64.7z"
QT_BASE_URL="${QT_HOST}${QT_PREFIX}qtbase${QT_SUFFIX}"
QT_WINE_URL="${QT_HOST}${QT_PREFIX}qtwinextras${QT_SUFFIX}"
QT_DECL_URL="${QT_HOST}${QT_PREFIX}qtdeclarative${QT_SUFFIX}"
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}qttools${QT_SUFFIX}"
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win/llvmlibs_mt.7z'
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z'
VULKAN_SDK_URL="https://sdk.lunarg.com/sdk/download/${VULKAN_VER}/windows/VulkanSDK-${VULKAN_VER}-Installer.exe"
VULKAN_SDK_URL="https://www.dropbox.com/s/kn005de7gsv5whe/VulkanSDK-1.2.154.1-Installer.exe"
DEP_URLS=" \
$QT_BASE_URL \
@@ -35,7 +36,7 @@ DEP_URLS=" \
# Pull all the submodules except llvm, since it is built separately and we just download that build
# Note: Tried to use git submodule status, but it takes over 20 seconds
# shellcheck disable=SC2046
git submodule -q update --init $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ { print $3 }' .gitmodules)
# Git bash doesn't have rev, so here it is
rev()
+19
View File
@@ -0,0 +1,19 @@
env:
CIRRUS_CLONE_DEPTH: 0 # Unshallow clone to obtain proper GIT_VERSION
freebsd_task:
matrix:
- name: FreeBSD 12.2
freebsd_instance:
image_family: freebsd-12-2
cpu: 8
memory: 8G
env:
CCACHE_MAXSIZE: 300M # 3x clean build, rounded
CCACHE_DIR: /tmp/ccache_dir
ccache_cache:
folder: /tmp/ccache_dir
packages_cache:
folder: /var/cache/pkg
install_script: "sh -ex ./.ci/install-freebsd.sh"
script: "./.ci/build-freebsd.sh"
+11 -11
View File
@@ -1,20 +1,20 @@
Standard: Cpp11
Standard: c++20
UseTab: ForIndentation
TabWidth: 1
IndentWidth: 1
AccessModifierOffset: -1
TabWidth: 4
IndentWidth: 4
AccessModifierOffset: -4
PointerAlignment: Left
NamespaceIndentation: All
ColumnLimit: 200
ColumnLimit: 0
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: true
BreakBeforeBinaryOperators: false
BreakConstructorInitializers: BeforeColon
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
AlwaysBreakTemplateDeclarations: true
AllowShortIfStatementsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
AllowShortIfStatementsOnASingleLine: Never
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
Cpp11BracedListStyle: true
IndentCaseLabels: false
+1 -1
View File
@@ -1,7 +1,7 @@
root = true
[*.{h,cpp,hpp}]
charset = utf-8-bom
charset = utf-8
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
+2
View File
@@ -0,0 +1,2 @@
handle SIGSEGV nostop noprint
handle SIGPIPE nostop noprint
+48 -14
View File
@@ -1,28 +1,62 @@
---
name: Regression report
about: If something worked before, but now it doesn't
about: If something used to work before, but now it doesn't
title: ''
labels: ''
assignees: ''
---
<!---
Please do not ask for help or report compatibility regressions here, use RPCS3 Discord server or forums instead.
Please read Contributing guide under Helpful resources on the right. →
--->
## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
## Quick summary
Please describe what exactly has stopped working correctly
Please briefly describe what has stopped working correctly.
## Details
Please provide _exact_ build (or commit) information that introduced the regression you're reporting.
Please see How to find the build that caused a regression in wiki: https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_find_the_build_that_caused_a_regression.3F
You can find old builds here: https://rpcs3.net/compatibility?b
Please describe the regression as accurately as possible.
Please remember to attach TWO logs: one for the build that exhibits regression, and one for the previous build that works as expected.
#### 1. Please provide _exact_ build (or commit) information that introduced the regression you're reporting.
* Please see [How to find the build that caused a regression](https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_find_the_build_that_caused_a_regression.3F) in our wiki.
* You can find [History of RPCS3 builds](https://rpcs3.net/compatibility?b) here.
If the regression caused a graphical issue, please provide RSX capture and a Renderdoc capture that demonstrate the issue.
To create an RSX capture, enable Debugger view (View → Show Debugger) and use the RSX Capture button. Captues will be stored in RPCS3 folder → captures.
To create Renderdoc capture, please refer to Renderdoc documentation https://renderdoc.org/docs/how/how_capture_frame.html
#### 2. Please attach TWO logs:
* One for the build with regression.
* One for the build that works as expected.
##### How to obtain RPCS3's log:
* Run the game until you find the regression.
* Completely close RPCS3, or move to the next step in case it has crashed.
* Locate RPCS3's log file:
+ ```RPCS3.log``` (It can show up as just RPCS3 and have a notepad icon)
or
+ ```RPCS3.log.gz``` (It can show up as RPCS3.log and have a zip or rar icon)
![image](https://user-images.githubusercontent.com/44116740/84433247-aa15fa80-ac36-11ea-913e-6fe25a1d040e.png)
On Linux it will be in ```~/.cache/rpcs3/```.
On Windows it will be near the executable.
* Attach the log:
+ Drag and drop your log file into the issue.
+ Or upload it to the cloud, such as Dropbox, Mega etc.
#### 3. If you describe graphical regression, please provide an RSX capture and a RenderDoc capture that demonstrate it.
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
Captures will be stored in RPCS3 folder → captures.
+ Compress your capture with 7z, Rar etc.
And drag and drop it into the issue.
+ Or upload it to the cloud, such as Dropbox, Mega etc.
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
#### 4. Please attach screenshots of your problem.
* Enable performance overlay with at least medium level of detail.
You can find it in _Emulator_ tab in _Settings_.
#### 5. Please provide comparison with real PS3.
#### 6. Please provide your system configuration:
* OS
* CPU
* GPU
* Driver version
* etc.
#### Please include.
* Anything else you deem to be important
+42 -13
View File
@@ -7,20 +7,49 @@ assignees: ''
---
<!---
Please do not ask for help or general inquiry here, use RPCS3 Discord server instead.
Please read Contributing guide under Helpful resources on the right. →
--->
## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
## Quick summary
Please summarize the issue here
Please briefly describe what is not working correctly.
## Details
Please provide as much detail as you can here, including
- expected (real hw) and observed (emulator) behavior
- full logs (not from UI)
- back traces (for hard crashes)
- screenshots, Renderdoc, and RSX captures (for visual issues)
- your system configuration (OS, CPU, GPU, driver versions, etc)
- anything else you deem to be important
Please describe the problem as accurately as possible.
#### 1. Please attach RPCS3's log.
* Run the game until you find the issue.
* Completely close RPCS3, or move to the next step in case it has crashed.
* Locate RPCS3's log file:
+ ```RPCS3.log``` (It can show up as just RPCS3 and have a notepad icon)
or
+ ```RPCS3.log.gz``` (It can show up as RPCS3.log and have a zip or rar icon)
![image](https://user-images.githubusercontent.com/44116740/84433247-aa15fa80-ac36-11ea-913e-6fe25a1d040e.png)
On Linux it will be in ```~/.cache/rpcs3/```.
On Windows it will be near the executable.
* Attach the log:
+ Drag and drop your log file into the issue.
+ Or upload it to the cloud, such as Dropbox, Mega etc.
#### 2. If you describe graphical issue, please provide an RSX capture and a RenderDoc capture that demonstrate it.
* To create an RSX capture, use _Create_ _RSX_ _Capture_ under _Utilities_.
Captures will be stored in RPCS3 folder → captures.
+ Compress your capture with 7z, Rar etc.
And drag and drop it into the issue.
+ Or upload it to the cloud, such as Dropbox, Mega etc.
* To create a RenderDoc capture, please refer to [RenderDoc's documentation](https://renderdoc.org/docs/how/how_capture_frame.html).
#### 3. Please attach screenshots of your problem.
* Enable performance overlay with at least medium level of detail.
You can find it in _Emulator_ tab in _Settings_.
#### 4. Please provide comparison with real PS3.
#### 5. Please provide your system configuration:
* OS
* CPU
* GPU
* Driver version
* etc.
#### Please include.
* Anything else you deem to be important
@@ -0,0 +1,41 @@
---
name: Feature Request
about: If RPCS3 lacks a feature you would like to see
title: '[Feature Request] Enter Feature Title Here'
labels: ''
assignees: ''
---
## Please do not ask for help or report compatibility regressions here, use [RPCS3 Discord server](https://discord.me/RPCS3) or [forums](https://forums.rpcs3.net/) instead.
## Quick summary
Please briefly describe what feature you would like RPCS3 to have.
## Details
Please describe the feature as accurately as possible.
#### 1. Please describe, what part of RPCS3 would be affected by your feature:
* Gameplay
* Debugging
* UI
* Patches
* Installation
* Github
* CI
* etc.
#### 2. Please tell us, why your feature is important to RPCS3.
#### 3. Please attach screenshots of the feature implemented in other projects.
#### 4. Please provide your system configuration:
* OS
* CPU
* GPU
* Driver version
* etc.
#### Please include.
* Anything else you deem to be important
+20
View File
@@ -0,0 +1,20 @@
## How to test a PR build
Please take into account, that RPCS3 build usually takes some time (about 20 min), so you can't access a build, if a PR was just submitted.
- Open a PR you want to test
- Scroll to the very bottom and locate "Checks" section
- Expand all checks
You are supposed to see something like this
![image](https://user-images.githubusercontent.com/44116740/102790039-f98f6d00-43b5-11eb-9134-2359b732508d.png)
- Click on **Linux_Build** or **Windows_Build** __Details__
- Click **View more details on Azure Pipelines** at the very bottom
![image](https://user-images.githubusercontent.com/44116740/102790281-45daad00-43b6-11eb-90e7-0fa8c37c31c6.png)
- Click on *1 artifact produced*
![image](https://user-images.githubusercontent.com/44116740/102790526-9a7e2800-43b6-11eb-9925-be1ea1c8bdad.png)
- Select a build for your OS and click three dots on the right, Click **Download artifacts**
![image](https://user-images.githubusercontent.com/44116740/102790636-c9949980-43b6-11eb-9692-1e3ba567b9be.png)
- Congratulations! You are now downloading RPCS3 build for specific PR.
Please note, that PR builds are not supposed to be stable, because they contain new changesets.
@@ -0,0 +1,3 @@
<!-- Please include a summary of the change and which issue is fixed. -->
[How to test this PR](.github/PR-BUILD.md)
+1
View File
@@ -40,6 +40,7 @@
/3rdparty/llvm_build
/Vulkan/Vulkan-build
/Vulkan/glslang-build
/Vulkan/spirv-tools-build
!/bin
/bin/*
+14 -3
View File
@@ -14,6 +14,14 @@
path = Vulkan/glslang
url = https://github.com/KhronosGroup/glslang.git
ignore = dirty
[submodule "Vulkan/spirv-tools"]
path = Vulkan/spirv-tools
url = https://github.com/KhronosGroup/SPIRV-Tools.git
ignore = dirty
[submodule "Vulkan/spirv-headers"]
path = Vulkan/spirv-headers
url = https://github.com/KhronosGroup/SPIRV-Headers.git
ignore = dirty
[submodule "3rdparty/cereal"]
path = 3rdparty/cereal
url = https://github.com/RPCS3/cereal.git
@@ -57,10 +65,13 @@
ignore = dirty
[submodule "3rdparty/curl"]
path = 3rdparty/curl
url = https://github.com/RipleyTom/curl.git
url = https://github.com/curl/curl.git
ignore = dirty
[submodule "3rdparty/wolfssl"]
path = 3rdparty/wolfssl
url = https://github.com/RipleyTom/wolfssl.git
url = https://github.com/wolfSSL/wolfssl.git
ignore = dirty
[submodule "3rdparty/flatbuffers"]
path = 3rdparty/flatbuffers
url = https://github.com/google/flatbuffers.git
ignore = dirty
-3
View File
@@ -1,3 +0,0 @@
{
"userBlacklist": ["AlexAltea", "tambry", "DHrpcs3"]
}
-41
View File
@@ -1,41 +0,0 @@
language: cpp
jobs:
include:
- os: linux
dist: xenial
env:
- NAME="Linux build"
- COMPILER="gcc"
- DEPLOY_APPIMAGE="true"
services: docker
cache: ccache
compiler: gcc
install: "docker pull rpcs3/rpcs3-travis-xenial:1.2"
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .ci/travis.env rpcs3/rpcs3-travis-xenial:1.2 /rpcs3/.ci/build-linux.sh'
- os: linux
dist: xenial
env:
- NAME="Linux build"
- COMPILER="clang"
services: docker
cache: ccache
compiler: clang
install: "docker pull rpcs3/rpcs3-travis-xenial:1.2"
script: 'travis_wait docker run -v $(pwd):/rpcs3 -v "$HOME/.ccache":/root/.ccache --env-file .ci/travis.env rpcs3/rpcs3-travis-xenial:1.2 /rpcs3/.ci/build-linux.sh'
# - os: osx
# osx_image: xcode11.3
# addons:
# homebrew:
# packages:
# - ccache
# - glew
# - ninja
# - qt
# script: "/bin/bash -ex .ci/build-mac.sh"
# cache: ccache
allow_failures:
- os: osx
git:
depth: false # Unshallow clone to obtain proper GIT_VERSION
submodules: false
+3
View File
@@ -111,6 +111,9 @@
</PropertyGroup>
<Import Project="..\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="..\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
+74 -19
View File
@@ -74,6 +74,9 @@ else()
add_library(3rdparty_7z INTERFACE)
endif()
add_library(3rdparty_flatbuffers INTERFACE)
target_include_directories(3rdparty_flatbuffers INTERFACE flatbuffers/include)
# libPNG
# Select the version of libpng to use, default is builtin
if (NOT USE_SYSTEM_LIBPNG)
@@ -103,6 +106,36 @@ endif()
add_subdirectory(pugixml EXCLUDE_FROM_ALL)
# libusb
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
pkg_check_modules(LIBUSB REQUIRED IMPORTED_TARGET libusb-1.0>=1.0 )
CMAKE_DEPENDENT_OPTION( USE_SYS_LIBUSB "Use system libusb-1.0 as shared library" ON
"LIBUSB_FOUND" OFF)
else()
pkg_check_modules(LIBUSB IMPORTED_TARGET libusb-1.0>=1.0 )
CMAKE_DEPENDENT_OPTION( USE_SYS_LIBUSB "Use system libusb-1.0 as shared library" OFF
"LIBUSB_FOUND" OFF)
endif()
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
# Always use system libusb as reference implementation isn't supported
add_library(usb-1.0-shared INTERFACE)
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
elseif(MSVC)
# Windows time.h defines timespec but doesn't add any flag for it, which makes libusb attempt to define it again
add_definitions(-DHAVE_STRUCT_TIMESPEC=1)
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
else()
if(USE_SYS_LIBUSB)
# we have the system libusb and have selected to use it
add_library(usb-1.0-shared INTERFACE)
target_link_libraries(usb-1.0-shared INTERFACE PkgConfig::LIBUSB)
else()
# we don't have the system libusb, so we compile from submodule
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
endif()
endif()
# hidapi
add_library(3rdparty_hidapi INTERFACE)
target_include_directories(3rdparty_hidapi INTERFACE hidapi/hidapi)
@@ -130,24 +163,11 @@ else()
endif()
# libusb
if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
# Always use system libusb as reference implementation isn't supported
add_library(usb-1.0-static INTERFACE)
target_link_libraries(usb-1.0-static INTERFACE usb)
elseif(MSVC)
# Windows time.h defines timespec but doesn't add any flag for it, which makes libusb attempt to define it again
add_definitions(-DHAVE_STRUCT_TIMESPEC=1)
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
else()
add_subdirectory(libusb_cmake EXCLUDE_FROM_ALL)
endif()
# yaml-cpp
# We don't want to install yaml-cpp but its cmake file doesn't have option
# to disable it...
# So we just install it to a different directory
set(YAML_CPP_INSTALL OFF CACHE BOOL "Don't install YAML")
set(CMAKE_INSTALL_PREFIX_OLD ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/yaml-cpp_install)
@@ -161,6 +181,7 @@ set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_OLD})
# xxHash
set(XXHASH_BUNDLED_MODE ON)
set(XXHASH_BUILD_XXHSUM OFF)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Make xxHash build static libs")
add_subdirectory(xxHash/cmake_unofficial EXCLUDE_FROM_ALL)
target_include_directories(xxhash INTERFACE xxHash)
@@ -297,7 +318,7 @@ if(USE_VULKAN)
if(VULKAN_FOUND)
add_library(3rdparty_vulkan INTERFACE)
target_compile_definitions(3rdparty_vulkan INTERFACE -DHAVE_VULKAN)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV Vulkan::Vulkan)
target_link_libraries(3rdparty_vulkan INTERFACE SPIRV SPIRV-Tools-opt Vulkan::Vulkan)
if(UNIX AND NOT APPLE)
find_package(Wayland)
@@ -413,23 +434,57 @@ endif()
# LLVM
include(llvm.cmake)
# WOLFSSL
if(USE_SYSTEM_WOLFSSL)
message("-- RPCS3: using shared wolfssl")
find_package(WolfSSL REQUIRED)
add_library(wolfssl INTERFACE)
target_link_libraries(wolfssl INTERFACE WolfSSL_LIBRARIES)
target_include_directories(wolfssl INTERFACE WolfSSL_INCLUDE_DIRS)
else()
SET(BUILD_TESTS NO CACHE BOOL "Build test applications")
add_compile_definitions(HAVE_FFDHE_2048 TFM_TIMING_RESISTANT ECC_TIMING_RESISTANT
WC_RSA_BLINDING HAVE_AESGCM WOLFSSL_SHA512 WOLFSSL_SHA384 NO_DSA HAVE_ECC TFM_ECC256 ECC_SHAMIR
NO_RC4 NO_HC128 NO_RABBIT WOLFSSL_SHA224 WOLFSSL_SHA3 WOLFSSL_SHAKE256 HAVE_POLY1305
HAVE_ONE_TIME_AUTH HAVE_CHACHA HAVE_HASHDRBG HAVE_TLS_EXTENSIONS HAVE_SNI HAVE_SUPPORTED_CURVES
HAVE_EXTENDED_MASTER NO_RC4 HAVE_ENCRYPT_THEN_MAC NO_PSK NO_MD4
WC_NO_ASYNC_THREADING OPENSSL_EXTRA WOLFSSL_DES_ECB WC_NO_HARDEN)
set(ENABLED_HARDEN OFF CACHE BOOL "Disable Harden")
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
target_include_directories(wolfssl INTERFACE "wolfssl/")
# This is needed for CURL
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfssl/options.h.in ${CMAKE_CURRENT_BINARY_DIR}/wolfssl/wolfssl/options.h)
set(WolfSSL_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/libwolfssl.a")
set(WolfSSL_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/libwolfssl.a")
set(WolfSSL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/" "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/")
set(WolfSSL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/" "${CMAKE_CURRENT_BINARY_DIR}/wolfssl/")
endif()
# CURL
if(USE_SYSTEM_CURL)
message("-- RPCS3: using shared libcurl")
find_package(CURL REQUIRED)
add_library(wolfssl-3-static INTERFACE)
add_library(libcurl INTERFACE)
target_link_libraries(libcurl INTERFACE CURL::libcurl)
else()
message("-- RPCS3: building libcurl + wolfssl submodules")
add_subdirectory(wolfssl EXCLUDE_FROM_ALL)
option(BUILD_CURL_EXE "Set to ON to build curl executable." OFF)
option(CMAKE_USE_WOLFSSL "enable wolfSSL for SSL/TLS" ON)
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" ON)
option(CURL_ZLIB "Set to ON to enable building curl with zlib support." OFF)
set(CURL_CA_PATH "none" CACHE STRING "Location of default CA path. Set 'none' to disable or 'auto' for auto-detection. Defaults to 'auto'.")
add_subdirectory(curl EXCLUDE_FROM_ALL)
endif()
# add nice ALIAS targets for ease of use
add_library(3rdparty::libusb ALIAS usb-1.0-static)
if(USE_SYS_LIBUSB)
add_library(3rdparty::libusb ALIAS usb-1.0-shared)
else()
add_library(3rdparty::libusb ALIAS usb-1.0-static)
endif()
add_library(3rdparty::zlib ALIAS 3rdparty_zlib)
add_library(3rdparty::7z ALIAS 3rdparty_7z)
add_library(3rdparty::flatbuffers ALIAS 3rdparty_flatbuffers)
add_library(3rdparty::pugixml ALIAS pugixml)
add_library(3rdparty::yaml-cpp ALIAS yaml-cpp)
add_library(3rdparty::xxhash ALIAS xxhash)
@@ -448,5 +503,5 @@ add_library(3rdparty::vulkan ALIAS ${VULKAN_TARGET})
add_library(3rdparty::openal ALIAS 3rdparty_openal)
add_library(3rdparty::ffmpeg ALIAS 3rdparty_ffmpeg)
add_library(3rdparty::glew ALIAS 3rdparty_glew)
add_library(3rdparty::wolfssl ALIAS wolfssl-3-static)
add_library(3rdparty::wolfssl ALIAS wolfssl)
add_library(3rdparty::libcurl ALIAS libcurl)
+383 -77
View File
@@ -1,12 +1,12 @@
#ifndef __glext_h_
#define __glext_h_ 1
#ifndef __gl_glext_h_
#define __gl_glext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -51,7 +51,9 @@ extern "C" {
#define GLAPI extern
#endif
#define GL_GLEXT_VERSION 20180114
#define GL_GLEXT_VERSION 20200423
#include "khrplatform.h"
/* Generated C header for:
* API: gl
@@ -464,9 +466,8 @@ GLAPI void APIENTRY glBlendEquation (GLenum mode);
#ifndef GL_VERSION_1_5
#define GL_VERSION_1_5 1
#include <stddef.h>
typedef ptrdiff_t GLsizeiptr;
typedef ptrdiff_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
typedef khronos_intptr_t GLintptr;
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_QUERY_COUNTER_BITS 0x8864
@@ -879,7 +880,7 @@ GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboole
#ifndef GL_VERSION_3_0
#define GL_VERSION_3_0 1
typedef unsigned short GLhalf;
typedef khronos_uint16_t GLhalf;
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
#define GL_CLIP_DISTANCE0 0x3000
#define GL_CLIP_DISTANCE1 0x3001
@@ -1383,45 +1384,8 @@ GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIn
#ifndef GL_VERSION_3_2
#define GL_VERSION_3_2 1
typedef struct __GLsync *GLsync;
#ifndef GLEXT_64_TYPES_DEFINED
/* This code block is duplicated in glxext.h, so must be protected */
#define GLEXT_64_TYPES_DEFINED
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GL_EXT_timer_query extension). */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(__sun__) || defined(__digital__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__) || defined(_LP64)
typedef long int int64_t;
typedef unsigned long int uint64_t;
#else
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined( __VMS ) || defined(__sgi)
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#endif
typedef uint64_t GLuint64;
typedef int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef khronos_int64_t GLint64;
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
#define GL_LINES_ADJACENCY 0x000A
@@ -1497,7 +1461,7 @@ typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
@@ -1517,7 +1481,7 @@ GLAPI void APIENTRY glDeleteSync (GLsync sync);
GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level);
@@ -1773,8 +1737,8 @@ typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location,
typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name);
typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name);
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices);
typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params);
typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
@@ -1820,8 +1784,8 @@ GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *pa
GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name);
GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name);
GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values);
GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name);
GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices);
GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params);
GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values);
@@ -2175,7 +2139,7 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data)
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
@@ -2188,7 +2152,7 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum m
GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
@@ -2469,7 +2433,7 @@ typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params);
typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
@@ -2481,7 +2445,7 @@ typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum
typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params);
typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name);
typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name);
typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
@@ -2513,7 +2477,7 @@ GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect);
GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params);
GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level);
GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length);
@@ -2525,7 +2489,7 @@ GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const
GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params);
GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name);
GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
@@ -2936,7 +2900,7 @@ GLAPI void APIENTRY glPrimitiveBoundingBoxARB (GLfloat minX, GLfloat minY, GLflo
#ifndef GL_ARB_bindless_texture
#define GL_ARB_bindless_texture 1
typedef uint64_t GLuint64EXT;
typedef khronos_uint64_t GLuint64EXT;
#define GL_UNSIGNED_INT64_ARB 0x140F
typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture);
typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler);
@@ -3496,7 +3460,7 @@ GLAPI void APIENTRY glProgramUniform4ui64vARB (GLuint program, GLint location, G
#ifndef GL_ARB_half_float_pixel
#define GL_ARB_half_float_pixel 1
typedef unsigned short GLhalfARB;
typedef khronos_uint16_t GLhalfARB;
#define GL_HALF_FLOAT_ARB 0x140B
#endif /* GL_ARB_half_float_pixel */
@@ -3666,6 +3630,25 @@ GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
#ifndef GL_ARB_internalformat_query2
#define GL_ARB_internalformat_query2 1
#define GL_SRGB_DECODE_ARB 0x8299
#define GL_VIEW_CLASS_EAC_R11 0x9383
#define GL_VIEW_CLASS_EAC_RG11 0x9384
#define GL_VIEW_CLASS_ETC2_RGB 0x9385
#define GL_VIEW_CLASS_ETC2_RGBA 0x9386
#define GL_VIEW_CLASS_ETC2_EAC_RGBA 0x9387
#define GL_VIEW_CLASS_ASTC_4x4_RGBA 0x9388
#define GL_VIEW_CLASS_ASTC_5x4_RGBA 0x9389
#define GL_VIEW_CLASS_ASTC_5x5_RGBA 0x938A
#define GL_VIEW_CLASS_ASTC_6x5_RGBA 0x938B
#define GL_VIEW_CLASS_ASTC_6x6_RGBA 0x938C
#define GL_VIEW_CLASS_ASTC_8x5_RGBA 0x938D
#define GL_VIEW_CLASS_ASTC_8x6_RGBA 0x938E
#define GL_VIEW_CLASS_ASTC_8x8_RGBA 0x938F
#define GL_VIEW_CLASS_ASTC_10x5_RGBA 0x9390
#define GL_VIEW_CLASS_ASTC_10x6_RGBA 0x9391
#define GL_VIEW_CLASS_ASTC_10x8_RGBA 0x9392
#define GL_VIEW_CLASS_ASTC_10x10_RGBA 0x9393
#define GL_VIEW_CLASS_ASTC_12x10_RGBA 0x9394
#define GL_VIEW_CLASS_ASTC_12x12_RGBA 0x9395
#endif /* GL_ARB_internalformat_query2 */
#ifndef GL_ARB_invalidate_subdata
@@ -4713,8 +4696,8 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count);
#ifndef GL_ARB_vertex_buffer_object
#define GL_ARB_vertex_buffer_object 1
typedef ptrdiff_t GLsizeiptrARB;
typedef ptrdiff_t GLintptrARB;
typedef khronos_ssize_t GLsizeiptrARB;
typedef khronos_intptr_t GLintptrARB;
#define GL_BUFFER_SIZE_ARB 0x8764
#define GL_BUFFER_USAGE_ARB 0x8765
#define GL_ARRAY_BUFFER_ARB 0x8892
@@ -4909,6 +4892,12 @@ GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcha
#ifndef GL_ARB_viewport_array
#define GL_ARB_viewport_array 1
typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v);
typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v);
GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f);
#endif
#endif /* GL_ARB_viewport_array */
#ifndef GL_ARB_window_pos
@@ -5009,6 +4998,22 @@ GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
#define GL_CONTEXT_ROBUST_ACCESS 0x90F3
#endif /* GL_KHR_robustness */
#ifndef GL_KHR_shader_subgroup
#define GL_KHR_shader_subgroup 1
#define GL_SUBGROUP_SIZE_KHR 0x9532
#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533
#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534
#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535
#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001
#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002
#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004
#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008
#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010
#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020
#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040
#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080
#endif /* GL_KHR_shader_subgroup */
#ifndef GL_KHR_texture_compression_astc_hdr
#define GL_KHR_texture_compression_astc_hdr 1
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
@@ -5115,7 +5120,7 @@ GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords);
#ifndef GL_OES_fixed_point
#define GL_OES_fixed_point 1
typedef GLint GLfixed;
typedef khronos_int32_t GLfixed;
#define GL_FIXED_OES 0x140C
typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref);
typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
@@ -5411,12 +5416,12 @@ typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severi
typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam);
typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf);
GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam);
GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
#endif
#endif /* GL_AMD_debug_output */
@@ -5440,6 +5445,22 @@ GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRG
#endif
#endif /* GL_AMD_draw_buffers_blend */
#ifndef GL_AMD_framebuffer_multisample_advanced
#define GL_AMD_framebuffer_multisample_advanced 1
#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2
#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3
#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4
#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5
#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6
#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
#endif
#endif /* GL_AMD_framebuffer_multisample_advanced */
#ifndef GL_AMD_framebuffer_sample_positions
#define GL_AMD_framebuffer_sample_positions 1
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
@@ -5485,7 +5506,7 @@ GLAPI void APIENTRY glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLe
#ifndef GL_AMD_gpu_shader_int64
#define GL_AMD_gpu_shader_int64 1
typedef int64_t GLint64EXT;
typedef khronos_int64_t GLint64EXT;
#define GL_INT64_NV 0x140E
#define GL_UNSIGNED_INT64_NV 0x140F
#define GL_INT8_NV 0x8FE0
@@ -5704,6 +5725,10 @@ GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLf
#define GL_AMD_shader_explicit_vertex_parameter 1
#endif /* GL_AMD_shader_explicit_vertex_parameter */
#ifndef GL_AMD_shader_gpu_shader_half_float_fetch
#define GL_AMD_shader_gpu_shader_half_float_fetch 1
#endif /* GL_AMD_shader_gpu_shader_half_float_fetch */
#ifndef GL_AMD_shader_image_load_store_lod
#define GL_AMD_shader_image_load_store_lod 1
#endif /* GL_AMD_shader_image_load_store_lod */
@@ -6451,6 +6476,21 @@ GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
#define GL_422_REV_AVERAGE_EXT 0x80CF
#endif /* GL_EXT_422_pixels */
#ifndef GL_EXT_EGL_image_storage
#define GL_EXT_EGL_image_storage 1
typedef void *GLeglImageOES;
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list);
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list);
GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
#endif
#endif /* GL_EXT_EGL_image_storage */
#ifndef GL_EXT_EGL_sync
#define GL_EXT_EGL_sync 1
#endif /* GL_EXT_EGL_sync */
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#define GL_ABGR_EXT 0x8000
@@ -7780,6 +7820,18 @@ GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern);
#endif
#endif /* GL_EXT_multisample */
#ifndef GL_EXT_multiview_tessellation_geometry_shader
#define GL_EXT_multiview_tessellation_geometry_shader 1
#endif /* GL_EXT_multiview_tessellation_geometry_shader */
#ifndef GL_EXT_multiview_texture_multisample
#define GL_EXT_multiview_texture_multisample 1
#endif /* GL_EXT_multiview_texture_multisample */
#ifndef GL_EXT_multiview_timer_query
#define GL_EXT_multiview_timer_query 1
#endif /* GL_EXT_multiview_timer_query */
#ifndef GL_EXT_packed_depth_stencil
#define GL_EXT_packed_depth_stencil 1
#define GL_DEPTH_STENCIL_EXT 0x84F9
@@ -8049,6 +8101,19 @@ GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *strin
#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
#endif /* GL_EXT_separate_specular_color */
#ifndef GL_EXT_shader_framebuffer_fetch
#define GL_EXT_shader_framebuffer_fetch 1
#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
#endif /* GL_EXT_shader_framebuffer_fetch */
#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent
#define GL_EXT_shader_framebuffer_fetch_non_coherent 1
typedef void (APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void);
#endif
#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */
#ifndef GL_EXT_shader_image_load_formatted
#define GL_EXT_shader_image_load_formatted 1
#endif /* GL_EXT_shader_image_load_formatted */
@@ -8485,6 +8550,11 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#endif /* GL_EXT_texture_sRGB */
#ifndef GL_EXT_texture_sRGB_R8
#define GL_EXT_texture_sRGB_R8 1
#define GL_SR8_EXT 0x8FBD
#endif /* GL_EXT_texture_sRGB_R8 */
#ifndef GL_EXT_texture_sRGB_decode
#define GL_EXT_texture_sRGB_decode 1
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
@@ -8492,6 +8562,10 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
#define GL_SKIP_DECODE_EXT 0x8A4A
#endif /* GL_EXT_texture_sRGB_decode */
#ifndef GL_EXT_texture_shadow_lod
#define GL_EXT_texture_shadow_lod 1
#endif /* GL_EXT_texture_shadow_lod */
#ifndef GL_EXT_texture_shared_exponent
#define GL_EXT_texture_shared_exponent 1
#define GL_RGB9_E5_EXT 0x8C3D
@@ -9098,6 +9172,11 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG
#define GL_INTERLACE_READ_INGR 0x8568
#endif /* GL_INGR_interlace_read */
#ifndef GL_INTEL_blackhole_render
#define GL_INTEL_blackhole_render 1
#define GL_BLACKHOLE_RENDER_INTEL 0x83FC
#endif /* GL_INTEL_blackhole_render */
#ifndef GL_INTEL_conservative_rasterization
#define GL_INTEL_conservative_rasterization 1
#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
@@ -9206,6 +9285,27 @@ GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLen
#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
#endif /* GL_MESAX_texture_stack */
#ifndef GL_MESA_framebuffer_flip_x
#define GL_MESA_framebuffer_flip_x 1
#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC
#endif /* GL_MESA_framebuffer_flip_x */
#ifndef GL_MESA_framebuffer_flip_y
#define GL_MESA_framebuffer_flip_y 1
#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB
typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param);
GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params);
#endif
#endif /* GL_MESA_framebuffer_flip_y */
#ifndef GL_MESA_framebuffer_swap_xy
#define GL_MESA_framebuffer_swap_xy 1
#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD
#endif /* GL_MESA_framebuffer_swap_xy */
#ifndef GL_MESA_pack_invert
#define GL_MESA_pack_invert 1
#define GL_PACK_INVERT_MESA 0x8758
@@ -9319,6 +9419,25 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void);
#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
#endif /* GL_NVX_gpu_memory_info */
#ifndef GL_NVX_gpu_multicast2
#define GL_NVX_gpu_multicast2 1
#define GL_UPLOAD_GPU_MASK_NVX 0x954A
typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask);
typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v);
typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff);
typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask);
GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v);
GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff);
GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v);
GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray);
#endif
#endif /* GL_NVX_gpu_multicast2 */
#ifndef GL_NVX_linked_gpu_multicast
#define GL_NVX_linked_gpu_multicast 1
#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800
@@ -9333,6 +9452,20 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void);
#endif
#endif /* GL_NVX_linked_gpu_multicast */
#ifndef GL_NVX_progress_fence
#define GL_NVX_progress_fence 1
typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void);
typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void);
GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray);
#endif
#endif /* GL_NVX_progress_fence */
#ifndef GL_NV_alpha_to_coverage_dither_control
#define GL_NV_alpha_to_coverage_dither_control 1
#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D
@@ -9545,6 +9678,10 @@ GLAPI void APIENTRY glCallCommandListNV (GLuint list);
#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC
#endif /* GL_NV_compute_program5 */
#ifndef GL_NV_compute_shader_derivatives
#define GL_NV_compute_shader_derivatives 1
#endif /* GL_NV_compute_shader_derivatives */
#ifndef GL_NV_conditional_render
#define GL_NV_conditional_render 1
#define GL_QUERY_WAIT_NV 0x8E13
@@ -9843,6 +9980,10 @@ GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, cons
#define GL_NV_fragment_program_option 1
#endif /* GL_NV_fragment_program_option */
#ifndef GL_NV_fragment_shader_barycentric
#define GL_NV_fragment_shader_barycentric 1
#endif /* GL_NV_fragment_shader_barycentric */
#ifndef GL_NV_fragment_shader_interlock
#define GL_NV_fragment_shader_interlock 1
#endif /* GL_NV_fragment_shader_interlock */
@@ -9858,11 +9999,11 @@ GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, cons
#define GL_COVERAGE_MODULATION_NV 0x9332
#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333
typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v);
typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat *v);
typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v);
typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v);
GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufsize, GLfloat *v);
GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v);
GLAPI void APIENTRY glCoverageModulationNV (GLenum components);
#endif
#endif /* GL_NV_framebuffer_mixed_samples */
@@ -10115,9 +10256,9 @@ GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfN
#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372
#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373
#define GL_CONFORMANT_NV 0x9374
typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint *params);
GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params);
#endif
#endif /* GL_NV_internalformat_sample_query */
@@ -10127,6 +10268,96 @@ GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum interna
#define GL_MAX_SPOT_EXPONENT_NV 0x8505
#endif /* GL_NV_light_max_exponent */
#ifndef GL_NV_memory_attachment
#define GL_NV_memory_attachment 1
#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4
#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5
#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6
#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7
#define GL_MEMORY_ATTACHABLE_NV 0x95A8
#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9
#define GL_DETACHED_TEXTURES_NV 0x95AA
#define GL_DETACHED_BUFFERS_NV 0x95AB
#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC
#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD
typedef void (APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
typedef void (APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname);
typedef void (APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
typedef void (APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
typedef void (APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset);
typedef void (APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
GLAPI void APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname);
GLAPI void APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
GLAPI void APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
GLAPI void APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset);
GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset);
#endif
#endif /* GL_NV_memory_attachment */
#ifndef GL_NV_mesh_shader
#define GL_NV_mesh_shader 1
#define GL_MESH_SHADER_NV 0x9559
#define GL_TASK_SHADER_NV 0x955A
#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60
#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61
#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62
#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63
#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64
#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65
#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66
#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67
#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68
#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69
#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A
#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B
#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C
#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D
#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E
#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F
#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2
#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3
#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536
#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537
#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538
#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539
#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A
#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D
#define GL_MAX_MESH_VIEWS_NV 0x9557
#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF
#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543
#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B
#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C
#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E
#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F
#define GL_MESH_VERTICES_OUT_NV 0x9579
#define GL_MESH_PRIMITIVES_OUT_NV 0x957A
#define GL_MESH_OUTPUT_TYPE_NV 0x957B
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D
#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0
#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1
#define GL_MESH_SHADER_BIT_NV 0x00000040
#define GL_TASK_SHADER_BIT_NV 0x00000080
#define GL_MESH_SUBROUTINE_NV 0x957C
#define GL_TASK_SUBROUTINE_NV 0x957D
#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E
#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count);
typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect);
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count);
GLAPI void APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect);
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#endif
#endif /* GL_NV_mesh_shader */
#ifndef GL_NV_multisample_coverage
#define GL_NV_multisample_coverage 1
#endif /* GL_NV_multisample_coverage */
@@ -10408,7 +10639,7 @@ typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, co
typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode);
@@ -10473,7 +10704,7 @@ GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fo
GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params);
GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs);
GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs);
GLAPI void APIENTRY glPathFogGenNV (GLenum genMode);
@@ -10562,9 +10793,9 @@ GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
#define GL_QUERY_RESOURCE_TEXTURE_NV 0x9545
#define GL_QUERY_RESOURCE_RENDERBUFFER_NV 0x9546
#define GL_QUERY_RESOURCE_BUFFEROBJECT_NV 0x9547
typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer);
typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint count, GLint *buffer);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer);
GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint count, GLint *buffer);
#endif
#endif /* GL_NV_query_resource */
@@ -10672,6 +10903,11 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname,
#endif
#endif /* GL_NV_register_combiners2 */
#ifndef GL_NV_representative_fragment_test
#define GL_NV_representative_fragment_test 1
#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F
#endif /* GL_NV_representative_fragment_test */
#ifndef GL_NV_robustness_video_memory_purge
#define GL_NV_robustness_video_memory_purge 1
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
@@ -10701,6 +10937,18 @@ GLAPI void APIENTRY glResolveDepthValuesNV (void);
#define GL_NV_sample_mask_override_coverage 1
#endif /* GL_NV_sample_mask_override_coverage */
#ifndef GL_NV_scissor_exclusive
#define GL_NV_scissor_exclusive 1
#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555
#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556
typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height);
GLAPI void APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v);
#endif
#endif /* GL_NV_scissor_exclusive */
#ifndef GL_NV_shader_atomic_counters
#define GL_NV_shader_atomic_counters 1
#endif /* GL_NV_shader_atomic_counters */
@@ -10765,6 +11013,15 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_storage_buffer_object 1
#endif /* GL_NV_shader_storage_buffer_object */
#ifndef GL_NV_shader_subgroup_partitioned
#define GL_NV_shader_subgroup_partitioned 1
#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100
#endif /* GL_NV_shader_subgroup_partitioned */
#ifndef GL_NV_shader_texture_footprint
#define GL_NV_shader_texture_footprint 1
#endif /* GL_NV_shader_texture_footprint */
#ifndef GL_NV_shader_thread_group
#define GL_NV_shader_thread_group 1
#define GL_WARP_SIZE_NV 0x9339
@@ -10776,6 +11033,47 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_thread_shuffle 1
#endif /* GL_NV_shader_thread_shuffle */
#ifndef GL_NV_shading_rate_image
#define GL_NV_shading_rate_image 1
#define GL_SHADING_RATE_IMAGE_NV 0x9563
#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564
#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565
#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566
#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567
#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568
#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569
#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A
#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B
#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C
#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D
#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E
#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F
#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B
#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C
#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D
#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E
#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F
#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE
#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF
#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0
typedef void (APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture);
typedef void (APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate);
typedef void (APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location);
typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize);
typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order);
typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBindShadingRateImageNV (GLuint texture);
GLAPI void APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate);
GLAPI void APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location);
GLAPI void APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize);
GLAPI void APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
GLAPI void APIENTRY glShadingRateSampleOrderNV (GLenum order);
GLAPI void APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations);
#endif
#endif /* GL_NV_shading_rate_image */
#ifndef GL_NV_stereo_view_rendering
#define GL_NV_stereo_view_rendering 1
#endif /* GL_NV_stereo_view_rendering */
@@ -11068,7 +11366,7 @@ typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const
typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
@@ -11079,13 +11377,21 @@ GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSu
GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface);
GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface);
GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access);
GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
#endif
#endif /* GL_NV_vdpau_interop */
#ifndef GL_NV_vdpau_interop2
#define GL_NV_vdpau_interop2 1
typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
#endif
#endif /* GL_NV_vdpau_interop2 */
#ifndef GL_NV_vertex_array_range
#define GL_NV_vertex_array_range 1
#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+290
View File
@@ -0,0 +1,290 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE 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 OR COPYRIGHT HOLDERS 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(KHRONOS_STATIC)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef _WIN64
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */
+1 -1
+40
View File
@@ -0,0 +1,40 @@
/* options.h.in
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* default blank options for autoconf */
#ifndef WOLFSSL_OPTIONS_H
#define WOLFSSL_OPTIONS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* WOLFSSL_OPTIONS_H */
Vendored Submodule
+1
Submodule 3rdparty/flatbuffers added at 9e7e8cbe9f
+3
View File
@@ -27,6 +27,9 @@
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+16 -2
View File
@@ -31,6 +31,9 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
@@ -48,8 +51,8 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>curl\include;curl\lib;wolfssl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_SNI;NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>curl\include;curl\lib;curl_extra;wolfssl;wolfssl\wolfssl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_SNI;NDEBUG;BUILDING_LIBCURL;CURL_STATICLIB;USE_WOLFSSL;USE_IPV6;SIZEOF_LONG=4;SIZEOF_LONG_LONG=8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level4</WarningLevel>
@@ -94,6 +97,7 @@
<ClCompile Include="curl\lib\dict.c" />
<ClCompile Include="curl\lib\doh.c" />
<ClCompile Include="curl\lib\dotdot.c" />
<ClCompile Include="curl\lib\dynbuf.c" />
<ClCompile Include="curl\lib\easy.c" />
<ClCompile Include="curl\lib\escape.c" />
<ClCompile Include="curl\lib\file.c" />
@@ -132,6 +136,7 @@
<ClCompile Include="curl\lib\memdebug.c" />
<ClCompile Include="curl\lib\mime.c" />
<ClCompile Include="curl\lib\mprintf.c" />
<ClCompile Include="curl\lib\mqtt.c" />
<ClCompile Include="curl\lib\multi.c" />
<ClCompile Include="curl\lib\netrc.c" />
<ClCompile Include="curl\lib\non-ascii.c" />
@@ -175,6 +180,7 @@
<ClCompile Include="curl\lib\url.c" />
<ClCompile Include="curl\lib\urlapi.c" />
<ClCompile Include="curl\lib\version.c" />
<ClCompile Include="curl\lib\version_win32.c" />
<ClCompile Include="curl\lib\warnless.c" />
<ClCompile Include="curl\lib\wildcard.c" />
<ClCompile Include="curl\lib\x509asn1.c" />
@@ -192,12 +198,14 @@
<ClCompile Include="curl\lib\vauth\vauth.c" />
<ClCompile Include="curl\lib\vquic\ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\quiche.c" />
<ClCompile Include="curl\lib\vquic\vquic.c" />
<ClCompile Include="curl\lib\vssh\libssh.c" />
<ClCompile Include="curl\lib\vssh\libssh2.c" />
<ClCompile Include="curl\lib\vssh\wolfssh.c" />
<ClCompile Include="curl\lib\vtls\bearssl.c" />
<ClCompile Include="curl\lib\vtls\gskit.c" />
<ClCompile Include="curl\lib\vtls\gtls.c" />
<ClCompile Include="curl\lib\vtls\keylog.c" />
<ClCompile Include="curl\lib\vtls\mbedtls.c" />
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c" />
<ClCompile Include="curl\lib\vtls\mesalink.c" />
@@ -271,6 +279,7 @@
<ClInclude Include="curl\lib\dict.h" />
<ClInclude Include="curl\lib\doh.h" />
<ClInclude Include="curl\lib\dotdot.h" />
<ClInclude Include="curl\lib\dynbuf.h" />
<ClInclude Include="curl\lib\easyif.h" />
<ClInclude Include="curl\lib\escape.h" />
<ClInclude Include="curl\lib\file.h" />
@@ -297,6 +306,7 @@
<ClInclude Include="curl\lib\llist.h" />
<ClInclude Include="curl\lib\memdebug.h" />
<ClInclude Include="curl\lib\mime.h" />
<ClInclude Include="curl\lib\mqtt.h" />
<ClInclude Include="curl\lib\multihandle.h" />
<ClInclude Include="curl\lib\multiif.h" />
<ClInclude Include="curl\lib\netrc.h" />
@@ -316,6 +326,7 @@
<ClInclude Include="curl\lib\setopt.h" />
<ClInclude Include="curl\lib\setup-os400.h" />
<ClInclude Include="curl\lib\setup-vms.h" />
<ClInclude Include="curl\lib\setup-win32.h" />
<ClInclude Include="curl\lib\share.h" />
<ClInclude Include="curl\lib\sigpipe.h" />
<ClInclude Include="curl\lib\slist.h" />
@@ -339,6 +350,7 @@
<ClInclude Include="curl\lib\url.h" />
<ClInclude Include="curl\lib\urlapi-int.h" />
<ClInclude Include="curl\lib\urldata.h" />
<ClInclude Include="curl\lib\version_win32.h" />
<ClInclude Include="curl\lib\warnless.h" />
<ClInclude Include="curl\lib\wildcard.h" />
<ClInclude Include="curl\lib\x509asn1.h" />
@@ -347,11 +359,13 @@
<ClInclude Include="curl\lib\vauth\vauth.h" />
<ClInclude Include="curl\lib\vquic\ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic.h" />
<ClInclude Include="curl\lib\vssh\ssh.h" />
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
<ClInclude Include="curl\lib\vtls\bearssl.h" />
<ClInclude Include="curl\lib\vtls\gskit.h" />
<ClInclude Include="curl\lib\vtls\gtls.h" />
<ClInclude Include="curl\lib\vtls\keylog.h" />
<ClInclude Include="curl\lib\vtls\mbedtls.h" />
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h" />
<ClInclude Include="curl\lib\vtls\mesalink.h" />
+4 -1
View File
@@ -28,6 +28,9 @@
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|x64'" Label="PropertySheets">
@@ -97,7 +100,7 @@
<DisableSpecificWarnings>$(DisableSpecificWarnings)</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(ZLibSrcDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>$(TreatWarningAsError)</TreatWarningAsError>
<Optimization>Full</Optimization>
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<Link>
+7 -4
View File
@@ -6,6 +6,7 @@ if (CMAKE_USE_PTHREADS_INIT)
endif()
if (WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
add_compile_definitions(PLATFORM_WINDOWS=1)
set(OS_WINDOWS 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
# Enable MingW support for RC language (for CMake pre-2.8)
@@ -22,9 +23,9 @@ if (WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
endif()
list(APPEND PLATFORM_SRC
poll_windows.c
events_windows.c
windows_usbdk.c
windows_nt_common.c
windows_common.c
windows_winusb.c
threads_windows.c
)
@@ -36,13 +37,14 @@ if (WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
endif()
elseif (APPLE)
# Apple != OSX alone
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
set(OS_DARWIN 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(PLATFORM_SRC
darwin_usb.c
threads_posix.c
poll_posix.c
events_posix.c
)
find_package(IOKit REQUIRED)
@@ -72,6 +74,7 @@ int main()
endif()
elseif (UNIX)
# Unix is for all *NIX systems including OSX
add_compile_definitions(PLATFORM_POSIX=1 HAVE_CLOCK_GETTIME)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(OS_LINUX 1 CACHE INTERNAL "controls config.h macro definition" FORCE)
@@ -79,7 +82,7 @@ elseif (UNIX)
linux_usbfs.c
linux_netlink.c
threads_posix.c
poll_posix.c
events_posix.c
)
list(APPEND LIBUSB_LIBRARIES rt)
+8 -6
View File
@@ -24,6 +24,9 @@
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
@@ -38,8 +41,9 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>libusb\msvc;libusb\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINVER=0x0501;_WIN32_WINNT=0x0501;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINVER=0x0600;_WIN32_WINNT=0x0600;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
</ClCompile>
@@ -61,11 +65,11 @@
<ClCompile Include="libusb\libusb\descriptor.c" />
<ClCompile Include="libusb\libusb\hotplug.c" />
<ClCompile Include="libusb\libusb\io.c" />
<ClCompile Include="libusb\libusb\os\poll_windows.c" />
<ClCompile Include="libusb\libusb\os\events_windows.c" />
<ClCompile Include="libusb\libusb\strerror.c" />
<ClCompile Include="libusb\libusb\sync.c" />
<ClCompile Include="libusb\libusb\os\threads_windows.c" />
<ClCompile Include="libusb\libusb\os\windows_nt_common.c" />
<ClCompile Include="libusb\libusb\os\windows_common.c" />
<ClCompile Include="libusb\libusb\os\windows_usbdk.c" />
<ClCompile Include="libusb\libusb\os\windows_winusb.c" />
</ItemGroup>
@@ -74,13 +78,11 @@
<ClInclude Include="libusb\libusb\hotplug.h" />
<ClInclude Include="libusb\libusb\libusb.h" />
<ClInclude Include="libusb\libusb\libusbi.h" />
<ClInclude Include="libusb\libusb\os\poll_windows.h" />
<ClInclude Include="libusb\libusb\os\events_windows.h" />
<ClInclude Include="libusb\libusb\os\threads_windows.h" />
<ClInclude Include="libusb\libusb\version.h" />
<ClInclude Include="libusb\libusb\version_nano.h" />
<ClInclude Include="libusb\libusb\os\windows_common.h" />
<ClInclude Include="libusb\libusb\os\windows_nt_common.h" />
<ClInclude Include="libusb\libusb\os\windows_nt_shared_types.h" />
<ClInclude Include="libusb\libusb\os\windows_usbdk.h" />
<ClInclude Include="libusb\libusb\os\windows_winusb.h" />
</ItemGroup>
-1
View File
@@ -11,7 +11,6 @@ if(WITH_LLVM)
option(LLVM_INCLUDE_TESTS OFF)
option(LLVM_INCLUDE_TOOLS OFF)
option(LLVM_INCLUDE_UTILS OFF)
option(WITH_POLLY OFF)
option(LLVM_CCACHE_BUILD ON)
set(CXX_FLAGS_OLD ${CMAKE_CXX_FLAGS})
+3
View File
@@ -21,6 +21,9 @@
</PropertyGroup>
<Import Project="$(SolutionDir)\3rdparty\zlib.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+9 -11
View File
@@ -1,11 +1,13 @@
add_library(3rdparty_qt5 INTERFACE)
find_package(Qt5 5.14 CONFIG COMPONENTS Widgets Concurrent)
set(QT_MIN_VER 5.15.2)
find_package(Qt5 ${QT_MIN_VER} CONFIG COMPONENTS Widgets Concurrent)
if(WIN32)
find_package(Qt5 5.14 COMPONENTS WinExtras REQUIRED)
find_package(Qt5 ${QT_MIN_VER} COMPONENTS WinExtras REQUIRED)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::WinExtras Qt5::Concurrent)
else()
find_package(Qt5 5.14 COMPONENTS DBus Gui)
find_package(Qt5 ${QT_MIN_VER} COMPONENTS DBus Gui)
if(Qt5DBus_FOUND)
target_link_libraries(3rdparty_qt5 INTERFACE Qt5::Widgets Qt5::DBus Qt5::Concurrent)
target_compile_definitions(3rdparty_qt5 INTERFACE -DHAVE_QTDBUS)
@@ -16,16 +18,12 @@ else()
endif()
if(NOT Qt5Widgets_FOUND)
if(Qt5Widgets_VERSION VERSION_LESS 5.14.0)
message("Minimum supported Qt5 version is 5.14.0! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
if(Qt5Widgets_VERSION VERSION_LESS ${QT_MIN_VER})
message("Minimum supported Qt5 version is ${QT_MIN_VER}! You have version ${Qt5Widgets_VERSION} installed, please upgrade!")
if(CMAKE_SYSTEM MATCHES "Linux")
message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt.
If you're on Ubuntu or Linux Mint, there are PPAs you can use to install one of the latest qt5 versions.
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.14.1-bionic
https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.14.1-xenial
just make sure to run
source /opt/qt514/bin/qt514-env.sh
before re-running cmake")
Find the correct ppa at https://launchpad.net/~beineri and follow the instructions.")
elseif(WIN32)
message(FATAL_ERROR "You can download the latest version of Qt5 here: https://www.qt.io/download-open-source/")
else()
@@ -35,7 +33,7 @@ before re-running cmake")
message("CMake was unable to find Qt5!")
if(WIN32)
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.14.1\\msvc2017_64\\)
message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\${QT_MIN_VER}\\msvc2019_64\\)
You can also try setting the Qt5_DIR preprocessor definiton.")
elseif(CMAKE_SYSTEM MATCHES "Linux")
message(FATAL_ERROR "Make sure to install your distro's qt5 package!")
+5 -2
View File
@@ -28,6 +28,9 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
@@ -45,7 +48,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_DES_ECB;HAVE_FFDHE_2048;TFM_TIMING_RESISTANT;ECC_TIMING_RESISTANT;WC_RSA_BLINDING;HAVE_AESGCM;WOLFSSL_SHA512;WOLFSSL_SHA384;NO_DSA;HAVE_ECC;TFM_ECC256;ECC_SHAMIR;NO_RC4;NO_HC128;NO_RABBIT;WOLFSSL_SHA224;WOLFSSL_SHA3;WOLFSSL_SHAKE256;HAVE_POLY1305;HAVE_ONE_TIME_AUTH;HAVE_CHACHA;HAVE_HASHDRBG;HAVE_TLS_EXTENSIONS;HAVE_SNI;HAVE_SUPPORTED_CURVES;HAVE_EXTENDED_MASTER;NO_RC4;HAVE_ENCRYPT_THEN_MAC;NO_PSK;NO_MD4;WC_NO_ASYNC_THREADING;OPENSSL_EXTRA;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -59,7 +62,7 @@
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>./wolfssl;./wolfssl/IDE/WIN;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WOLFSSL_LIB;WOLFSSL_DES_ECB;HAVE_FFDHE_2048;TFM_TIMING_RESISTANT;NO_DSA;TFM_ECC256;NO_RC4;NO_HC128;NO_RABBIT;WOLFSSL_SHA224;WOLFSSL_SHA3;WOLFSSL_SHAKE256;HAVE_POLY1305;HAVE_ONE_TIME_AUTH;HAVE_CHACHA;HAVE_HASHDRBG;HAVE_SNI;HAVE_ENCRYPT_THEN_MAC;NO_MD4;WC_NO_ASYNC_THREADING;WOLFSSL_USER_SETTINGS;CYASSL_USER_SETTINGS;WC_NO_HARDEN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
+7 -1
View File
@@ -27,6 +27,9 @@
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
@@ -41,7 +44,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="xxHash/xxhash.c" />
+4
View File
@@ -22,6 +22,9 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
@@ -40,6 +43,7 @@
<ItemDefinitionGroup>
<ClCompile>
<ExceptionHandling>Sync</ExceptionHandling>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
+4 -1
View File
@@ -31,6 +31,9 @@
<Import Project="$(SolutionDir)\3rdparty\zlib.props" />
<Import Project="..\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="..\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
@@ -79,7 +82,7 @@
<ClCompile>
<WarningLevel>$(WarningLevel)</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Full</Optimization>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>true</WholeProgramOptimization>
<BufferSecurityCheck>false</BufferSecurityCheck>
+15 -15
View File
@@ -9,19 +9,19 @@ Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Bu
* [CMake 3.14.1+](https://www.cmake.org/download/) (add to PATH)
* [Python 3.3+](https://www.python.org/downloads/) (add to PATH)
* [Qt 5.14+](https://www.qt.io/download-qt-installer)
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
* [Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community)
* [Vulkan SDK 1.1.126+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html))
**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\5.14.1\msvc2017_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools-19123)**
**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\5.15.2\msvc2019_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)**
### Linux
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager.
* Clang 9+ or GCC 9+
* Clang 11+ or GCC 9+
* [CMake 3.14.1+](https://www.cmake.org/download/)
* [Qt 5.14+](https://www.qt.io/download-qt-installer)
* [Qt 5.15.2](https://www.qt.io/download-qt-installer)
* [Vulkan SDK 1.1.126+](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html))
* [SDL2](https://www.libsdl.org/download-2.0.php) (for the FAudio backend)
@@ -40,11 +40,11 @@ Ubuntu is usually horrendously out of date, and some packages need to be downloa
Ubuntu usually does not have a new enough Qt package to suit rpcs3's needs. There is a PPA available to work around this. Run the following:
```
ucodename=$(lsb_release -sc)
sudo add-apt-repository ppa:beineri/opt-qt-5.14.1-$ucodename
. /etc/os-release
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-$UBUNTU_CODENAME
sudo apt-get update
. /opt/qt514/bin/qt514-env.sh >/dev/null 2>&1
sudo apt-get install qt514-meta-minimal qt514svg
sudo apt-get install qt515-meta-minimal qt515svg
. /opt/qt515/bin/qt515-env.sh >/dev/null 2>&1
```
##### GCC 9.x installation
@@ -62,27 +62,27 @@ You can either use `update-alternatives` to setup `gcc-9`/`g++-9` as your defaul
For Ubuntu systems, it is strongly recommended to use the PPA from [LunarG](https://packages.lunarg.com/) which will provide a compatible Vulkan SDK to compile RPCS3. If your Vulkan SDK is older, it can lead to compilation errors.
```
ucodename=$(lsb_release -sc)
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.1.126-$ucodename.list http://packages.lunarg.com/vulkan/1.1.126/lunarg-vulkan-1.1.126-$ucodename.list
. /etc/os-release
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.2.148-$UBUNTU_CODENAME.list https://packages.lunarg.com/vulkan/1.2.148/lunarg-vulkan-1.2.148-$UBUNTU_CODENAME.list
sudo apt update
sudo apt install vulkan-sdk
```
##### CMake
```
. /etc/os-release
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -sc) main"
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main"
sudo apt-get update
sudo apt-get install kitware-archive-keyring
sudo apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA
sudo apt-get install cmake
```
#### Fedora
sudo dnf install alsa-lib-devel cmake glew glew-devel libatomic libevdev-devel libudev-devel openal-devel qt5-devel vulkan-devel
sudo dnf install alsa-lib-devel cmake glew glew-devel libatomic libevdev-devel libudev-devel openal-devel qt5-devel qt5-qtbase-private-devel vulkan-devel
#### OpenSUSE
@@ -103,7 +103,7 @@ git submodule update --init
#### Configuring the Qt plugin (if used)
1) Go to the Qt5 menu and edit Qt5 options.
2) Add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\5.14.1\msvc2017_64`.
2) Add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\5.15.2\msvc2019_64`.
3) While selecting the rpcs3qt project, go to Qt5->Project Setting and select the version you added.
#### Building the projects
+4 -4
View File
@@ -7,8 +7,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
message(FATAL_ERROR "RPCS3 requires at least gcc-9.")
endif()
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
message(FATAL_ERROR "RPCS3 requires at least clang-9.0.")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0)
message(FATAL_ERROR "RPCS3 requires at least clang-11.0.")
endif()
endif()
@@ -22,7 +22,7 @@ option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" ON)
option(USE_SYSTEM_ZLIB "Prefer system ZLIB instead of the builtin one" ON)
option(USE_VULKAN "Vulkan render backend" ON)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
option(USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/rpcs3/cmake_modules")
@@ -64,7 +64,7 @@ set(CMAKE_C_FLAGS -w)
set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "")
if(MSVC)
add_compile_options(/wd4530) # C++ exception handler used, but unwind semantics are not enabled
add_compile_options(/wd4530 /utf-8) # C++ exception handler used, but unwind semantics are not enabled
endif()
add_subdirectory(Vulkan EXCLUDE_FROM_ALL)
+3 -2
View File
@@ -1,8 +1,9 @@
RPCS3
=====
[![Build Status](https://travis-ci.org/RPCS3/rpcs3.svg?branch=master)](https://travis-ci.org/RPCS3/rpcs3)
[![Build Status](https://dev.azure.com/nekotekina/nekotekina/_apis/build/status/RPCS3.rpcs3?branchName=master)](https://dev.azure.com/nekotekina/nekotekina/_build/latest?definitionId=4&branchName=master)
[![Azure Build Status](https://dev.azure.com/nekotekina/nekotekina/_apis/build/status/RPCS3.rpcs3?branchName=master)](https://dev.azure.com/nekotekina/nekotekina/_build?definitionId=4&branchName=master)
[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/RPCS3/rpcs3?label=Cirrus%20CI%20(FreeBSD)&logo=cirrus-ci)](https://cirrus-ci.com/github/RPCS3/rpcs3)
[![RPCS3 discord server](https://img.shields.io/discord/272035812277878785?color=%237289DA&label=RPCS3%20Discord&logo=discord&logoColor=white)](https://discord.me/rpcs3)
The world's first free and open-source PlayStation 3 emulator/debugger, written in C++ for Windows and Linux.
-467
View File
@@ -1,467 +0,0 @@
#pragma once
#include "types.h"
#include "util/endian.hpp"
#include <cstring>
#if __has_include(<bit>)
#include <bit>
#else
#include <type_traits>
#endif
// 128-bit vector type and also se_storage<> storage type
union alignas(16) v128
{
char _bytes[16];
template <typename T, std::size_t N, std::size_t M>
struct masked_array_t // array type accessed as (index ^ M)
{
char m_data[16];
public:
T& operator[](std::size_t index)
{
return reinterpret_cast<T*>(m_data)[index ^ M];
}
const T& operator[](std::size_t index) const
{
return reinterpret_cast<const T*>(m_data)[index ^ M];
}
};
template <typename T, std::size_t N = 16 / sizeof(T)>
using normal_array_t = masked_array_t<T, N, std::endian::little == std::endian::native ? 0 : N - 1>;
template <typename T, std::size_t N = 16 / sizeof(T)>
using reversed_array_t = masked_array_t<T, N, std::endian::little == std::endian::native ? N - 1 : 0>;
normal_array_t<u64> _u64;
normal_array_t<s64> _s64;
reversed_array_t<u64> u64r;
reversed_array_t<s64> s64r;
normal_array_t<u32> _u32;
normal_array_t<s32> _s32;
reversed_array_t<u32> u32r;
reversed_array_t<s32> s32r;
normal_array_t<u16> _u16;
normal_array_t<s16> _s16;
reversed_array_t<u16> u16r;
reversed_array_t<s16> s16r;
normal_array_t<u8> _u8;
normal_array_t<s8> _s8;
reversed_array_t<u8> u8r;
reversed_array_t<s8> s8r;
normal_array_t<f32> _f;
normal_array_t<f64> _d;
reversed_array_t<f32> fr;
reversed_array_t<f64> dr;
__m128 vf;
__m128i vi;
__m128d vd;
struct bit_array_128
{
char m_data[16];
public:
class bit_element
{
u64& data;
const u64 mask;
public:
bit_element(u64& data, const u64 mask)
: data(data)
, mask(mask)
{
}
operator bool() const
{
return (data & mask) != 0;
}
bit_element& operator=(const bool right)
{
if (right)
{
data |= mask;
}
else
{
data &= ~mask;
}
return *this;
}
bit_element& operator=(const bit_element& right)
{
if (right)
{
data |= mask;
}
else
{
data &= ~mask;
}
return *this;
}
};
// Index 0 returns the MSB and index 127 returns the LSB
bit_element operator[](u32 index)
{
const auto data_ptr = reinterpret_cast<u64*>(m_data);
if constexpr (std::endian::little == std::endian::native)
{
return bit_element(data_ptr[1 - (index >> 6)], 0x8000000000000000ull >> (index & 0x3F));
}
else
{
return bit_element(data_ptr[index >> 6], 0x8000000000000000ull >> (index & 0x3F));
}
}
// Index 0 returns the MSB and index 127 returns the LSB
bool operator[](u32 index) const
{
const auto data_ptr = reinterpret_cast<const u64*>(m_data);
if constexpr (std::endian::little == std::endian::native)
{
return (data_ptr[1 - (index >> 6)] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
}
else
{
return (data_ptr[index >> 6] & (0x8000000000000000ull >> (index & 0x3F))) != 0;
}
}
} _bit;
static v128 from64(u64 _0, u64 _1 = 0)
{
v128 ret;
ret._u64[0] = _0;
ret._u64[1] = _1;
return ret;
}
static v128 from64r(u64 _1, u64 _0 = 0)
{
return from64(_0, _1);
}
static v128 from32(u32 _0, u32 _1 = 0, u32 _2 = 0, u32 _3 = 0)
{
v128 ret;
ret._u32[0] = _0;
ret._u32[1] = _1;
ret._u32[2] = _2;
ret._u32[3] = _3;
return ret;
}
static v128 from32r(u32 _3, u32 _2 = 0, u32 _1 = 0, u32 _0 = 0)
{
return from32(_0, _1, _2, _3);
}
static v128 from32p(u32 value)
{
v128 ret;
ret.vi = _mm_set1_epi32(static_cast<s32>(value));
return ret;
}
static v128 from16p(u16 value)
{
v128 ret;
ret.vi = _mm_set1_epi16(static_cast<s16>(value));
return ret;
}
static v128 from8p(u8 value)
{
v128 ret;
ret.vi = _mm_set1_epi8(static_cast<s8>(value));
return ret;
}
static v128 fromBit(u32 bit)
{
v128 ret = {};
ret._bit[bit] = true;
return ret;
}
static v128 fromV(__m128i value)
{
v128 ret;
ret.vi = value;
return ret;
}
static v128 fromF(__m128 value)
{
v128 ret;
ret.vf = value;
return ret;
}
static v128 fromD(__m128d value)
{
v128 ret;
ret.vd = value;
return ret;
}
// Unaligned load with optional index offset
static v128 loadu(const void* ptr, std::size_t index = 0)
{
v128 ret;
std::memcpy(&ret, static_cast<const u8*>(ptr) + index * sizeof(v128), sizeof(v128));
return ret;
}
// Unaligned store with optional index offset
static void storeu(v128 value, void* ptr, std::size_t index = 0)
{
std::memcpy(static_cast<u8*>(ptr) + index * sizeof(v128), &value, sizeof(v128));
}
static inline v128 add8(const v128& left, const v128& right)
{
return fromV(_mm_add_epi8(left.vi, right.vi));
}
static inline v128 add16(const v128& left, const v128& right)
{
return fromV(_mm_add_epi16(left.vi, right.vi));
}
static inline v128 add32(const v128& left, const v128& right)
{
return fromV(_mm_add_epi32(left.vi, right.vi));
}
static inline v128 addfs(const v128& left, const v128& right)
{
return fromF(_mm_add_ps(left.vf, right.vf));
}
static inline v128 addfd(const v128& left, const v128& right)
{
return fromD(_mm_add_pd(left.vd, right.vd));
}
static inline v128 sub8(const v128& left, const v128& right)
{
return fromV(_mm_sub_epi8(left.vi, right.vi));
}
static inline v128 sub16(const v128& left, const v128& right)
{
return fromV(_mm_sub_epi16(left.vi, right.vi));
}
static inline v128 sub32(const v128& left, const v128& right)
{
return fromV(_mm_sub_epi32(left.vi, right.vi));
}
static inline v128 subfs(const v128& left, const v128& right)
{
return fromF(_mm_sub_ps(left.vf, right.vf));
}
static inline v128 subfd(const v128& left, const v128& right)
{
return fromD(_mm_sub_pd(left.vd, right.vd));
}
static inline v128 maxu8(const v128& left, const v128& right)
{
return fromV(_mm_max_epu8(left.vi, right.vi));
}
static inline v128 minu8(const v128& left, const v128& right)
{
return fromV(_mm_min_epu8(left.vi, right.vi));
}
static inline v128 eq8(const v128& left, const v128& right)
{
return fromV(_mm_cmpeq_epi8(left.vi, right.vi));
}
static inline v128 eq16(const v128& left, const v128& right)
{
return fromV(_mm_cmpeq_epi16(left.vi, right.vi));
}
static inline v128 eq32(const v128& left, const v128& right)
{
return fromV(_mm_cmpeq_epi32(left.vi, right.vi));
}
bool operator==(const v128& right) const
{
return _u64[0] == right._u64[0] && _u64[1] == right._u64[1];
}
bool operator!=(const v128& right) const
{
return _u64[0] != right._u64[0] || _u64[1] != right._u64[1];
}
// result = (~left) & (right)
static inline v128 andnot(const v128& left, const v128& right)
{
return fromV(_mm_andnot_si128(left.vi, right.vi));
}
void clear()
{
_u64[0] = 0;
_u64[1] = 0;
}
};
template <typename T, std::size_t N, std::size_t M>
struct offset32_array<v128::masked_array_t<T, N, M>>
{
template <typename Arg>
static inline u32 index32(const Arg& arg)
{
return u32{sizeof(T)} * (static_cast<u32>(arg) ^ static_cast<u32>(M));
}
};
inline v128 operator|(const v128& left, const v128& right)
{
return v128::fromV(_mm_or_si128(left.vi, right.vi));
}
inline v128 operator&(const v128& left, const v128& right)
{
return v128::fromV(_mm_and_si128(left.vi, right.vi));
}
inline v128 operator^(const v128& left, const v128& right)
{
return v128::fromV(_mm_xor_si128(left.vi, right.vi));
}
inline v128 operator~(const v128& other)
{
return v128::from64(~other._u64[0], ~other._u64[1]);
}
using stx::se_t;
using stx::se_storage;
// se_t<> with native endianness
template <typename T, std::size_t Align = alignof(T)>
using nse_t = se_t<T, false, Align>;
template <typename T, std::size_t Align = alignof(T)>
using be_t = se_t<T, std::endian::little == std::endian::native, Align>;
template <typename T, std::size_t Align = alignof(T)>
using le_t = se_t<T, std::endian::big == std::endian::native, Align>;
// Type converter: converts native endianness arithmetic/enum types to appropriate se_t<> type
template <typename T, bool Se, typename = void>
struct to_se
{
template <typename T2, typename = void>
struct to_se_
{
using type = T2;
};
template <typename T2>
struct to_se_<T2, std::enable_if_t<std::is_arithmetic<T2>::value || std::is_enum<T2>::value>>
{
using type = std::conditional_t<(sizeof(T2) > 1), se_t<T2, Se>, T2>;
};
// Convert arithmetic and enum types
using type = typename to_se_<T>::type;
};
template <bool Se>
struct to_se<v128, Se>
{
using type = se_t<v128, Se>;
};
template <bool Se>
struct to_se<u128, Se>
{
using type = se_t<u128, Se>;
};
template <bool Se>
struct to_se<s128, Se>
{
using type = se_t<s128, Se>;
};
template <typename T, bool Se>
struct to_se<const T, Se, std::enable_if_t<!std::is_array<T>::value>>
{
// Move const qualifier
using type = const typename to_se<T, Se>::type;
};
template <typename T, bool Se>
struct to_se<volatile T, Se, std::enable_if_t<!std::is_array<T>::value && !std::is_const<T>::value>>
{
// Move volatile qualifier
using type = volatile typename to_se<T, Se>::type;
};
template <typename T, bool Se>
struct to_se<T[], Se>
{
// Move array qualifier
using type = typename to_se<T, Se>::type[];
};
template <typename T, bool Se, std::size_t N>
struct to_se<T[N], Se>
{
// Move array qualifier
using type = typename to_se<T, Se>::type[N];
};
// BE/LE aliases for to_se<>
template <typename T>
using to_be_t = typename to_se<T, std::endian::little == std::endian::native>::type;
template <typename T>
using to_le_t = typename to_se<T, std::endian::big == std::endian::native>::type;
// BE/LE aliases for atomic_t
template <typename T>
using atomic_be_t = atomic_t<be_t<T>>;
template <typename T>
using atomic_le_t = atomic_t<le_t<T>>;
template <typename T, bool Se, std::size_t Align>
struct fmt_unveil<se_t<T, Se, Align>, void>
{
using type = typename fmt_unveil<T>::type;
static inline auto get(const se_t<T, Se, Align>& arg)
{
return fmt_unveil<T>::get(arg);
}
};
+4 -3
View File
@@ -1,6 +1,7 @@
#pragma once
#pragma once
#include "types.h"
#include "util/types.hpp"
#include "Utilities/StrFmt.h"
template<typename T, uint N>
struct bf_base
@@ -147,7 +148,7 @@ struct bf_t : bf_base<T, N>
bf_t& operator &=(vtype right)
{
this->m_data &= static_cast<vtype>((static_cast<utype>(right) & bf_t::vmask) << bitpos);
this->m_data &= static_cast<vtype>(((static_cast<utype>(right) & bf_t::vmask) << bitpos) | ~(bf_t::vmask << bitpos));
return *this;
}
+3 -3
View File
@@ -1,6 +1,6 @@
#pragma once
#include <Utilities/types.h>
#include "util/types.hpp"
#ifdef _WIN32
#include "windows.h"
@@ -176,7 +176,7 @@ public:
};
u_int miblen = std::size(mib);
struct kinfo_proc info;
size_t size = sizeof(info);
usz size = sizeof(info);
if (sysctl(mib, miblen, &info, &size, NULL, 0))
{
return 0;
@@ -194,7 +194,7 @@ public:
u_int miblen = std::size(mib);
// get number of structs
size_t size;
usz size;
if (sysctl(mib, miblen, NULL, &size, NULL, 0))
{
return 0;
+21 -14
View File
@@ -1,14 +1,12 @@
#include "stdafx.h"
#include "stdafx.h"
#include "Config.h"
#include "Utilities/types.h"
#include "util/types.hpp"
#include "util/yaml.hpp"
#include <typeinfo>
#include <charconv>
[[noreturn]] void report_fatal_error(const std::string&);
LOG_CHANNEL(cfg_log, "CFG");
namespace cfg
@@ -18,7 +16,7 @@ namespace cfg
{
if (_type != type::node)
{
cfg_log.fatal("Invalid root node" HERE);
cfg_log.fatal("Invalid root node");
}
}
@@ -29,7 +27,7 @@ namespace cfg
{
if (pair.first == name)
{
cfg_log.fatal("Node already exists: %s" HERE, name);
cfg_log.fatal("Node already exists: %s", name);
}
}
@@ -38,12 +36,12 @@ namespace cfg
bool _base::from_string(const std::string&, bool)
{
report_fatal_error("from_string() purecall" HERE);
fmt::throw_exception("from_string() purecall");
}
bool _base::from_list(std::vector<std::string>&&)
{
report_fatal_error("from_list() purecall" HERE);
fmt::throw_exception("from_list() purecall");
}
// Emit YAML
@@ -65,6 +63,13 @@ bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
const char* start = &value.front();
const char* end = &value.back() + 1;
int base = 10;
int sign = +1;
if (start[0] == '-')
{
sign = -1;
start += 1;
}
if (start[0] == '0' && (start[1] == 'x' || start[1] == 'X'))
{
@@ -75,15 +80,17 @@ bool cfg::try_to_int64(s64* out, const std::string& value, s64 min, s64 max)
const auto ret = std::from_chars(start, end, result, base);
if (ret.ec != std::errc() || ret.ptr != end)
if (ret.ec != std::errc() || ret.ptr != end || (start[0] == '-' && sign < 0))
{
if (out) cfg_log.error("cfg::try_to_int('%s'): invalid integer", value);
if (out) cfg_log.error("cfg::try_to_int64('%s'): invalid integer", value);
return false;
}
result *= sign;
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): out of bounds (%d..%d)", value, min, max);
if (out) cfg_log.error("cfg::try_to_int64('%s'): out of bounds (%d..%d)", value, min, max);
return false;
}
@@ -114,13 +121,13 @@ bool cfg::try_to_uint64(u64* out, const std::string& value, u64 min, u64 max)
if (ret.ec != std::errc() || ret.ptr != end)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): invalid integer", value);
if (out) cfg_log.error("cfg::try_to_uint64('%s'): invalid integer", value);
return false;
}
if (result < min || result > max)
{
if (out) cfg_log.error("cfg::try_to_int('%s'): out of bounds (%u..%u)", value, min, max);
if (out) cfg_log.error("cfg::try_to_uint64('%s'): out of bounds (%u..%u)", value, min, max);
return false;
}
@@ -371,7 +378,7 @@ void cfg::_bool::from_default()
void cfg::string::from_default()
{
m_value = m_value.make(def);
m_value = def;
}
void cfg::set_entry::from_default()
+13 -8
View File
@@ -1,10 +1,10 @@
#pragma once
#pragma once
#include "Utilities/types.h"
#include "util/types.hpp"
#include "Utilities/StrFmt.h"
#include "util/logs.hpp"
#include "util/atomic.hpp"
#include "util/shared_cptr.hpp"
#include "util/shared_ptr.hpp"
#include <utility>
#include <string>
@@ -203,6 +203,11 @@ namespace cfg
return m_value;
}
void set(T value)
{
m_value = value;
}
void from_default() override
{
m_value = def;
@@ -384,11 +389,11 @@ namespace cfg
using uint64 = uint<0, UINT64_MAX>;
// Simple string entry with mutex
class string final : public _base
class string : public _base
{
const std::string m_name;
stx::atomic_cptr<std::string> m_value;
atomic_ptr<std::string> m_value;
public:
std::string def;
@@ -396,7 +401,7 @@ namespace cfg
string(node* owner, std::string name, std::string def = {}, bool dynamic = false)
: _base(type::string, owner, name, dynamic)
, m_name(std::move(name))
, m_value(m_value.make(def))
, m_value(def)
, def(std::move(def))
{
}
@@ -406,7 +411,7 @@ namespace cfg
return *m_value.load().get();
}
std::pair<const std::string&, stx::shared_cptr<std::string>> get() const
std::pair<const std::string&, shared_ptr<std::string>> get() const
{
auto v = m_value.load();
@@ -435,7 +440,7 @@ namespace cfg
bool from_string(const std::string& value, bool /*dynamic*/ = false) override
{
m_value = m_value.make(value);
m_value = value;
return true;
}
};
+237 -161
View File
@@ -1,7 +1,6 @@
#include "File.h"
#include "File.h"
#include "mutex.h"
#include "StrFmt.h"
#include "BEType.h"
#include "Crypto/sha1.h"
#include <unordered_map>
@@ -11,6 +10,8 @@
#include <typeinfo>
#include <map>
#include "util/asm.hpp"
using namespace std::literals::string_literals;
#ifdef _WIN32
@@ -21,10 +22,10 @@ using namespace std::literals::string_literals;
static std::unique_ptr<wchar_t[]> to_wchar(const std::string& source)
{
// String size + null terminator
const std::size_t buf_size = source.size() + 1;
const usz buf_size = source.size() + 1;
// Safe size
const int size = narrow<int>(buf_size, "to_wchar" HERE);
const int size = narrow<int>(buf_size);
// Buffer for max possible output length
std::unique_ptr<wchar_t[]> buffer(new wchar_t[buf_size + 8 + 32768]);
@@ -41,10 +42,10 @@ static std::unique_ptr<wchar_t[]> to_wchar(const std::string& source)
std::memcpy(buffer.get() + 32768 + 4, L"UNC\\", 4 * sizeof(wchar_t));
}
verify("to_wchar" HERE), MultiByteToWideChar(CP_UTF8, 0, source.c_str(), size, buffer.get() + 32768 + (unc ? 8 : 4), size);
ensure(MultiByteToWideChar(CP_UTF8, 0, source.c_str(), size, buffer.get() + 32768 + (unc ? 8 : 4), size)); // "to_wchar"
// Canonicalize wide path (replace '/', ".", "..", \\ repetitions, etc)
verify("to_wchar" HERE), GetFullPathNameW(buffer.get() + 32768, 32768, buffer.get(), nullptr) - 1 < 32768 - 1;
ensure(GetFullPathNameW(buffer.get() + 32768, 32768, buffer.get(), nullptr) - 1 < 32768 - 1); // "to_wchar"
return buffer;
}
@@ -52,10 +53,10 @@ static std::unique_ptr<wchar_t[]> to_wchar(const std::string& source)
static void to_utf8(std::string& out, const wchar_t* source)
{
// String size
const std::size_t length = std::wcslen(source);
const usz length = std::wcslen(source);
// Safe buffer size for max possible output length (including null terminator)
const int buf_size = narrow<int>(length * 3 + 1, "to_utf8" HERE);
const int buf_size = narrow<int>(length * 3 + 1);
// Resize buffer
out.resize(buf_size - 1);
@@ -63,7 +64,7 @@ static void to_utf8(std::string& out, const wchar_t* source)
const int result = WideCharToMultiByte(CP_UTF8, 0, source, static_cast<int>(length) + 1, &out.front(), buf_size, NULL, NULL);
// Fix the size
out.resize(verify("to_utf8" HERE, result) - 1);
out.resize(ensure(result) - 1);
}
static time_t to_time(const ULARGE_INTEGER& ft)
@@ -129,6 +130,7 @@ static fs::error to_error(DWORD e)
case ERROR_DIR_NOT_EMPTY: return fs::error::notempty;
case ERROR_NOT_READY: return fs::error::noent;
case ERROR_FILENAME_EXCED_RANGE: return fs::error::toolong;
case ERROR_DISK_FULL: return fs::error::nospace;
default: return fs::error::unknown;
}
}
@@ -170,6 +172,7 @@ static fs::error to_error(int e)
case ENOTEMPTY: return fs::error::notempty;
case EROFS: return fs::error::readonly;
case EISDIR: return fs::error::isdir;
case ENOSPC: return fs::error::nospace;
default: return fs::error::unknown;
}
}
@@ -180,7 +183,7 @@ static std::string path_append(std::string_view path, std::string_view more)
{
std::string result;
if (const size_t src_slash_pos = path.find_last_not_of('/'); src_slash_pos != path.npos)
if (const usz src_slash_pos = path.find_last_not_of('/'); src_slash_pos != path.npos)
{
path.remove_suffix(path.length() - src_slash_pos - 1);
result = path;
@@ -188,7 +191,7 @@ static std::string path_append(std::string_view path, std::string_view more)
result.push_back('/');
if (const size_t dst_slash_pos = more.find_first_not_of('/'); dst_slash_pos != more.npos)
if (const usz dst_slash_pos = more.find_first_not_of('/'); dst_slash_pos != more.npos)
{
more.remove_prefix(dst_slash_pos);
result.append(more);
@@ -313,33 +316,19 @@ std::shared_ptr<fs::device_base> fs::get_virtual_device(const std::string& path)
std::shared_ptr<fs::device_base> fs::set_virtual_device(const std::string& name, const std::shared_ptr<device_base>& device)
{
verify(HERE), name.starts_with("//"), name[2] != '/';
ensure(name.starts_with("//") && name[2] != '/');
return get_device_manager().set_device(name, device);
}
std::string fs::get_parent_dir(const std::string& path)
{
// Search upper bound (set to the last character, npos for empty string)
auto last = path.size() - 1;
// Get (basically) processed path
const auto real_path = fs::escape_path(path);
#ifdef _WIN32
const auto& delim = "/\\";
#else
const auto& delim = "/";
#endif
const auto pos = real_path.find_last_of(delim);
while (true)
{
const auto pos = path.find_last_of(delim, last, sizeof(delim) - 1);
// Contiguous slashes are ignored at the end
if (std::exchange(last, pos - 1) != pos)
{
// Return empty string if the path doesn't contain at least 2 elements
return path.substr(0, pos != umax && path.find_last_not_of(delim, pos, sizeof(delim) - 1) != umax ? pos : 0);
}
}
return real_path.substr(0, pos == umax ? 0 : pos);
}
bool fs::stat(const std::string& path, stat_t& info)
@@ -350,16 +339,83 @@ bool fs::stat(const std::string& path, stat_t& info)
}
#ifdef _WIN32
WIN32_FILE_ATTRIBUTE_DATA attrs;
if (!GetFileAttributesExW(to_wchar(path).get(), GetFileExInfoStandard, &attrs))
std::string_view epath = path;
// '/' and '\\' Not allowed by FindFirstFileExW at the end of path but we should allow it
if (auto not_del = epath.find_last_not_of(delim); not_del != umax && not_del != epath.size() - 1)
{
epath.remove_suffix(epath.size() - 1 - not_del);
}
// Handle drives specially
if (epath.find_first_of(delim) == umax && epath.ends_with(':'))
{
WIN32_FILE_ATTRIBUTE_DATA attrs;
// Must end with a delimiter
if (!GetFileAttributesExW(to_wchar(std::string(epath) + '/').get(), GetFileExInfoStandard, &attrs))
{
g_tls_error = to_error(GetLastError());
return false;
}
info.is_directory = true; // Handle drives as directories
info.is_writable = (attrs.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
info.size = attrs.nFileSizeLow | (u64{attrs.nFileSizeHigh} << 32);
info.atime = to_time(attrs.ftLastAccessTime);
info.mtime = to_time(attrs.ftLastWriteTime);
info.ctime = info.mtime;
if (info.atime < info.mtime)
info.atime = info.mtime;
return true;
}
WIN32_FIND_DATA attrs;
// Allowed by FindFirstFileExW but we should not allow it
if (epath.ends_with("*"))
{
g_tls_error = fs::error::noent;
return false;
}
const auto wchar_ptr = to_wchar(std::string(epath));
const std::wstring_view wpath_view = wchar_ptr.get();
const HANDLE handle = FindFirstFileExW(wpath_view.data(), FindExInfoStandard, &attrs, FindExSearchNameMatch, nullptr, FIND_FIRST_EX_CASE_SENSITIVE);
if (handle == INVALID_HANDLE_VALUE)
{
g_tls_error = to_error(GetLastError());
return false;
}
struct close_t
{
HANDLE handle;
~close_t() { FindClose(handle); }
};
for (close_t find_manage{handle}; attrs.cFileName != wpath_view.substr(wpath_view.find_last_of(wdelim) + 1);)
{
if (!FindNextFileW(handle, &attrs))
{
if (const DWORD err = GetLastError(); err != ERROR_NO_MORE_FILES)
{
g_tls_error = to_error(err);
return false;
}
g_tls_error = fs::error::noent;
return false;
}
}
info.is_directory = (attrs.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
info.is_writable = (attrs.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
info.size = (u64)attrs.nFileSizeLow | ((u64)attrs.nFileSizeHigh << 32);
info.size = attrs.nFileSizeLow | (u64{attrs.nFileSizeHigh} << 32);
info.atime = to_time(attrs.ftLastAccessTime);
info.mtime = to_time(attrs.ftLastWriteTime);
info.ctime = info.mtime;
@@ -387,73 +443,19 @@ bool fs::stat(const std::string& path, stat_t& info)
bool fs::exists(const std::string& path)
{
if (auto device = get_virtual_device(path))
{
stat_t info;
return device->stat(path, info);
}
#ifdef _WIN32
if (GetFileAttributesW(to_wchar(path).get()) == INVALID_FILE_ATTRIBUTES)
{
g_tls_error = to_error(GetLastError());
return false;
}
return true;
#else
struct ::stat file_info;
if (::stat(path.c_str(), &file_info) != 0)
{
g_tls_error = to_error(errno);
return false;
}
return true;
#endif
fs::stat_t info{};
return fs::stat(path, info);
}
bool fs::is_file(const std::string& path)
{
if (auto device = get_virtual_device(path))
fs::stat_t info{};
if (!fs::stat(path, info))
{
stat_t info;
if (!device->stat(path, info))
{
return false;
}
if (info.is_directory)
{
g_tls_error = error::exist;
return false;
}
return true;
}
#ifdef _WIN32
const DWORD attrs = GetFileAttributesW(to_wchar(path).get());
if (attrs == INVALID_FILE_ATTRIBUTES)
{
g_tls_error = to_error(GetLastError());
return false;
}
#else
struct ::stat file_info;
if (::stat(path.c_str(), &file_info) != 0)
{
g_tls_error = to_error(errno);
return false;
}
#endif
// TODO: correct file type check
#ifdef _WIN32
if ((attrs & FILE_ATTRIBUTE_DIRECTORY) != 0)
#else
if (S_ISDIR(file_info.st_mode))
#endif
if (info.is_directory)
{
g_tls_error = error::exist;
return false;
@@ -464,44 +466,13 @@ bool fs::is_file(const std::string& path)
bool fs::is_dir(const std::string& path)
{
if (auto device = get_virtual_device(path))
fs::stat_t info{};
if (!fs::stat(path, info))
{
stat_t info;
if (!device->stat(path, info))
{
return false;
}
if (info.is_directory == false)
{
g_tls_error = error::exist;
return false;
}
return true;
}
#ifdef _WIN32
const DWORD attrs = GetFileAttributesW(to_wchar(path).get());
if (attrs == INVALID_FILE_ATTRIBUTES)
{
g_tls_error = to_error(GetLastError());
return false;
}
#else
struct ::stat file_info;
if (::stat(path.c_str(), &file_info) != 0)
{
g_tls_error = to_error(errno);
return false;
}
#endif
#ifdef _WIN32
if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0)
#else
if (!S_ISDIR(file_info.st_mode))
#endif
if (!info.is_directory)
{
g_tls_error = error::exist;
return false;
@@ -536,7 +507,7 @@ bool fs::statfs(const std::string& path, fs::device_stat& info)
// Keep cutting path from right until it's short enough
while (str.size() > 256)
{
if (std::size_t x = str.find_last_of('\\') + 1)
if (usz x = str.find_last_of('\\') + 1)
str.resize(x - 1);
else
break;
@@ -779,7 +750,7 @@ bool fs::copy_file(const std::string& from, const std::string& to, bool overwrit
// sendfile will work with non-socket output (i.e. regular file) on Linux 2.6.33+
off_t bytes_copied = 0;
struct ::stat fileinfo = { 0 };
if (::fstat(input, &fileinfo) || ::sendfile(output, input, &bytes_copied, fileinfo.st_size))
if (::fstat(input, &fileinfo) == -1 || ::sendfile(output, input, &bytes_copied, fileinfo.st_size) == -1)
#else
#error "Native file copy implementation is missing"
#endif
@@ -897,7 +868,7 @@ bool fs::utime(const std::string& path, s64 atime, s64 mtime)
#ifdef _WIN32
// Open the file
const auto handle = CreateFileW(to_wchar(path).get(), FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
const auto handle = CreateFileW(to_wchar(path).get(), FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL, NULL);
if (handle == INVALID_HANDLE_VALUE)
{
g_tls_error = to_error(GetLastError());
@@ -930,14 +901,19 @@ bool fs::utime(const std::string& path, s64 atime, s64 mtime)
#endif
}
void fs::file::xnull() const
[[noreturn]] void fs::xnull(const src_loc& loc)
{
fmt::throw_exception("fs::file is null");
fmt::throw_exception("Null object.%s", loc);
}
void fs::file::xfail() const
[[noreturn]] void fs::xfail(const src_loc& loc)
{
fmt::throw_exception("Unexpected fs::error %s", g_tls_error);
fmt::throw_exception("Unexpected fs::error %s%s", g_tls_error, loc);
}
[[noreturn]] void fs::xovfl()
{
fmt::throw_exception("Stream overflow.");
}
fs::file::file(const std::string& path, bs_t<open_mode> mode)
@@ -983,7 +959,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
disp = mode & fs::trunc ? TRUNCATE_EXISTING : OPEN_EXISTING;
}
DWORD share = 0;
DWORD share = FILE_SHARE_DELETE;
if (!(mode & fs::unread) || !(mode & fs::write))
{
share |= FILE_SHARE_READ;
@@ -991,7 +967,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
if (!(mode & (fs::lock + fs::unread)) || !(mode & fs::write))
{
share |= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
share |= FILE_SHARE_WRITE;
}
const HANDLE handle = CreateFileW(to_wchar(path).get(), access, share, NULL, disp, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -1020,7 +996,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
stat_t stat() override
{
FILE_BASIC_INFO basic_info;
verify("file::stat" HERE), GetFileInformationByHandleEx(m_handle, FileBasicInfo, &basic_info, sizeof(FILE_BASIC_INFO));
ensure(GetFileInformationByHandleEx(m_handle, FileBasicInfo, &basic_info, sizeof(FILE_BASIC_INFO))); // "file::stat"
stat_t info;
info.is_directory = (basic_info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
@@ -1038,7 +1014,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
void sync() override
{
verify("file::sync" HERE), FlushFileBuffers(m_handle);
ensure(FlushFileBuffers(m_handle)); // "file::sync"
}
bool trunc(u64 length) override
@@ -1058,10 +1034,10 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 read(void* buffer, u64 count) override
{
// TODO (call ReadFile multiple times if count is too big)
const int size = narrow<int>(count, "file::read" HERE);
const int size = narrow<int>(count);
DWORD nread;
verify("file::read" HERE), ReadFile(m_handle, buffer, size, &nread, NULL);
ensure(ReadFile(m_handle, buffer, size, &nread, NULL)); // "file::read"
return nread;
}
@@ -1069,10 +1045,10 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 write(const void* buffer, u64 count) override
{
// TODO (call WriteFile multiple times if count is too big)
const int size = narrow<int>(count, "file::write" HERE);
const int size = narrow<int>(count);
DWORD nwritten;
verify("file::write" HERE), WriteFile(m_handle, buffer, size, &nwritten, NULL);
ensure(WriteFile(m_handle, buffer, size, &nwritten, NULL)); // "file::write"
return nwritten;
}
@@ -1086,7 +1062,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
whence == seek_set ? FILE_BEGIN :
whence == seek_cur ? FILE_CURRENT :
whence == seek_end ? FILE_END :
(fmt::throw_exception("Invalid whence (0x%x)" HERE, whence), 0);
(fmt::throw_exception("Invalid whence (0x%x)", whence), 0);
if (!SetFilePointerEx(m_handle, pos, &pos, mode))
{
@@ -1100,7 +1076,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 size() override
{
LARGE_INTEGER size;
verify("file::size" HERE), GetFileSizeEx(m_handle, &size);
ensure(GetFileSizeEx(m_handle, &size)); // "file::size"
return size.QuadPart;
}
@@ -1149,7 +1125,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
if (mode & fs::trunc && mode & (fs::lock + fs::unread) && mode & fs::write)
{
// Postpone truncation in order to avoid using O_TRUNC on a locked file
verify(HERE), ::ftruncate(fd, 0) == 0;
ensure(::ftruncate(fd, 0) == 0);
}
class unix_file final : public file_base
@@ -1170,7 +1146,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
stat_t stat() override
{
struct ::stat file_info;
verify("file::stat" HERE), ::fstat(m_fd, &file_info) == 0;
ensure(::fstat(m_fd, &file_info) == 0); // "file::stat"
stat_t info;
info.is_directory = S_ISDIR(file_info.st_mode);
@@ -1188,7 +1164,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
void sync() override
{
verify("file::sync" HERE), ::fsync(m_fd) == 0;
ensure(::fsync(m_fd) == 0); // "file::sync"
}
bool trunc(u64 length) override
@@ -1205,7 +1181,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 read(void* buffer, u64 count) override
{
const auto result = ::read(m_fd, buffer, count);
verify("file::read" HERE), result != -1;
ensure(result != -1); // "file::read"
return result;
}
@@ -1213,7 +1189,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 write(const void* buffer, u64 count) override
{
const auto result = ::write(m_fd, buffer, count);
verify("file::write" HERE), result != -1;
ensure(result != -1); // "file::write"
return result;
}
@@ -1224,7 +1200,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
whence == seek_set ? SEEK_SET :
whence == seek_cur ? SEEK_CUR :
whence == seek_end ? SEEK_END :
(fmt::throw_exception("Invalid whence (0x%x)" HERE, whence), 0);
(fmt::throw_exception("Invalid whence (0x%x)", whence), 0);
const auto result = ::lseek(m_fd, offset, mode);
@@ -1240,7 +1216,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
u64 size() override
{
struct ::stat file_info;
verify("file::size" HERE), ::fstat(m_fd, &file_info) == 0;
ensure(::fstat(m_fd, &file_info) == 0); // "file::size"
return file_info.st_size;
}
@@ -1256,7 +1232,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
static_assert(offsetof(iovec, iov_len) == offsetof(iovec_clone, iov_len), "Weird iovec::iov_len offset");
const auto result = ::writev(m_fd, reinterpret_cast<const iovec*>(buffers), buf_count);
verify("file::write_gather" HERE), result != -1;
ensure(result != -1); // "file::write_gather"
return result;
}
@@ -1266,7 +1242,7 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
#endif
}
fs::file::file(const void* ptr, std::size_t size)
fs::file::file(const void* ptr, usz size)
{
class memory_stream : public file_base
{
@@ -1348,11 +1324,6 @@ fs::native_handle fs::file::get_handle() const
#endif
}
void fs::dir::xnull() const
{
fmt::throw_exception("fs::dir is null");
}
bool fs::dir::open(const std::string& path)
{
if (path.empty())
@@ -1386,7 +1357,7 @@ bool fs::dir::open(const std::string& path)
class windows_dir final : public dir_base
{
std::vector<dir_entry> m_entries;
std::size_t m_pos = 0;
usz m_pos = 0;
void add_entry(const WIN32_FIND_DATAW& found)
{
@@ -1416,7 +1387,7 @@ bool fs::dir::open(const std::string& path)
add_entry(found);
}
verify("dir::read" HERE), ERROR_NO_MORE_FILES == GetLastError();
ensure(ERROR_NO_MORE_FILES == GetLastError()); // "dir::read"
FindClose(handle);
}
@@ -1632,6 +1603,110 @@ bool fs::remove_all(const std::string& path, bool remove_root)
return true;
}
std::string fs::escape_path(std::string_view path)
{
std::string real; real.resize(path.size());
auto get_char = [&](usz& from, usz& to, usz count)
{
std::memcpy(&real[to], &path[from], count);
from += count, to += count;
};
usz i = 0, j = -1, pos_nondelim = 0, after_delim = 0;
if (i < path.size())
{
j = 0;
}
for (; i < path.size();)
{
real[j] = path[i];
#ifdef _Win32
if (real[j] == '\\')
{
real[j] = '/';
}
#endif
// If the current character was preceeded by a delimiter special treatment is required:
// If another deleimiter is encountered, remove it (do not write it to output string)
// Otherwise test if it is a "." or ".." sequence.
if (std::exchange(after_delim, path[i] == delim[0] || path[i] == delim[1]))
{
if (!after_delim)
{
if (real[j] == '.')
{
if (i + 1 == path.size())
{
break;
}
get_char(i, j, 1);
switch (real[j])
{
case '.':
{
bool remove_element = true;
usz k = 1;
for (; k + i != path.size(); k++)
{
switch (path[i + k])
{
case '.': continue;
case delim[0]: case delim[1]: break;
default: remove_element = false; break;
}
}
if (remove_element)
{
if (i == 1u)
{
j = pos_nondelim;
real[j] = '\0';// Ensure termination at this posistion
after_delim = true;
i += k;
continue;
}
}
get_char(i, j, k);
continue;
}
case '/':
{
i++;
after_delim = true;
continue;
}
default: get_char(i, j, 1); continue;
}
}
pos_nondelim = j;
get_char(i, j, 1);
}
else
{
i++;
}
}
else
{
get_char(i, j, 1);
}
}
if (j != umax && (real[j] == delim[0] || real[j] == delim[1])) j--; // Do not include a delmiter at the end
real.resize(j + 1);
return real;
}
u64 fs::get_dir_size(const std::string& path, u64 rounding_alignment)
{
u64 result = 0;
@@ -1640,7 +1715,7 @@ u64 fs::get_dir_size(const std::string& path, u64 rounding_alignment)
if (!root_dir)
{
return static_cast<u64>(umax);
return -1;
}
for (const auto& entry : root_dir)
@@ -1652,7 +1727,7 @@ u64 fs::get_dir_size(const std::string& path, u64 rounding_alignment)
if (!entry.is_directory)
{
result += ::align(entry.size, rounding_alignment);
result += utils::align(entry.size, rounding_alignment);
}
else
{
@@ -1818,6 +1893,7 @@ void fmt_class_string<fs::error>::format(std::string& out, u64 arg)
case fs::error::readonly: return "Read only";
case fs::error::isdir: return "Is a directory";
case fs::error::toolong: return "Path too long";
case fs::error::nospace: return "Not enough space on the device";
case fs::error::unknown: return "Unknown system error";
}
+166 -62
View File
@@ -1,6 +1,6 @@
#pragma once
#pragma once // No BOM and only basic ASCII in this header, or a neko will die
#include "types.h"
#include "util/types.hpp"
#include "bit_set.h"
#include <memory>
@@ -8,12 +8,15 @@
#include <vector>
#include <algorithm>
namespace fs
{
#ifdef _WIN32
static constexpr auto& delim = "/\\";
static constexpr auto& wdelim = L"/\\";
using native_handle = void*;
#else
static constexpr auto& delim = "/";
static constexpr auto& wdelim = L"/";
using native_handle = int;
#endif
@@ -70,7 +73,7 @@ namespace fs
struct iovec_clone
{
const void* iov_base;
std::size_t iov_len;
usz iov_len;
};
// File handle base
@@ -131,6 +134,12 @@ namespace fs
virtual std::unique_ptr<dir_base> open_dir(const std::string& path) = 0;
};
[[noreturn]] void xnull(const src_loc&);
[[noreturn]] void xfail(const src_loc&);
[[noreturn]] void xovfl();
constexpr struct pod_tag_t{} pod_tag;
// Get virtual device for specified path (nullptr for real path)
std::shared_ptr<device_base> get_virtual_device(const std::string& path);
@@ -183,9 +192,6 @@ namespace fs
{
std::unique_ptr<file_base> m_file;
[[noreturn]] void xnull() const;
[[noreturn]] void xfail() const;
public:
// Default constructor
file() = default;
@@ -194,7 +200,7 @@ namespace fs
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
// Open memory for read
explicit file(const void* ptr, std::size_t size);
explicit file(const void* ptr, usz size);
// Open file with specified args (forward to constructor)
template <typename... Args>
@@ -227,144 +233,227 @@ namespace fs
}
// Change file size (possibly appending zero bytes)
bool trunc(u64 length) const
bool trunc(u64 length,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->trunc(length);
}
// Get file information
stat_t stat() const
stat_t stat(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->stat();
}
// Sync file buffers
void sync() const
void sync(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->sync();
}
// Read the data from the file and return the amount of data written in buffer
u64 read(void* buffer, u64 count) const
u64 read(void* buffer, u64 count,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->read(buffer, count);
}
// Write the data to the file and return the amount of data actually written
u64 write(const void* buffer, u64 count) const
u64 write(const void* buffer, u64 count,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->write(buffer, count);
}
// Change current position, returns resulting position
u64 seek(s64 offset, seek_mode whence = seek_set) const
u64 seek(s64 offset, seek_mode whence = seek_set,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->seek(offset, whence);
}
// Get file size
u64 size() const
u64 size(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->size();
}
// Get current position
u64 pos() const
u64 pos(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->seek(0, seek_cur);
}
// Write std::string unconditionally
const file& write(const std::string& str) const
// Write std::basic_string unconditionally
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const std::basic_string<T>& str,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (write(str.data(), str.size()) != str.size()) xfail();
if (write(str.data(), str.size() * sizeof(T), line, col, file, func) != str.size() * sizeof(T)) xfail({line, col, file, func});
return *this;
}
// Write POD unconditionally
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const T& data) const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const T& data,
pod_tag_t = pod_tag,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (write(std::addressof(data), sizeof(T)) != sizeof(T)) xfail();
if (write(std::addressof(data), sizeof(T), line, col, file, func) != sizeof(T)) xfail({line, col, file, func});
return *this;
}
// Write POD std::vector unconditionally
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const std::vector<T>& vec) const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, const file&> write(const std::vector<T>& vec,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (write(vec.data(), vec.size() * sizeof(T)) != vec.size() * sizeof(T)) xfail();
if (write(vec.data(), vec.size() * sizeof(T), line, col, file, func) != vec.size() * sizeof(T)) xfail({line, col, file, func});
return *this;
}
// Read std::string, size must be set by resize() method
bool read(std::string& str) const
// Read std::basic_string, size must be set by resize() method
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::basic_string<T>& str,
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION(),
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN()) const
{
return read(&str[0], str.size()) == str.size();
return read(&str[0], str.size() * sizeof(T), line, col, file, func) == str.size() * sizeof(T);
}
// Read std::string
bool read(std::string& str, std::size_t size) const
// Read std::basic_string
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::basic_string<T>& str, usz size,
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION(),
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN()) const
{
str.resize(size);
return read(&str[0], size) == size;
return read(&str[0], size * sizeof(T), line, col, file, func) == size * sizeof(T);
}
// Read POD, sizeof(T) is used
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(T& data) const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(T& data,
pod_tag_t = pod_tag,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
return read(&data, sizeof(T)) == sizeof(T);
return read(&data, sizeof(T), line, col, file, func) == sizeof(T);
}
// Read POD std::vector, size must be set by resize() method
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec) const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec,
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION(),
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN()) const
{
return read(vec.data(), sizeof(T) * vec.size()) == sizeof(T) * vec.size();
return read(vec.data(), sizeof(T) * vec.size(), line, col, file, func) == sizeof(T) * vec.size();
}
// Read POD std::vector
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec, std::size_t size) const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, bool> read(std::vector<T>& vec, usz size,
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION(),
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN()) const
{
vec.resize(size);
return read(vec.data(), sizeof(T) * size) == sizeof(T) * size;
return read(vec.data(), sizeof(T) * size, line, col, file, func) == sizeof(T) * size;
}
// Read POD (experimental)
template <typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, T> read() const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, T> read(
pod_tag_t = pod_tag,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
T result;
if (!read(result)) xfail();
if (!read(result, pod_tag, line, col, file, func)) xfail({line, col, file, func});
return result;
}
// Read full file to std::string
std::string to_string() const
// Read full file to std::basic_string
template <typename T = char>
std::basic_string<T> to_string(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
std::string result;
result.resize(size());
if (seek(0), !read(result)) xfail();
std::basic_string<T> result;
result.resize(size() / sizeof(T));
if (seek(0), !read(result, file, func, line, col)) xfail({line, col, file, func});
return result;
}
// Read full file to std::vector
template<typename T>
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, std::vector<T>> to_vector() const
std::enable_if_t<std::is_trivially_copyable_v<T> && !std::is_pointer_v<T>, std::vector<T>> to_vector(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
std::vector<T> result;
result.resize(size() / sizeof(T));
if (seek(0), !read(result)) xfail();
if (seek(0), !read(result, file, func, line, col)) xfail({line, col, file, func});
return result;
}
@@ -372,9 +461,13 @@ namespace fs
native_handle get_handle() const;
// Gathered write
u64 write_gather(const iovec_clone* buffers, u64 buf_count) const
u64 write_gather(const iovec_clone* buffers, u64 buf_count,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_file) xnull();
if (!m_file) xnull({line, col, file, func});
return m_file->write_gather(buffers, buf_count);
}
};
@@ -383,8 +476,6 @@ namespace fs
{
std::unique_ptr<dir_base> m_dir;
[[noreturn]] void xnull() const;
public:
dir() = default;
@@ -420,16 +511,24 @@ namespace fs
}
// Get next directory entry
bool read(dir_entry& out) const
bool read(dir_entry& out,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_dir) xnull();
if (!m_dir) xnull({line, col, file, func});
return m_dir->read(out);
}
// Reset to the beginning
void rewind() const
void rewind(
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION()) const
{
if (!m_dir) xnull();
if (!m_dir) xnull({line, col, file, func});
return m_dir->rewind();
}
@@ -498,6 +597,9 @@ namespace fs
// Get common cache directory
const std::string& get_cache_dir();
// Get real path for comparisons (TODO: investigate std::filesystem::path::compare implementation)
std::string escape_path(std::string_view path);
// Delete directory and all its contents recursively
bool remove_all(const std::string& path, bool remove_root = true);
@@ -516,6 +618,7 @@ namespace fs
readonly,
isdir,
toolong,
nospace,
unknown
};
@@ -571,7 +674,7 @@ namespace fs
if (old_size + size < old_size)
{
fmt::raw_error("fs::container_stream<>::write(): overflow");
xovfl();
}
if (pos > old_size)
@@ -627,7 +730,8 @@ namespace fs
template <typename... Args>
bool write_file(const std::string& path, bs_t<fs::open_mode> mode, const Args&... args)
{
if (fs::file f{path, mode})
// Always use write flag, remove read flag
if (fs::file f{path, mode + fs::write - fs::read})
{
// Write args sequentially
(f.write(args), ...);
+163 -637
View File
File diff suppressed because it is too large Load Diff
+70 -24
View File
@@ -41,7 +41,7 @@ struct jit_runtime final : asmjit::HostRuntime
asmjit::Error _release(void* p) noexcept override;
// Allocate memory
static u8* alloc(std::size_t size, uint align, bool exec = true) noexcept;
static u8* alloc(usz size, uint align, bool exec = true) noexcept;
// Should be called at least once after global initialization
static void initialize();
@@ -53,18 +53,77 @@ struct jit_runtime final : asmjit::HostRuntime
namespace asmjit
{
// Should only be used to build global functions
asmjit::JitRuntime& get_global_runtime();
asmjit::Runtime& get_global_runtime();
// Emit xbegin and adjacent loop, return label at xbegin
void build_transaction_enter(X86Assembler& c, Label fallback, const X86Gp& ctr, uint less_than);
// Emit xbegin and adjacent loop, return label at xbegin (don't use xabort please)
template <typename F>
[[nodiscard]] inline asmjit::Label build_transaction_enter(asmjit::X86Assembler& c, asmjit::Label fallback, F func)
{
Label fall = c.newLabel();
Label begin = c.newLabel();
c.jmp(begin);
c.bind(fall);
// Emit xabort
void build_transaction_abort(X86Assembler& c, unsigned char code);
// Don't repeat on zero status (may indicate syscall or interrupt)
c.test(x86::eax, x86::eax);
c.jz(fallback);
// First invoked after failure (can fallback to proceed, or jump anywhere else)
func();
// Other bad statuses are ignored regardless of repeat flag (TODO)
c.align(kAlignCode, 16);
c.bind(begin);
return fall;
// xbegin should be issued manually, allows to add more check before entering transaction
}
// Helper to spill RDX (EDX) register for RDTSC
inline void build_swap_rdx_with(asmjit::X86Assembler& c, std::array<X86Gp, 4>& args, const asmjit::X86Gp& with)
{
#ifdef _WIN32
c.xchg(args[1], with);
args[1] = with;
#else
c.xchg(args[2], with);
args[2] = with;
#endif
}
// Get full RDTSC value into chosen register (clobbers rax/rdx or saves only rax with other target)
inline void build_get_tsc(asmjit::X86Assembler& c, const asmjit::X86Gp& to = asmjit::x86::rax)
{
if (&to != &x86::rax && &to != &x86::rdx)
{
// Swap to save its contents
c.xchg(x86::rax, to);
}
c.rdtsc();
c.shl(x86::rdx, 32);
if (&to == &x86::rax)
{
c.or_(x86::rax, x86::rdx);
}
else if (&to == &x86::rdx)
{
c.or_(x86::rdx, x86::rax);
}
else
{
// Swap back, maybe there is more effective way to do it
c.xchg(x86::rax, to);
c.mov(to.r32(), to.r32());
c.or_(to.r64(), x86::rdx);
}
}
}
// Build runtime function with asmjit::X86Assembler
template <typename FT, typename F>
FT build_function_asm(F&& builder)
inline FT build_function_asm(F&& builder)
{
using namespace asmjit;
@@ -89,6 +148,7 @@ FT build_function_asm(F&& builder)
X86Assembler compiler(&code);
builder(std::ref(compiler), args);
ensure(compiler.getLastError() == 0);
FT result;
@@ -107,10 +167,9 @@ FT build_function_asm(F&& builder)
#include <string_view>
#include <unordered_map>
#include "types.h"
#include "util/types.hpp"
#include "mutex.h"
#include "restore_new.h"
#ifdef _MSC_VER
#pragma warning(push, 0)
#else
@@ -127,7 +186,6 @@ FT build_function_asm(F&& builder)
#else
#pragma GCC diagnostic pop
#endif
#include "define_new_memleakdetect.h"
// Temporary compiler interface
class jit_compiler final
@@ -135,15 +193,9 @@ class jit_compiler final
// Local LLVM context
llvm::LLVMContext m_context;
// JIT Event Listener
std::unique_ptr<struct EventListener> m_jit_el;
// Execution instance
std::unique_ptr<llvm::ExecutionEngine> m_engine;
// Link table
std::unordered_map<std::string, u64> m_link;
// Arch
std::string m_cpu;
@@ -163,10 +215,10 @@ public:
}
// Add module (path to obj cache dir)
void add(std::unique_ptr<llvm::Module> module, const std::string& path);
void add(std::unique_ptr<llvm::Module> _module, const std::string& path);
// Add module (not cached)
void add(std::unique_ptr<llvm::Module> module);
void add(std::unique_ptr<llvm::Module> _module);
// Add object (path to obj file)
void add(const std::string& path);
@@ -182,12 +234,6 @@ public:
// Get CPU info
static std::string cpu(const std::string& _cpu);
// Check JIT purpose
bool is_primary() const
{
return !m_link.empty();
}
};
#endif
+86 -73
View File
@@ -1,8 +1,9 @@
#include "StrFmt.h"
#include "BEType.h"
#include "StrFmt.h"
#include "StrUtil.h"
#include "cfmt.h"
#include "util/endian.hpp"
#include "util/logs.hpp"
#include "util/v128.hpp"
#include <algorithm>
#include <string_view>
@@ -78,14 +79,14 @@ void fmt_class_string<fmt::base57>::format(std::string& out, u64 arg)
static constexpr u8 s_tail[8] = {0, 2, 3, 5, 6, 7, 9, 10};
// Get full output size
const std::size_t out_size = _arg.size / 8 * 11 + s_tail[_arg.size % 8];
const usz out_size = _arg.size / 8 * 11 + s_tail[_arg.size % 8];
out.resize(out.size() + out_size);
const auto ptr = &out.front() + (out.size() - out_size);
// Each 8 bytes of input data produce 11 bytes of base57 output
for (std::size_t i = 0, p = 0; i < _arg.size; i += 8, p += 11)
for (usz i = 0, p = 0; i < _arg.size; i += 8, p += 11)
{
// Load up to 8 bytes
be_t<u64> be_value;
@@ -235,6 +236,12 @@ void fmt_class_string<bool>::format(std::string& out, u64 arg)
out += arg ? "true" : "false";
}
template <>
void fmt_class_string<b8>::format(std::string& out, u64 arg)
{
out += get_object(arg) ? "true" : "false";
}
template <>
void fmt_class_string<v128>::format(std::string& out, u64 arg)
{
@@ -242,70 +249,76 @@ void fmt_class_string<v128>::format(std::string& out, u64 arg)
fmt::append(out, "0x%016llx%016llx", vec._u64[1], vec._u64[0]);
}
template <>
void fmt_class_string<u128>::format(std::string& out, u64 arg)
{
// TODO: it should be supported as full-fledged integral type (with %u, %d, etc, fmt)
const u128& num = get_object(arg);
#ifdef _MSC_VER
fmt::append(out, "0x%016llx%016llx", num.hi, num.lo);
#else
fmt::append(out, "0x%016llx%016llx", static_cast<u64>(num >> 64), static_cast<u64>(num));
#endif
}
template <>
void fmt_class_string<src_loc>::format(std::string& out, u64 arg)
{
const src_loc& loc = get_object(arg);
if (loc.col != umax)
{
fmt::append(out, "\n(in file %s:%u[:%u]", loc.file, loc.line, loc.col);
}
else
{
fmt::append(out, "\n(in file %s:%u", loc.file, loc.line);
}
if (loc.func && *loc.func)
{
fmt::append(out, ", in function %s)", loc.func);
}
else
{
out += ')';
}
// Print error code (may be irrelevant)
#ifdef _WIN32
if (DWORD error = GetLastError())
{
fmt::append(out, " (e=0x%08x[%u])", error, error);
}
#else
if (int error = errno)
{
fmt::append(out, " (errno=%d)", error);
}
#endif
}
namespace fmt
{
void raw_error(const char* msg)
{
thread_ctrl::emergency_exit(msg);
}
void raw_verify_error(const char* msg, const fmt_type_info* sup, u64 arg)
[[noreturn]] void raw_verify_error(const src_loc& loc)
{
std::string out{"Verification failed"};
// Print error code (may be irrelevant)
#ifdef _WIN32
if (DWORD error = GetLastError())
{
fmt::append(out, " (e=%#x)", error);
}
#else
if (int error = errno)
{
fmt::append(out, " (e=%d)", error);
}
#endif
if (sup)
{
out += " (";
sup->fmt_string(out, arg); // Print value
out += ")";
}
if (msg)
{
out += ": ";
out += msg;
}
fmt::append(out, "%s", loc);
thread_ctrl::emergency_exit(out);
}
void raw_narrow_error(const char* msg, const fmt_type_info* sup, u64 arg)
[[noreturn]] void raw_narrow_error(const src_loc& loc)
{
std::string out{"Narrow error"};
if (sup)
{
out += " (";
sup->fmt_string(out, arg); // Print value
out += ")";
}
if (msg)
{
out += ": ";
out += msg;
}
std::string out{"Narrowing error"};
fmt::append(out, "%s", loc);
thread_ctrl::emergency_exit(out);
}
void raw_throw_exception(const char* fmt, const fmt_type_info* sup, const u64* args)
[[noreturn]] void raw_throw_exception(const src_loc& loc, const char* fmt, const fmt_type_info* sup, const u64* args)
{
std::string out;
raw_append(out, fmt, sup, args);
fmt::append(out, "%s", loc);
thread_ctrl::emergency_exit(out);
}
@@ -318,7 +331,7 @@ struct fmt::cfmt_src
const fmt_type_info* sup;
const u64* args;
bool test(std::size_t index) const
bool test(usz index) const
{
if (!sup[index].fmt_string)
{
@@ -329,26 +342,26 @@ struct fmt::cfmt_src
}
template <typename T>
T get(std::size_t index) const
T get(usz index) const
{
return *reinterpret_cast<const T*>(reinterpret_cast<const u8*>(args + index));
}
void skip(std::size_t extra)
void skip(usz extra)
{
sup += extra + 1;
args += extra + 1;
}
std::size_t fmt_string(std::string& out, std::size_t extra) const
usz fmt_string(std::string& out, usz extra) const
{
const std::size_t start = out.size();
const usz start = out.size();
sup[extra].fmt_string(out, args[extra]);
return out.size() - start;
}
// Returns type size (0 if unknown, pointer, unsigned, assumed max)
std::size_t type(std::size_t extra) const
usz type(usz extra) const
{
// Hack: use known function pointers to determine type
#define TYPE(type) \
@@ -366,14 +379,14 @@ struct fmt::cfmt_src
return 0;
}
static constexpr std::size_t size_char = 1;
static constexpr std::size_t size_short = 2;
static constexpr std::size_t size_int = 0;
static constexpr std::size_t size_long = sizeof(ulong);
static constexpr std::size_t size_llong = sizeof(ullong);
static constexpr std::size_t size_size = sizeof(std::size_t);
static constexpr std::size_t size_max = sizeof(std::uintmax_t);
static constexpr std::size_t size_diff = sizeof(std::ptrdiff_t);
static constexpr usz size_char = 1;
static constexpr usz size_short = 2;
static constexpr usz size_int = 0;
static constexpr usz size_long = sizeof(ulong);
static constexpr usz size_llong = sizeof(ullong);
static constexpr usz size_size = sizeof(usz);
static constexpr usz size_max = sizeof(std::uintmax_t);
static constexpr usz size_diff = sizeof(std::ptrdiff_t);
};
void fmt::raw_append(std::string& out, const char* fmt, const fmt_type_info* sup, const u64* args) noexcept
@@ -409,9 +422,9 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
{
std::vector<std::string> result;
size_t cursor_begin = 0;
usz cursor_begin = 0;
for (size_t cursor_end = 0; cursor_end < source.length(); ++cursor_end)
for (usz cursor_end = 0; cursor_end < source.length(); ++cursor_end)
{
for (auto& separator : separators)
{
@@ -438,7 +451,7 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
std::string fmt::trim(const std::string& source, const std::string& values)
{
std::size_t begin = source.find_first_not_of(values);
usz begin = source.find_first_not_of(values);
if (begin == source.npos)
return {};
@@ -464,7 +477,7 @@ std::string fmt::to_lower(const std::string& string)
bool fmt::match(const std::string& source, const std::string& mask)
{
std::size_t source_position = 0, mask_position = 0;
usz source_position = 0, mask_position = 0;
for (; source_position < source.size() && mask_position < mask.size(); ++mask_position, ++source_position)
{
@@ -473,7 +486,7 @@ bool fmt::match(const std::string& source, const std::string& mask)
case '?': break;
case '*':
for (std::size_t test_source_position = source_position; test_source_position < source.size(); ++test_source_position)
for (usz test_source_position = source_position; test_source_position < source.size(); ++test_source_position)
{
if (match(source.substr(test_source_position), mask.substr(mask_position + 1)))
{
+38 -38
View File
@@ -1,18 +1,16 @@
#pragma once
#pragma once // No BOM and only basic ASCII in this header, or a neko will die
#include "types.h"
#include "util/types.hpp"
#include <exception>
#include <stdexcept>
#include <string>
namespace fmt
{
template <typename CharT, std::size_t N, typename... Args>
template <typename CharT, usz N, typename... Args>
static std::string format(const CharT(&)[N], const Args&...);
}
template <typename T, typename>
template <typename T, typename = void>
struct fmt_unveil
{
static_assert(sizeof(T) > 0, "fmt_unveil<> error: incomplete type");
@@ -21,7 +19,7 @@ struct fmt_unveil
static inline u64 get(const T& arg)
{
return reinterpret_cast<std::uintptr_t>(&arg);
return reinterpret_cast<uptr>(&arg);
}
// Temporary value container (can possibly be created by other fmt_unveil<> specializations)
@@ -32,7 +30,7 @@ struct fmt_unveil
// Allow implicit conversion
operator u64() const
{
return reinterpret_cast<std::uintptr_t>(&arg);
return reinterpret_cast<uptr>(&arg);
}
};
@@ -66,17 +64,6 @@ struct fmt_unveil<T, std::enable_if_t<std::is_floating_point<T>::value && sizeof
}
};
template <>
struct fmt_unveil<f16, void>
{
using type = f16;
static inline u64 get(const f16& arg)
{
return fmt_unveil<f64>::get(arg.operator float());
}
};
template <typename T>
struct fmt_unveil<T, std::enable_if_t<std::is_enum<T>::value>>
{
@@ -95,29 +82,29 @@ struct fmt_unveil<T*, void>
static inline u64 get(type arg)
{
return reinterpret_cast<std::uintptr_t>(arg);
return reinterpret_cast<uptr>(arg);
}
};
template <typename T, std::size_t N>
template <typename T, usz N>
struct fmt_unveil<T[N], void>
{
using type = std::add_const_t<T>*;
static inline u64 get(type arg)
{
return reinterpret_cast<std::uintptr_t>(arg);
return reinterpret_cast<uptr>(arg);
}
};
template <>
struct fmt_unveil<b8, void>
template <typename T, bool Se, usz Align>
struct fmt_unveil<se_t<T, Se, Align>, void>
{
using type = bool;
using type = typename fmt_unveil<T>::type;
static inline u64 get(const b8& value)
static inline auto get(const se_t<T, Se, Align>& arg)
{
return fmt_unveil<bool>::get(value);
return fmt_unveil<T>::get(arg);
}
};
@@ -134,7 +121,7 @@ struct fmt_class_string
// Helper function (converts arg to object reference)
static SAFE_BUFFERS FORCE_INLINE const T& get_object(u64 arg)
{
return *reinterpret_cast<const T*>(static_cast<std::uintptr_t>(arg));
return *reinterpret_cast<const T*>(static_cast<uptr>(arg));
}
// Enum -> string function type
@@ -236,13 +223,16 @@ struct fmt_type_info
template <typename... Args>
using fmt_args_t = const u64(&&)[sizeof...(Args) + 1];
template <typename Arg>
using fmt_unveil_t = typename fmt_unveil<Arg>::type;
namespace fmt
{
// Base-57 format helper
struct base57
{
const uchar* data;
std::size_t size;
usz size;
template <typename T>
base57(const T& arg)
@@ -251,7 +241,7 @@ namespace fmt
{
}
base57(const uchar* data, std::size_t size)
base57(const uchar* data, usz size)
: data(data)
, size(size)
{
@@ -274,7 +264,7 @@ namespace fmt
void raw_append(std::string& out, const char*, const fmt_type_info*, const u64*) noexcept;
// Formatting function
template <typename CharT, std::size_t N, typename... Args>
template <typename CharT, usz N, typename... Args>
SAFE_BUFFERS FORCE_INLINE void append(std::string& out, const CharT(&fmt)[N], const Args&... args)
{
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};
@@ -282,7 +272,7 @@ namespace fmt
}
// Formatting function
template <typename CharT, std::size_t N, typename... Args>
template <typename CharT, usz N, typename... Args>
SAFE_BUFFERS FORCE_INLINE std::string format(const CharT(&fmt)[N], const Args&... args)
{
std::string result;
@@ -291,13 +281,23 @@ namespace fmt
}
// Internal exception message formatting template, must be explicitly specialized or instantiated in cpp to minimize code bloat
[[noreturn]] void raw_throw_exception(const char*, const fmt_type_info*, const u64*);
[[noreturn]] void raw_throw_exception(const src_loc&, const char*, const fmt_type_info*, const u64*);
// Throw exception with formatting
template <typename... Args>
[[noreturn]] SAFE_BUFFERS FORCE_INLINE void throw_exception(const char* fmt, const Args&... args)
template <typename CharT, usz N, typename... Args>
struct throw_exception
{
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};
raw_throw_exception(fmt, type_list, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
[[noreturn]] SAFE_BUFFERS FORCE_INLINE throw_exception(const CharT(&fmt)[N], const Args&... args,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* func = __builtin_FUNCTION())
{
static constexpr fmt_type_info type_list[sizeof...(Args) + 1]{fmt_type_info::make<fmt_unveil_t<Args>>()...};
raw_throw_exception({line, col, file, func}, reinterpret_cast<const char*>(fmt), type_list, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
}
};
template <typename CharT, usz N, typename... Args>
throw_exception(const CharT(&)[N], const Args&...) -> throw_exception<CharT, N, Args...>;
}
+9 -9
View File
@@ -17,7 +17,7 @@ std::string utf8_path_to_ansi_path(const std::string& src);
template <typename D, typename T>
inline void strcpy_trunc(D& dst, const T& src)
{
const std::size_t count = std::size(src) >= std::size(dst) ? std::size(dst) - 1 : std::size(src);
const usz count = std::size(src) >= std::size(dst) ? std::size(dst) - 1 : std::size(src);
std::memcpy(std::data(dst), std::data(src), count);
std::memset(std::data(dst) + count, 0, std::size(dst) - count);
}
@@ -27,14 +27,14 @@ namespace fmt
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
std::string replace_all(const std::string& src, const std::string& from, const std::string& to);
template <size_t list_size>
template <usz list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::string> (&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
for (usz pos = 0; pos < src.length(); ++pos)
{
for (size_t i = 0; i < list_size; ++i)
for (usz i = 0; i < list_size; ++i)
{
const size_t comp_length = list[i].first.length();
const usz comp_length = list[i].first.length();
if (src.length() - pos < comp_length)
continue;
@@ -51,14 +51,14 @@ namespace fmt
return src;
}
template <size_t list_size>
template <usz list_size>
std::string replace_all(std::string src, const std::pair<std::string, std::function<std::string()>> (&list)[list_size])
{
for (size_t pos = 0; pos < src.length(); ++pos)
for (usz pos = 0; pos < src.length(); ++pos)
{
for (size_t i = 0; i < list_size; ++i)
for (usz i = 0; i < list_size; ++i)
{
const size_t comp_length = list[i].first.length();
const usz comp_length = list[i].first.length();
if (src.length() - pos < comp_length)
continue;
+472 -145
View File
File diff suppressed because it is too large Load Diff
+73 -91
View File
@@ -1,20 +1,16 @@
#pragma once
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
#include "util/shared_cptr.hpp"
#include "util/shared_ptr.hpp"
#include <string>
#include <memory>
#include <string_view>
#include "mutex.h"
#include "cond.h"
#include "lockless.h"
// Report error and call std::abort(), defined in main.cpp
[[noreturn]] void report_fatal_error(const std::string&);
// Hardware core layout
enum class native_core_arrangement : u32
{
@@ -34,12 +30,15 @@ enum class thread_class : u32
enum class thread_state : u32
{
created, // Initial state
aborting, // The thread has been joined in the destructor or explicitly aborted
errored, // Set after the emergency_exit call
finished // Final state, always set at the end of thread execution
created = 0, // Initial state
aborting = 1, // The thread has been joined in the destructor or explicitly aborted
errored = 2, // Set after the emergency_exit call
finished = 3, // Final state, always set at the end of thread execution
mask = 3
};
class need_wakeup {};
template <class Context>
class named_thread;
@@ -90,6 +89,7 @@ struct thread_thread_name<T, std::void_t<decltype(named_thread<T>::thread_name)>
// Thread base class
class thread_base
{
public:
// Native thread entry point function type
#ifdef _WIN32
using native_entry = uint(__stdcall*)(void* arg);
@@ -97,38 +97,35 @@ class thread_base
using native_entry = void*(*)(void* arg);
#endif
const native_entry entry_point;
private:
// Thread handle (platform-specific)
atomic_t<std::uintptr_t> m_thread{0};
atomic_t<u64> m_thread{0};
// Thread playtoy, that shouldn't be used
atomic_t<u32> m_signal{0};
// Thread state
atomic_t<thread_state> m_state = thread_state::created;
// Thread state notification info
atomic_t<const void*> m_state_notifier{nullptr};
// Thread state and cycles
atomic_t<u64> m_sync{0};
// Thread name
stx::atomic_cptr<std::string> m_tname;
//
atomic_t<u64> m_cycles = 0;
atomic_ptr<std::string> m_tname;
// Start thread
void start(native_entry);
void start();
// Called at the thread start
void initialize(void (*error_cb)(), bool(*wait_cb)(const void*));
void initialize(void (*error_cb)());
// May be called in destructor
void notify_abort() noexcept;
// Called at the thread end, returns true if needs destruction
bool finalize(thread_state result) noexcept;
// Called at the thread end, returns self handle
u64 finalize(thread_state result) noexcept;
// Cleanup after possibly deleting the thread instance
static void finalize() noexcept;
static native_entry finalize(u64 _self) noexcept;
// Set name for debugger
static void set_name(std::string);
// Make entry point
static native_entry make_trampoline(u64(*)(thread_base*));
friend class thread_ctrl;
@@ -136,7 +133,7 @@ class thread_base
friend class named_thread;
protected:
thread_base(std::string_view name);
thread_base(native_entry, std::string_view name);
~thread_base();
@@ -145,10 +142,13 @@ public:
u64 get_cycles();
// Wait for the thread (it does NOT change thread state, and can be called from multiple threads)
bool join() const;
bool join(bool dtor = false) const;
// Notify the thread
void notify();
// Get thread id
u64 get_native_id() const;
};
// Collection of global function for current thread
@@ -188,14 +188,14 @@ public:
// Set current thread name (not recommended)
static void set_name(std::string_view name)
{
g_tls_this_thread->m_tname.store(stx::shared_cptr<std::string>::make(name));
g_tls_this_thread->m_tname.store(make_single<std::string>(name));
}
// Set thread name (not recommended)
template <typename T>
static void set_name(named_thread<T>& thread, std::string_view name)
{
static_cast<thread_base&>(thread).m_tname.store(stx::shared_cptr<std::string>::make(name));
static_cast<thread_base&>(thread).m_tname.store(make_single<std::string>(name));
}
template <typename T>
@@ -210,10 +210,16 @@ public:
static_cast<thread_base&>(thread).notify();
}
template <typename T>
static u64 get_native_id(named_thread<T>& thread)
{
return static_cast<thread_base&>(thread).get_native_id();
}
// Read current state
static inline thread_state state()
{
return g_tls_this_thread->m_state;
return static_cast<thread_state>(g_tls_this_thread->m_sync & 3);
}
// Wait once with timeout. May spuriously return false.
@@ -249,8 +255,18 @@ public:
// Sets the preferred affinity mask for this thread
static void set_thread_affinity_mask(u64 mask);
// Get process affinity mask
static u64 get_process_affinity_mask();
// Miscellaneous
static u64 get_thread_affinity_mask();
// Get current thread stack addr and size
static std::pair<void*, usz> get_thread_stack();
private:
// Miscellaneous
static const u64 process_affinity_mask;
};
// Derived from the callable object Context, possibly a lambda
@@ -260,59 +276,20 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
using result = result_storage_t<Context>;
using thread = thread_base;
// Type-erased thread entry point
#ifdef _WIN32
static inline uint __stdcall entry_point(void* arg)
#else
static inline void* entry_point(void* arg)
#endif
static u64 entry_point(thread_base* _base)
{
const auto _this = static_cast<named_thread*>(static_cast<thread*>(arg));
// Perform self-cleanup if necessary
if (_this->entry_point())
{
delete _this;
}
thread::finalize();
return 0;
return static_cast<named_thread*>(_base)->entry_point2();
}
bool entry_point()
u64 entry_point2()
{
auto tls_error_cb = []()
thread::initialize([]()
{
if constexpr (!result::empty)
{
// Construct using default constructor in the case of failure
new (static_cast<result*>(static_cast<named_thread*>(thread_ctrl::get_current()))->get()) typename result::type();
}
};
thread::initialize(tls_error_cb, [](const void* data)
{
const auto _this = thread_ctrl::get_current();
if (_this->m_state >= thread_state::aborting)
{
return false;
}
_this->m_state_notifier.release(data);
if (!data)
{
return true;
}
if (_this->m_state >= thread_state::aborting)
{
_this->m_state_notifier.release(nullptr);
return false;
}
return true;
});
if constexpr (result::empty)
@@ -329,6 +306,8 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
return thread::finalize(thread_state::finished);
}
static inline thread::native_entry trampoline = thread::make_trampoline(entry_point);
friend class thread_ctrl;
public:
@@ -336,26 +315,26 @@ public:
template <bool Valid = std::is_default_constructible_v<Context> && thread_thread_name<Context>(), typename = std::enable_if_t<Valid>>
named_thread()
: Context()
, thread(Context::thread_name)
, thread(trampoline, Context::thread_name)
{
thread::start(&named_thread::entry_point);
thread::start();
}
// Normal forwarding constructor
template <typename... Args, typename = std::enable_if_t<std::is_constructible_v<Context, Args&&...>>>
named_thread(std::string_view name, Args&&... args)
: Context(std::forward<Args>(args)...)
, thread(name)
, thread(trampoline, name)
{
thread::start(&named_thread::entry_point);
thread::start();
}
// Lambda constructor, also the implicit deduction guide candidate
named_thread(std::string_view name, Context&& f)
: Context(std::forward<Context>(f))
, thread(name)
, thread(trampoline, name)
{
thread::start(&named_thread::entry_point);
thread::start();
}
named_thread(const named_thread&) = delete;
@@ -387,19 +366,22 @@ public:
// Access thread state
operator thread_state() const
{
return thread::m_state.load();
return static_cast<thread_state>(thread::m_sync.load() & 3);
}
// Try to abort by assigning thread_state::aborting (UB if assigning different state)
named_thread& operator=(thread_state s)
{
ASSUME(s == thread_state::aborting);
if (s == thread_state::aborting && thread::m_state.compare_and_swap_test(thread_state::created, s))
if (s == thread_state::aborting && thread::m_sync.fetch_op([](u64& v){ return !(v & 3) && (v |= 1); }).second)
{
if (s == thread_state::aborting)
{
thread::notify_abort();
thread::m_sync.notify_one(1);
}
if constexpr (std::is_base_of_v<need_wakeup, Context>)
{
this->wake_up();
}
}
@@ -411,7 +393,7 @@ public:
{
// Assign aborting state forcefully
operator=(thread_state::aborting);
thread::join();
thread::join(true);
if constexpr (!result::empty)
{
+9 -9
View File
@@ -1,6 +1,6 @@
#pragma once
#include "types.h"
#include "util/types.hpp"
#include <chrono>
@@ -8,8 +8,8 @@ class Timer
{
private:
bool m_stopped;
std::chrono::steady_clock::time_point m_start;
std::chrono::steady_clock::time_point m_end;
steady_clock::time_point m_start;
steady_clock::time_point m_end;
public:
Timer() : m_stopped(false)
@@ -19,13 +19,13 @@ public:
void Start()
{
m_stopped = false;
m_start = std::chrono::steady_clock::now();
m_start = steady_clock::now();
}
void Stop()
{
m_stopped = true;
m_end = std::chrono::steady_clock::now();
m_end = steady_clock::now();
}
double GetElapsedTimeInSec() const
@@ -40,21 +40,21 @@ public:
u64 GetElapsedTimeInMicroSec() const
{
std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now();
steady_clock::time_point now = m_stopped ? m_end : steady_clock::now();
return std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count();
}
u64 GetElapsedTimeInNanoSec() const
{
std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now();
steady_clock::time_point now = m_stopped ? m_end : steady_clock::now();
return std::chrono::duration_cast<std::chrono::nanoseconds>(now - m_start).count();
}
u64 GetMsSince(std::chrono::steady_clock::time_point timestamp)
u64 GetMsSince(steady_clock::time_point timestamp)
{
std::chrono::steady_clock::time_point now = m_stopped ? m_end : std::chrono::steady_clock::now();
steady_clock::time_point now = m_stopped ? m_end : steady_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(now - timestamp).count();
}
+11 -11
View File
@@ -1,6 +1,6 @@
#pragma once
#pragma once
#include "types.h"
#include "util/types.hpp"
#include "StrFmt.h"
#include <vector>
@@ -92,7 +92,7 @@ namespace utils
void set_length(const u32 new_length)
{
end = start + new_length - 1;
ASSERT(valid());
ensure(valid());
}
u32 next_address() const
@@ -282,7 +282,7 @@ namespace utils
public:
// Wrapped functions
inline void reserve(size_t nr) { data.reserve(nr); }
inline void reserve(usz nr) { data.reserve(nr); }
inline void clear() { data.clear(); }
inline size_type size() const { return data.size(); }
inline bool empty() const { return data.empty(); }
@@ -456,9 +456,9 @@ namespace utils
// Will fail if ranges within the vector overlap our touch each-other
bool check_consistency() const
{
size_t _size = data.size();
usz _size = data.size();
for (size_t i = 0; i < _size; ++i)
for (usz i = 0; i < _size; ++i)
{
const auto &r1 = data[i];
if (!r1.valid())
@@ -466,7 +466,7 @@ namespace utils
continue;
}
for (size_t j = i + 1; j < _size; ++j)
for (usz j = i + 1; j < _size; ++j)
{
const auto &r2 = data[j];
if (!r2.valid())
@@ -582,15 +582,15 @@ namespace utils
namespace std
{
static_assert(sizeof(size_t) >= 2 * sizeof(u32), "size_t must be at least twice the size of u32");
static_assert(sizeof(usz) >= 2 * sizeof(u32), "usz must be at least twice the size of u32");
template <>
struct hash<utils::address_range>
{
std::size_t operator()(const utils::address_range& k) const
usz operator()(const utils::address_range& k) const
{
// we can guarantee a unique hash since our type is 64 bits and size_t as well
return (size_t{ k.start } << 32) | size_t{ k.end };
// we can guarantee a unique hash since our type is 64 bits and usz as well
return (usz{ k.start } << 32) | usz{ k.end };
}
};
}
-215
View File
@@ -1,215 +0,0 @@
#pragma once
#include "types.h"
namespace utils
{
// Rotate helpers
#if defined(__GNUG__)
inline u8 rol8(u8 x, u8 n)
{
#if __has_builtin(__builtin_rotateleft8)
return __builtin_rotateleft8(x, n);
#else
u8 result = x;
__asm__("rolb %[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u8 ror8(u8 x, u8 n)
{
#if __has_builtin(__builtin_rotateright8)
return __builtin_rotateright8(x, n);
#else
u8 result = x;
__asm__("rorb %[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u16 rol16(u16 x, u16 n)
{
#if __has_builtin(__builtin_rotateleft16)
return __builtin_rotateleft16(x, n);
#else
u16 result = x;
__asm__("rolw %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u16 ror16(u16 x, u16 n)
{
#if __has_builtin(__builtin_rotateright16)
return __builtin_rotateright16(x, n);
#else
u16 result = x;
__asm__("rorw %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u32 rol32(u32 x, u32 n)
{
#if __has_builtin(__builtin_rotateleft32)
return __builtin_rotateleft32(x, n);
#else
u32 result = x;
__asm__("roll %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u32 ror32(u32 x, u32 n)
{
#if __has_builtin(__builtin_rotateright32)
return __builtin_rotateright32(x, n);
#else
u32 result = x;
__asm__("rorl %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u64 rol64(u64 x, u64 n)
{
#if __has_builtin(__builtin_rotateleft64)
return __builtin_rotateleft64(x, n);
#else
u64 result = x;
__asm__("rolq %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
inline u64 ror64(u64 x, u64 n)
{
#if __has_builtin(__builtin_rotateright64)
return __builtin_rotateright64(x, n);
#else
u64 result = x;
__asm__("rorq %b[n], %[result]" : [result] "+g"(result) : [n] "c"(n));
return result;
#endif
}
constexpr u64 umulh64(u64 a, u64 b)
{
const __uint128_t x = a;
const __uint128_t y = b;
return (x * y) >> 64;
}
constexpr s64 mulh64(s64 a, s64 b)
{
const __int128_t x = a;
const __int128_t y = b;
return (x * y) >> 64;
}
constexpr s64 div128(s64 high, s64 low, s64 divisor, s64* remainder = nullptr)
{
const __int128_t x = (__uint128_t{u64(high)} << 64) | u64(low);
const __int128_t r = x / divisor;
if (remainder)
{
*remainder = x % divisor;
}
return r;
}
constexpr u64 udiv128(u64 high, u64 low, u64 divisor, u64* remainder = nullptr)
{
const __uint128_t x = (__uint128_t{high} << 64) | low;
const __uint128_t r = x / divisor;
if (remainder)
{
*remainder = x % divisor;
}
return r;
}
#elif defined(_MSC_VER)
inline u8 rol8(u8 x, u8 n)
{
return _rotl8(x, n);
}
inline u8 ror8(u8 x, u8 n)
{
return _rotr8(x, n);
}
inline u16 rol16(u16 x, u16 n)
{
return _rotl16(x, (u8)n);
}
inline u16 ror16(u16 x, u16 n)
{
return _rotr16(x, (u8)n);
}
inline u32 rol32(u32 x, u32 n)
{
return _rotl(x, (int)n);
}
inline u32 ror32(u32 x, u32 n)
{
return _rotr(x, (int)n);
}
inline u64 rol64(u64 x, u64 n)
{
return _rotl64(x, (int)n);
}
inline u64 ror64(u64 x, u64 n)
{
return _rotr64(x, (int)n);
}
inline u64 umulh64(u64 x, u64 y)
{
return __umulh(x, y);
}
inline s64 mulh64(s64 x, s64 y)
{
return __mulh(x, y);
}
inline s64 div128(s64 high, s64 low, s64 divisor, s64* remainder = nullptr)
{
s64 rem;
s64 r = _div128(high, low, divisor, &rem);
if (remainder)
{
*remainder = rem;
}
return r;
}
inline u64 udiv128(u64 high, u64 low, u64 divisor, u64* remainder = nullptr)
{
u64 rem;
u64 r = _udiv128(high, low, divisor, &rem);
if (remainder)
{
*remainder = rem;
}
return r;
}
#endif
} // namespace utils
+1120 -194
View File
File diff suppressed because it is too large Load Diff
+118 -12
View File
@@ -1,12 +1,30 @@
#pragma once
#include "BEType.h"
#include <vector>
#include <string>
#include <unordered_map>
#include "util/types.hpp"
#include "util/yaml.hpp"
namespace patch_key
{
static const std::string all = "All";
static const std::string anchors = "Anchors";
static const std::string author = "Author";
static const std::string games = "Games";
static const std::string group = "Group";
static const std::string notes = "Notes";
static const std::string patch = "Patch";
static const std::string patch_version = "Patch Version";
static const std::string version = "Version";
}
static const std::string patch_engine_version = "1.2";
enum class patch_type
{
invalid,
load,
byte,
le16,
@@ -23,22 +41,110 @@ enum class patch_type
class patch_engine
{
struct patch
public:
struct patch_data
{
patch_type type;
u32 offset;
u64 value;
patch_type type = patch_type::load;
u32 offset = 0;
std::string original_value; // Used for import consistency (avoid rounding etc.)
union
{
u64 long_value;
f64 double_value;
} value { 0 };
};
// Database
std::unordered_map<std::string, std::vector<patch>> m_map;
using patch_app_versions = std::unordered_map<std::string /*app_version*/, bool /*enabled*/>;
using patch_serials = std::unordered_map<std::string /*serial*/, patch_app_versions>;
using patch_titles = std::unordered_map<std::string /*serial*/, patch_serials>;
public:
// Load from file
void append(const std::string& path);
struct patch_info
{
// Patch information
std::vector<patch_data> data_list;
patch_titles titles;
std::string description;
std::string patch_version;
std::string patch_group;
std::string author;
std::string notes;
std::string source_path;
// Redundant information for accessibility (see patch_container)
std::string hash;
std::string version;
bool is_legacy = false;
bool is_enabled = false; // only for legacy patches
};
struct patch_container
{
std::unordered_map<std::string /*description*/, patch_info> patch_info_map;
std::string hash;
std::string version;
bool is_legacy = false;
};
using patch_map = std::unordered_map<std::string /*hash*/, patch_container>;
patch_engine();
// Returns the directory in which patch_config.yml is located
static std::string get_patch_config_path();
// Returns the directory in which patches are located
static std::string get_patches_path();
// Returns the filepath for the imported_patch.yml
static std::string get_imported_patch_path();
// Load from file and append to specified patches map
static bool load(patch_map& patches, const std::string& path, std::string content = "", bool importing = false, std::stringstream* log_messages = nullptr);
// Read and add a patch node to the patch info
static bool read_patch_node(patch_info& info, YAML::Node node, const YAML::Node& root, std::stringstream* log_messages = nullptr);
// Get the patch type of a patch node
static patch_type get_patch_type(YAML::Node node);
// Add the data of a patch node
static bool add_patch_data(YAML::Node node, patch_info& info, u32 modifier, const YAML::Node& root, std::stringstream* log_messages = nullptr);
// Save to patch_config.yml
static void save_config(const patch_map& patches_map, bool enable_legacy_patches);
// Save a patch file
static bool save_patches(const patch_map& patches, const std::string& path, std::stringstream* log_messages = nullptr);
// Create or append patches to a file
static bool import_patches(const patch_map& patches, const std::string& path, usz& count, usz& total, std::stringstream* log_messages = nullptr);
// Remove a patch from a file
static bool remove_patch(const patch_info& info);
// Load patch_config.yml
static patch_map load_config(bool& enable_legacy_patches);
// Load from file and append to member patches map
void append_global_patches();
// Load from title relevant files and append to member patches map
void append_title_patches(const std::string& title_id);
// Apply patch (returns the number of entries applied)
std::size_t apply(const std::string& name, u8* dst) const;
usz apply(const std::string& name, u8* dst);
// Apply patch with a check that the address exists in SPU local storage
std::size_t apply_with_ls_check(const std::string&name, u8*dst, u32 filesz, u32 ls_addr) const;
usz apply_with_ls_check(const std::string& name, u8* dst, u32 filesz, u32 ls_addr);
private:
// Internal: Apply patch (returns the number of entries applied)
template <bool check_local_storage>
usz apply_patch(const std::string& name, u8* dst, u32 filesz, u32 ls_addr);
// Database
patch_map m_map;
// Only one patch per patch group can be applied
std::set<std::string> m_applied_groups;
};
+10 -10
View File
@@ -21,8 +21,9 @@ Examples:
Intersection (&) and symmetric difference (^) is also available.
*/
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
#include "Utilities/StrFmt.h"
template <typename T>
class atomic_bs_t;
@@ -48,8 +49,8 @@ private:
}
public:
static constexpr std::size_t bitmax = sizeof(T) * 8;
static constexpr std::size_t bitsize = static_cast<under>(T::__bitset_enum_max);
static constexpr usz bitmax = sizeof(T) * 8;
static constexpr usz bitsize = static_cast<under>(T::__bitset_enum_max);
static_assert(std::is_enum<T>::value, "bs_t<> error: invalid type (must be enum)");
static_assert(bitsize <= bitmax, "bs_t<> error: invalid __bitset_enum_max");
@@ -205,7 +206,7 @@ constexpr bs_t<T> operator ^(T lhs, T rhs)
// Atomic bitset specialization with optimized operations
template <typename T>
class atomic_bs_t : public atomic_t<::bs_t<T>> // TODO: true specialization
class atomic_bs_t : public atomic_t<::bs_t<T>>
{
// Corresponding bitset type
using bs_t = ::bs_t<T>;
@@ -379,11 +380,6 @@ public:
return lhs.m_data != rhs.load().m_data;
}
bool test(const bs_t& rhs)
{
return base::load().test(rhs);
}
bool test_and_set(T rhs)
{
return atomic_storage<under>::bts(m_data.m_data, static_cast<uint>(static_cast<under>(rhs)));
@@ -394,10 +390,14 @@ public:
return atomic_storage<under>::btr(m_data.m_data, static_cast<uint>(static_cast<under>(rhs)));
}
bool test_and_complement(T rhs)
bool test_and_invert(T rhs)
{
return atomic_storage<under>::btc(m_data.m_data, static_cast<uint>(static_cast<under>(rhs)));
}
bool bit_test_set(uint bit) = delete;
bool bit_test_reset(uint bit) = delete;
bool bit_test_invert(uint bit) = delete;
};
template <typename T>
+22 -22
View File
@@ -1,12 +1,12 @@
#pragma once
#include "types.h"
#include "util/types.hpp"
#include <climits>
#include <string>
#include <vector>
#include <algorithm>
static const size_t size_dropped = std::numeric_limits<size_t>::max();
static const usz size_dropped = -1;
/*
C-style format parser. Appends formatted string to `out`, returns number of characters written.
@@ -15,13 +15,13 @@ C-style format parser. Appends formatted string to `out`, returns number of char
`src`: rvalue reference to argument provider.
*/
template<typename Dst, typename Char, typename Src>
std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
usz cfmt_append(Dst& out, const Char* fmt, Src&& src)
{
const std::size_t start_pos = out.size();
const usz start_pos = out.size();
struct cfmt_context
{
std::size_t size; // Size of current format sequence
usz size; // Size of current format sequence
u8 args; // Number of extra args used
u8 type; // Integral type bytesize
@@ -80,7 +80,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const auto write_decimal = [&](u64 value, s64 min_size)
{
const std::size_t start = out.size();
const usz start = out.size();
do
{
@@ -90,7 +90,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
while (0 < --min_size || value);
// Revert written characters
for (std::size_t i = start, j = out.size() - 1; i < j; i++, j--)
for (usz i = start, j = out.size() - 1; i < j; i++, j--)
{
std::swap(out[i], out[j]);
}
@@ -285,7 +285,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
break;
}
const std::size_t start = out.size();
const usz start = out.size();
out.push_back(src.template get<Char>(ctx.args));
if (1 < ctx.width)
@@ -307,8 +307,8 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
break;
}
const std::size_t start = out.size();
const std::size_t size1 = src.fmt_string(out, ctx.args);
const usz start = out.size();
const usz size1 = src.fmt_string(out, ctx.args);
if (ctx.dot && size1 > ctx.prec)
{
@@ -316,7 +316,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
out.resize(start + ctx.prec);
}
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -352,7 +352,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const u64 val = src.template get<u64>(ctx.args);
const bool negative = ctx.type && static_cast<s64>(val) < 0;
const std::size_t start = out.size();
const usz start = out.size();
if (!ctx.dot || ctx.prec)
{
@@ -372,7 +372,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
write_decimal(negative ? 0 - val : val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -419,7 +419,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
const usz start = out.size();
if (ctx.alter)
{
@@ -435,7 +435,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
write_octal(val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -476,7 +476,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
const usz start = out.size();
if (ctx.alter)
{
@@ -493,7 +493,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
write_hex(val, ch == 'X', ctx.prec);
}
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -540,14 +540,14 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
// Trunc sign-extended signed types
const u64 val = src.template get<u64>(ctx.args) & mask;
const std::size_t start = out.size();
const usz start = out.size();
if (!ctx.dot || ctx.prec)
{
write_decimal(val, ctx.prec);
}
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -570,11 +570,11 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const u64 val = src.template get<u64>(ctx.args);
const std::size_t start = out.size();
const usz start = out.size();
write_hex(val, false, sizeof(void*) * 2);
const std::size_t size2 = out.size() - start;
const usz size2 = out.size() - start;
if (size2 < ctx.width)
{
@@ -610,7 +610,7 @@ std::size_t cfmt_append(Dst& out, const Char* fmt, Src&& src)
const u64 arg1 = ctx.args >= 1 ? src.template get<u64>(1) : 0;
const u64 arg2 = ctx.args >= 2 ? src.template get<u64>(2) : 0;
if (const std::size_t _size = std::snprintf(0, 0, _fmt.c_str(), arg0, arg1, arg2))
if (const usz _size = std::snprintf(0, 0, _fmt.c_str(), arg0, arg1, arg2))
{
out.resize(out.size() + _size);
std::snprintf(&out.front() + out.size() - _size, _size + 1, _fmt.c_str(), arg0, arg1, arg2);
+32
View File
@@ -0,0 +1,32 @@
#include "stdafx.h"
#include "cheat_info.h"
#include "Config.h"
#include "StrUtil.h"
LOG_CHANNEL(log_cheat, "Cheat");
bool cheat_info::from_str(const std::string& cheat_line)
{
auto cheat_vec = fmt::split(cheat_line, {"@@@"}, false);
s64 val64 = 0;
if (cheat_vec.size() != 5 || !cfg::try_to_int64(&val64, cheat_vec[2], 0, cheat_type_max - 1))
{
log_cheat.fatal("Failed to parse cheat line");
return false;
}
game = cheat_vec[0];
description = cheat_vec[1];
type = cheat_type{::narrow<u8>(val64)};
offset = std::stoul(cheat_vec[3]);
red_script = cheat_vec[4];
return true;
}
std::string cheat_info::to_str() const
{
std::string cheat_str = game + "@@@" + description + "@@@" + std::to_string(static_cast<u8>(type)) + "@@@" + std::to_string(offset) + "@@@" + red_script + "@@@";
return cheat_str;
}
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include "util/types.hpp"
#include <string>
enum class cheat_type : u8
{
unsigned_8_cheat,
unsigned_16_cheat,
unsigned_32_cheat,
unsigned_64_cheat,
signed_8_cheat,
signed_16_cheat,
signed_32_cheat,
signed_64_cheat,
max
};
constexpr u8 cheat_type_max = static_cast<u8>(cheat_type::max);
struct cheat_info
{
std::string game;
std::string description;
cheat_type type = cheat_type::max;
u32 offset{};
std::string red_script;
bool from_str(const std::string& cheat_line);
std::string to_str() const;
};
+5 -5
View File
@@ -1,4 +1,4 @@
#include "cond.h"
#include "cond.h"
#include "sync.h"
#include "lockless.h"
@@ -9,10 +9,10 @@
void cond_variable::imp_wait(u32 _old, u64 _timeout) noexcept
{
// Not supposed to fail
verify(HERE), _old;
ensure(_old);
// Wait with timeout
m_value.wait<c_signal_mask>(_old, atomic_wait_timeout{_timeout > max_timeout ? UINT64_MAX : _timeout * 1000});
m_value.wait(_old, c_signal_mask, atomic_wait_timeout{_timeout > max_timeout ? UINT64_MAX : _timeout * 1000});
// Cleanup
m_value.atomic_op([](u32& value)
@@ -50,10 +50,10 @@ void cond_variable::imp_wake(u32 _count) noexcept
if (_count > 1 || ((_old + (c_signal_mask & (0 - c_signal_mask))) & c_signal_mask) == c_signal_mask)
{
// Resort to notify_all if signal count reached max
m_value.notify_all();
m_value.notify_all(c_signal_mask);
}
else
{
m_value.notify_one();
m_value.notify_one(c_signal_mask);
}
}
+1 -2
View File
@@ -1,8 +1,7 @@
#pragma once
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
#include <shared_mutex>
// Lightweight condition variable
class cond_variable
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <cmath>
+7 -7
View File
@@ -1,23 +1,23 @@
#pragma once
#include "Utilities/types.h"
#include "util/types.hpp"
namespace rpcs3
{
template<typename T>
static size_t hash_base(T value)
static usz hash_base(T value)
{
return static_cast<size_t>(value);
return static_cast<usz>(value);
}
template<typename T, typename U>
static size_t hash_struct_base(const T& value)
static usz hash_struct_base(const T& value)
{
// FNV 64-bit
size_t result = 14695981039346656037ull;
usz result = 14695981039346656037ull;
const U *bits = reinterpret_cast<const U*>(&value);
for (size_t n = 0; n < (sizeof(T) / sizeof(U)); ++n)
for (usz n = 0; n < (sizeof(T) / sizeof(U)); ++n)
{
result ^= bits[n];
result *= 1099511628211ull;
@@ -27,7 +27,7 @@ namespace rpcs3
}
template<typename T>
static size_t hash_struct(const T& value)
static usz hash_struct(const T& value)
{
static constexpr auto block_sz = sizeof(T);
+20 -9
View File
@@ -1,6 +1,6 @@
#pragma once
#pragma once
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
//! Simple sizeless array base for concurrent access. Cannot shrink, only growths automatically.
@@ -8,7 +8,7 @@
//!
//! T is the type of elements. Currently, default constructor of T shall be constexpr.
//! N is initial element count, available without any memory allocation and only stored contiguously.
template <typename T, std::size_t N>
template <typename T, usz N>
class lf_array
{
// Data (default-initialized)
@@ -28,7 +28,7 @@ public:
}
}
T& operator [](std::size_t index)
T& operator [](usz index)
{
if (index < N) [[likely]]
{
@@ -51,7 +51,7 @@ public:
//! Simple lock-free FIFO queue base. Based on lf_array<T, N> itself. Currently uses 32-bit counters.
//! There is no "push_end" or "pop_begin" provided, the queue element must signal its state on its own.
template<typename T, std::size_t N>
template<typename T, usz N>
class lf_fifo : public lf_array<T, N>
{
// LSB 32-bit: push, MSB 32-bit: pop
@@ -307,14 +307,25 @@ public:
delete m_head.load();
}
void wait() noexcept
template <atomic_wait::op Flags = atomic_wait::op::eq>
void wait(std::nullptr_t null = nullptr) noexcept
{
if (m_head == nullptr)
{
m_head.wait(nullptr);
m_head.template wait<Flags>(nullptr);
}
}
const volatile void* observe() const noexcept
{
return m_head.load();
}
explicit operator bool() const noexcept
{
return m_head != nullptr;
}
template <typename... Args>
void push(Args&&... args)
{
@@ -343,9 +354,9 @@ public:
// Apply func(data) to each element, return the total length
template <typename F>
std::size_t apply(F func)
usz apply(F func)
{
std::size_t count = 0;
usz count = 0;
for (auto slice = pop_all(); slice; slice.pop_front())
{
+11 -102
View File
@@ -1,8 +1,10 @@
#include "mutex.h"
#include "util/asm.hpp"
void shared_mutex::imp_lock_shared(u32 val)
{
verify("shared_mutex underflow" HERE), val < c_err;
ensure(val < c_err); // "shared_mutex underflow"
for (int i = 0; i < 10; i++)
{
@@ -23,14 +25,14 @@ void shared_mutex::imp_lock_shared(u32 val)
return;
}
verify("shared_mutex overflow" HERE), (old % c_sig) + c_one < c_sig;
ensure((old % c_sig) + c_one < c_sig); // "shared_mutex overflow"
imp_wait();
lock_downgrade();
}
void shared_mutex::imp_unlock_shared(u32 old)
{
verify("shared_mutex underflow" HERE), old - 1 < c_err;
ensure(old - 1 < c_err); // "shared_mutex underflow"
// Check reader count, notify the writer if necessary
if ((old - 1) % c_one == 0)
@@ -39,84 +41,6 @@ void shared_mutex::imp_unlock_shared(u32 old)
}
}
void shared_mutex::imp_lock_low(u32 val)
{
verify("shared_mutex underflow" HERE), val < c_err;
for (int i = 0; i < 10; i++)
{
busy_wait();
if (try_lock_low())
{
return;
}
}
// Acquire writer lock and downgrade
const u32 old = m_value.fetch_add(c_one);
if (old == 0)
{
lock_downgrade();
return;
}
verify("shared_mutex overflow" HERE), (old % c_sig) + c_one < c_sig;
imp_wait();
lock_downgrade();
}
void shared_mutex::imp_unlock_low(u32 old)
{
verify("shared_mutex underflow" HERE), old - 1 < c_err;
// Check reader count, notify the writer if necessary
if ((old - 1) % c_vip == 0)
{
imp_signal();
}
}
void shared_mutex::imp_lock_vip(u32 val)
{
verify("shared_mutex underflow" HERE), val < c_err;
for (int i = 0; i < 10; i++)
{
busy_wait();
if (try_lock_vip())
{
return;
}
}
// Acquire writer lock and downgrade
const u32 old = m_value.fetch_add(c_one);
if (old == 0)
{
lock_downgrade_to_vip();
return;
}
verify("shared_mutex overflow" HERE), (old % c_sig) + c_one < c_sig;
imp_wait();
lock_downgrade_to_vip();
}
void shared_mutex::imp_unlock_vip(u32 old)
{
verify("shared_mutex underflow" HERE), old - 1 < c_err;
// Check reader count, notify the writer if necessary
if ((old - 1) % c_one / c_vip == 0)
{
imp_signal();
}
}
void shared_mutex::imp_wait()
{
while (true)
@@ -137,19 +61,19 @@ void shared_mutex::imp_wait()
break;
}
m_value.wait(old);
m_value.wait(old, c_sig);
}
}
void shared_mutex::imp_signal()
{
m_value += c_sig;
m_value.notify_one();
m_value.notify_one(c_sig);
}
void shared_mutex::imp_lock(u32 val)
{
verify("shared_mutex underflow" HERE), val < c_err;
ensure(val < c_err); // "shared_mutex underflow"
for (int i = 0; i < 10; i++)
{
@@ -168,13 +92,13 @@ void shared_mutex::imp_lock(u32 val)
return;
}
verify("shared_mutex overflow" HERE), (old % c_sig) + c_one < c_sig;
ensure((old % c_sig) + c_one < c_sig); // "shared_mutex overflow"
imp_wait();
}
void shared_mutex::imp_unlock(u32 old)
{
verify("shared_mutex underflow" HERE), old - c_one < c_err;
ensure(old - c_one < c_err); // "shared_mutex underflow"
// 1) Notify the next writer if necessary
// 2) Notify all readers otherwise if necessary (currently indistinguishable from writers)
@@ -199,7 +123,7 @@ void shared_mutex::imp_lock_upgrade()
// Convert to writer lock
const u32 old = m_value.fetch_add(c_one - 1);
verify("shared_mutex overflow" HERE), (old % c_sig) + c_one - 1 < c_sig;
ensure((old % c_sig) + c_one - 1 < c_sig); // "shared_mutex overflow"
if (old % c_one == 1)
{
@@ -241,18 +165,3 @@ void shared_mutex::imp_lock_unlock()
imp_wait();
unlock();
}
bool shared_mutex::downgrade_unique_vip_lock_to_low_or_unlock()
{
return m_value.atomic_op([](u32& value)
{
if (value % c_one / c_vip == 1)
{
value -= c_vip - 1;
return true;
}
value -= c_vip;
return false;
});
}
+2 -118
View File
@@ -1,7 +1,7 @@
#pragma once
#include <mutex>
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
// Shared mutex with small size (u32).
@@ -12,17 +12,12 @@ class shared_mutex final
c_one = 1u << 14, // Fixed-point 1.0 value (one writer, max_readers = c_one - 1)
c_sig = 1u << 30,
c_err = 1u << 31,
c_vip = 1u << 7,
};
atomic_t<u32> m_value{};
void imp_lock_shared(u32 val);
void imp_unlock_shared(u32 old);
void imp_lock_low(u32 val);
void imp_unlock_low(u32 old);
void imp_lock_vip(u32 val);
void imp_unlock_vip(u32 old);
void imp_wait();
void imp_signal();
void imp_lock(u32 val);
@@ -88,64 +83,6 @@ public:
}
}
bool try_lock_low()
{
const u32 value = m_value.load();
// Conditional increment
return value < c_vip - 1 && m_value.compare_and_swap_test(value, value + 1);
}
void lock_low()
{
const u32 value = m_value.load();
if (value >= c_vip - 1 || !m_value.compare_and_swap_test(value, value + 1)) [[unlikely]]
{
imp_lock_low(value);
}
}
void unlock_low()
{
// Unconditional decrement (can result in broken state)
const u32 value = m_value.fetch_sub(1);
if (value >= c_one) [[unlikely]]
{
imp_unlock_low(value);
}
}
bool try_lock_vip()
{
const u32 value = m_value.load();
// Conditional increment
return (value < c_one - 1 || value & (c_one - c_vip)) && (value % c_vip) == 0 && m_value.compare_and_swap_test(value, value + c_vip);
}
void lock_vip()
{
const u32 value = m_value.load();
if ((value >= c_one - 1 && !(value & (c_one - c_vip))) || (value % c_vip) || !m_value.compare_and_swap_test(value, value + c_vip)) [[unlikely]]
{
imp_lock_vip(value);
}
}
void unlock_vip()
{
// Unconditional decrement (can result in broken state)
const u32 value = m_value.fetch_sub(c_vip);
if (value >= c_one) [[unlikely]]
{
imp_unlock_vip(value);
}
}
bool try_lock()
{
return m_value.compare_and_swap_test(0, c_one);
@@ -214,12 +151,6 @@ public:
m_value -= c_one - 1;
}
void lock_downgrade_to_vip()
{
// Convert to vip lock (can result in broken state)
m_value -= c_one - c_vip;
}
// Optimized wait for lockability without locking, relaxed
void lock_unlock()
{
@@ -240,12 +171,9 @@ public:
{
return m_value.load() < c_one - 1;
}
// Special purpose logic
bool downgrade_unique_vip_lock_to_low_or_unlock();
};
// Simplified shared (reader) lock implementation. Mutually incompatible with low_lock and vip_lock.
// Simplified shared (reader) lock implementation.
class reader_lock final
{
shared_mutex& m_mutex;
@@ -283,47 +211,3 @@ public:
m_upgraded ? m_mutex.unlock() : m_mutex.unlock_shared();
}
};
// Special shared (reader) lock, mutually exclusive with vip locks. Mutually incompatible with normal shared (reader) lock.
class low_lock final
{
shared_mutex& m_mutex;
public:
low_lock(const low_lock&) = delete;
low_lock& operator=(const low_lock&) = delete;
explicit low_lock(shared_mutex& mutex)
: m_mutex(mutex)
{
m_mutex.lock_low();
}
~low_lock()
{
m_mutex.unlock_low();
}
};
// Special shared (reader) lock, mutually exclusive with low locks. Mutually incompatible with normal shared (reader) lock.
class vip_lock final
{
shared_mutex& m_mutex;
public:
vip_lock(const vip_lock&) = delete;
vip_lock& operator=(const vip_lock&) = delete;
explicit vip_lock(shared_mutex& mutex)
: m_mutex(mutex)
{
m_mutex.lock_vip();
}
~vip_lock()
{
m_mutex.unlock_vip();
}
};
+1 -4
View File
@@ -1,7 +1,5 @@
#include "stdafx.h"
#include "restore_new.h"
#include "Utilities/rXml.h"
#include "define_new_memleakdetect.h"
rXmlNode::rXmlNode() : handle()
{
@@ -54,7 +52,7 @@ std::string rXmlNode::GetAttribute(const std::string &name)
std::string rXmlNode::GetNodeContent()
{
return handle.text().get();
return handle.text().get();
}
rXmlDocument::rXmlDocument() : handle()
@@ -70,4 +68,3 @@ std::shared_ptr<rXmlNode> rXmlDocument::GetRoot()
{
return std::make_shared<rXmlNode>(handle.root());
}
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <pugixml.hpp>
#include <memory>
+3 -1
View File
@@ -1,5 +1,7 @@
#include "sema.h"
#include "util/asm.hpp"
void semaphore_base::imp_wait()
{
for (int i = 0; i < 10; i++)
@@ -52,7 +54,7 @@ void semaphore_base::imp_wait()
void semaphore_base::imp_post(s32 _old)
{
verify("semaphore_base: overflow" HERE), _old < 0;
ensure(_old < 0); // "semaphore_base: overflow"
m_value.notify_one();
}
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <mutex>
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
// Lightweight semaphore helper class
+13 -3
View File
@@ -2,11 +2,14 @@
/* For internal use. Don't include. */
#include "types.h"
#include "util/types.hpp"
#include "util/atomic.hpp"
#include "dynamic_library.h"
#include "util/dyn_lib.hpp"
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#include <time.h>
#elif __linux__
@@ -15,6 +18,7 @@
#include <linux/futex.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#endif
#include <algorithm>
#include <ctime>
@@ -28,6 +32,12 @@ DYNAMIC_IMPORT("ntdll.dll", NtWaitForKeyedEvent, NTSTATUS(HANDLE, PVOID Key, BOO
DYNAMIC_IMPORT("ntdll.dll", NtReleaseKeyedEvent, NTSTATUS(HANDLE, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout));
DYNAMIC_IMPORT("ntdll.dll", NtWaitForSingleObject, NTSTATUS(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout));
DYNAMIC_IMPORT("ntdll.dll", NtDelayExecution, NTSTATUS(BOOLEAN Alertable, PLARGE_INTEGER DelayInterval));
DYNAMIC_IMPORT("ntdll.dll", NtWaitForAlertByThreadId, NTSTATUS(PVOID Address, PLARGE_INTEGER Timeout));
DYNAMIC_IMPORT("ntdll.dll", NtAlertThreadByThreadId, NTSTATUS(DWORD_PTR ThreadId));
constexpr NTSTATUS NTSTATUS_SUCCESS = 0;
constexpr NTSTATUS NTSTATUS_ALERTED = 0x101;
constexpr NTSTATUS NTSTATUS_TIMEOUT = 0x102;
#endif
#ifndef __linux__
@@ -61,7 +71,7 @@ inline int futex(volatile void* uaddr, int futex_op, uint val, const timespec* t
};
std::mutex mutex;
std::unordered_multimap<volatile void*, waiter*, pointer_hash<volatile void, alignof(int)>> map;
std::unordered_multimap<volatile void*, waiter*> map;
int operator()(volatile void* uaddr, int futex_op, uint val, const timespec* timeout, uint mask)
{
-69
View File
@@ -1,69 +0,0 @@
#pragma once
#include "types.h"
#include <string>
namespace utils
{
inline std::array<u32, 4> get_cpuid(u32 func, u32 subfunc)
{
int regs[4];
#ifdef _MSC_VER
__cpuidex(regs, func, subfunc);
#else
__asm__ volatile("cpuid" : "=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3]) : "a" (func), "c" (subfunc));
#endif
return {0u+regs[0], 0u+regs[1], 0u+regs[2], 0u+regs[3]};
}
inline u64 get_xgetbv(u32 xcr)
{
#ifdef _MSC_VER
return _xgetbv(xcr);
#else
u32 eax, edx;
__asm__ volatile( "xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr));
return eax | (u64(edx) << 32);
#endif
}
bool has_ssse3();
bool has_sse41();
bool has_avx();
bool has_avx2();
bool has_rtm();
bool has_tsx_force_abort();
bool has_mpx();
bool has_avx512();
bool has_xop();
bool has_clwb();
bool has_invariant_tsc();
bool has_fma3();
bool has_fma4();
std::string get_cpu_brand();
std::string get_system_info();
std::string get_firmware_version();
std::string get_OS_version();
ullong get_tsc_freq();
u64 get_total_memory();
u32 get_thread_count();
}
-1046
View File
File diff suppressed because it is too large Load Diff
-1008
View File
File diff suppressed because it is too large Load Diff
+49
View File
@@ -1,6 +1,8 @@
#include "stdafx.h"
#include "version.h"
#include <regex>
namespace utils
{
std::string to_string(version_type type)
@@ -48,4 +50,51 @@ namespace utils
return version;
}
// Based on https://www.geeksforgeeks.org/compare-two-version-numbers/
int compare_versions(const std::string& v1, const std::string& v2, bool& ok)
{
// Check if both version strings are valid
ok = std::regex_match(v1, std::regex("[0-9.]*")) && std::regex_match(v2, std::regex("[0-9.]*"));
if (!ok)
{
return -1;
}
// vnum stores each numeric part of version
int vnum1 = 0;
int vnum2 = 0;
// Loop until both strings are processed
for (usz i = 0, j = 0; (i < v1.length() || j < v2.length());)
{
// Storing numeric part of version 1 in vnum1
while (i < v1.length() && v1[i] != '.')
{
vnum1 = vnum1 * 10 + (v1[i] - '0');
i++;
}
// Storing numeric part of version 2 in vnum2
while (j < v2.length() && v2[j] != '.')
{
vnum2 = vnum2 * 10 + (v2[j] - '0');
j++;
}
if (vnum1 > vnum2)
return 1;
if (vnum2 > vnum1)
return -1;
// If equal, reset variables and go for next numeric part
vnum1 = vnum2 = 0;
i++;
j++;
}
return 0;
}
}
+4 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "types.h"
#include "util/types.hpp"
#include <string>
namespace utils
@@ -69,4 +69,7 @@ namespace utils
uint to_hex() const;
std::string to_string() const;
};
// Generic version comparison (e.g. 0.0.5 vs 1.3)
int compare_versions(const std::string& v1, const std::string& v2, bool& ok);
}
+4
View File
@@ -6,3 +6,7 @@ set(ENABLE_HLSL OFF CACHE BOOL "Enables HLSL input support" FORCE)
set(ENABLE_OPT OFF CACHE BOOL "Enables spirv-opt capability if present" FORCE)
set(ENABLE_CTEST OFF CACHE BOOL "Enables testing" FORCE)
add_subdirectory(glslang)
set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE BOOL "Skip spirv-tools install" FORCE)
set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers" CACHE STRING "spirv-headers path" FORCE)
add_subdirectory(spirv-tools)
+7 -12
View File
@@ -38,29 +38,24 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<CmakeCLI>cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang</CmakeCLI>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeReBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeCleanCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeReBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>
cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_CXX_STANDARD=20 -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT ../glslang
<NMakeCleanCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(SolutionDir)common_default.props /m
</NMakeCleanCommandLine>
</PropertyGroup>
Submodule Vulkan/spirv-tools added at 895927bd3f
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4CBD3DDD-5555-49A4-A44D-DD3D8CB516A1}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="..\..\common_default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\..\common_default_macros.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<CmakeGenerator>"Visual Studio $(VisualStudioVersion.Substring(0,2))"</CmakeGenerator>
<CmakeCLI>cmake -G $(CmakeGenerator) -A x64 -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DLLVM_USE_CRT_DEBUG=MTd -DLLVM_USE_CRT_RELEASE=MT -DSPIRV-Headers_SOURCE_DIR=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../spirv-headers')) ../spirv-tools</CmakeCLI>
<PropsAbsPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\common_default.props'))</PropsAbsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Release /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m
</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:rebuild /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m
</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>$(CmakeCLI)
msbuild.exe ALL_BUILD.vcxproj /t:clean /p:Configuration=Debug /p:ForceImportBeforeCppTargets=$(PropsAbsPath) /m
</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
+4 -8
View File
@@ -5,10 +5,6 @@
<Configuration>Debug - LLVM</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug - MemLeak|x64">
<Configuration>Debug - MemLeak</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
@@ -96,6 +92,9 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
@@ -105,10 +104,6 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="..\rpcs3_debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'" Label="PropertySheets">
<Import Project="..\rpcs3_debug.props" />
<Import Project="..\rpcs3_memleak.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'" Label="PropertySheets">
<Import Project="..\rpcs3_debug.props" />
<Import Project="..\rpcs3_llvm.props" />
@@ -125,6 +120,7 @@
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>ASMJIT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+44 -25
View File
@@ -17,10 +17,12 @@ jobs:
COMPILER: clang
GCC:
COMPILER: gcc
DEPLOY_APPIMAGE: true
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
IS_AZURE: true
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-linux"
DEPLOY_APPIMAGE: true
pool:
vmImage: 'ubuntu-latest'
steps:
@@ -31,38 +33,54 @@ jobs:
displayName: ccache
- bash: |
docker pull --quiet rpcs3/rpcs3-travis-xenial:1.2
docker pull --quiet rpcs3/rpcs3-travis-xenial:1.7
docker run \
-v $(pwd):/rpcs3 \
--env-file .ci/travis.env \
--env-file .ci/docker.env \
-v $CCACHE_DIR:/root/.ccache \
-v $BUILD_ARTIFACTSTAGINGDIRECTORY:/root/artifacts \
rpcs3/rpcs3-travis-xenial:1.2 \
rpcs3/rpcs3-travis-xenial:1.7 \
/rpcs3/.ci/build-linux.sh
displayName: Docker setup and build
- publish: $(Build.ArtifactStagingDirectory)
condition: eq(variables['COMPILER'], 'gcc')
condition: succeeded()
artifact: RPCS3 for Linux ($(COMPILER))
- bash: .ci/github-upload.sh
condition: and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.Repository.Name'], 'RPCS3/rpcs3'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['COMPILER'], 'gcc'))
displayName: Push build to GitHub
env:
RPCS3_TOKEN: $(RPCS3-Token)
- job: Windows_Build
variables:
COMPILER: msvc
QT_VER: '5.14.1'
QT_DATE: '202001240957'
QTDIR: C:\Qt\$(QT_VER)\msvc2017_64
VULKAN_VER: '1.1.126.0'
VULKAN_SDK_SHA: 'ee86f25580b550390ce46508415e744d62e87e9c0de6cd299998058253a2a4ba'
QT_VER_MAIN: '5'
QT_VER: '5.15.2'
QT_VER_MSVC: 'msvc2019'
QT_DATE: '202011130602'
QTDIR: C:\Qt\$(QT_VER)\$(QT_VER_MSVC)_64
VULKAN_VER: '1.2.154.1'
VULKAN_SDK_SHA: 'b64471f3a720e649c1fae6535ea83b8c642655ebed1485bfdf15bf4d88f746d9'
VULKAN_SDK: C:\VulkanSDK\$(VULKAN_VER)
CACHE_DIR: ./cache
UPLOAD_COMMIT_HASH: 7d09e3be30805911226241afbb14f8cdc2eb054e
UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-win"
pool:
vmImage: "windows-latest"
steps:
- bash: .ci/get_keys-windows.sh
displayName: Get Cache Keys
- task: Cache@2
inputs:
key: $(Agent.OS) | $(COMPILER)
key: $(Agent.OS) | $(COMPILER) | "$(QT_VER)" | $(VULKAN_SDK_SHA) | llvm.lock | glslang.lock
path: $(CACHE_DIR)
restoreKeys: |
$(Agent.OS) | $(COMPILER)
displayName: Cache
- bash: .ci/setup-windows.sh
@@ -71,10 +89,18 @@ jobs:
- bash: .ci/export-azure-vars.sh
displayName: Export Variables
- task: MSBuild@1
inputs:
solution: './Vulkan/spirv-tools-build/spirv-tools-build.vcxproj'
maximumCpuCount: true
platform: x64
configuration: 'Release'
displayName: Compile SPIRV-Tools
- task: VSBuild@1
inputs:
solution: 'rpcs3.sln'
msbuildArgs: '/m'
maximumCpuCount: true
platform: x64
configuration: 'Release - LLVM'
displayName: Compile RPCS3
@@ -83,18 +109,11 @@ jobs:
displayName: Pack up build artifacts
- publish: $(Build.ArtifactStagingDirectory)
artifact: Windows App Bundle
condition: succeeded()
artifact: RPCS3 for Windows
- task: GitHubRelease@1
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
gitHubConnection: 'RPCS3-Token'
repositoryName: 'RPCS3/rpcs3-binaries-win'
releaseNotesFilePath: 'GitHubReleaseMessage.txt'
action: 'create'
target: '7d09e3be30805911226241afbb14f8cdc2eb054e'
tagSource: 'userSpecifiedTag'
tag: 'build-$(Build.SourceVersion)'
title: $(AVVER)
addChangeLog: false
- bash: .ci/github-upload.sh
condition: and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.Repository.Name'], 'RPCS3/rpcs3'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Push build to GitHub
env:
RPCS3_TOKEN: $(RPCS3-Token)
+465
View File
@@ -0,0 +1,465 @@
/*
Nekotekina Theme for RPCS3 by GooseWing
v1.0
Based on YoRHa Theme for RPCS3
by Ani @ https://github.com/AniLeo
r1 (2018.02.27)
sorry for stealing
*/
/*
Color Scheme
- Kot Programs
8c806a
bd9d86
c1b398
eadfb1
ebe4d2
- Light
ffd785
bfa163
- Dark
705722
5c471c
4d4940
*/
/* Every widget */
QWidget {
font-family: SCE-PS3 Rodin LATIN;
font-size: 9.00pt;
color: #ffd785;
background: transparent;
alternate-background-color: transparent;
}
/* Debugger: Sets font-family to default (any invalid value could be provided) */
#debugger QListWidget, #debugger QTextEdit {
font-family: none;
}
/* Log+TTY: Use flat dark color background with default font for better readability */
#log_frame, #tty_frame {
background: rgba(52, 49, 40, 0.9);
font-size: 8.50pt;
font-family: none;
}
/* Debugger: Restore original font size */
#debugger QListWidget, #debugger QTextEdit {
font-size: 9.50pt;
}
/* LLE: Style QListWidget checkboxes (QListWidget) */
#lleList::indicator {
border: 0.05em solid #4d4940;
}
#lleList::indicator::unchecked {
background-color: #b3ac98;
}
#lleList::indicator::checked {
background-color: #4d4940;
}
#lleList::indicator::disabled {
background-color: #828790;
}
#lleList::item::selected {
color: #4d4940;
}
/* Mouse Tooltips */
QToolTip {
background-color: #705722;
color: #ffd785;
border: 0.10em solid #705722;
}
/* CG Disasm and Trophy Manager: background-image doesn't work, use static color */
QWidget#cg_disasm, QWidget#trophy_manager {
background: #6e695c;
}
/* Main Window and Dialogs */
QDialog, QMainWindow#main_window {
border-image: url("GuiConfigs/kot-bg.jpg");
}
/* Table headers */
QHeaderView::section {
text-transform: uppercase;
background: #bfa163;
color: #4d4940;
padding-left: 0.15em;
padding-top: 0.15em;
padding-bottom: 0.10em;
text-transform: uppercase;
border: none;
}
/* All other Tabs */
QTabBar {
text-transform: uppercase;
}
QTabBar::tab {
background: transparent;
padding-left: 0.50em;
padding-right: 0.50em;
padding-top: 0.25em;
padding-bottom: 0.25em;
margin-right: 0.25em;
}
QTabBar::tab::selected {
background: #705722;
color: #ffd785;
border-bottom-style: solid;
}
/* Settings Dialog: Tabs */
QTabBar#tab_bar_settings {
border-bottom: 0.05em solid #705722;
text-transform: uppercase;
}
QTabBar::tab#tab_bar_settings {
background: transparent;
width: 5.20em;
padding-left: 0.50em;
padding-right: 0.50em;
padding-top: 0.65em;
padding-bottom: 0.65em;
margin-right: 0.25em;
font-size: 10.5pt;
font-weight: 550;
}
QTabBar::tab:last#tab_bar_settings {
margin-right: 0em;
}
QTabBar::tab:!selected:hover#tab_bar_settings {
background: transparent;
color: #705722;
}
QTabBar::tab::selected#tab_bar_settings {
background: #bfa163;
color: #705722;
border-bottom-style: solid;
margin-top: 0.15em;
}
/* Checkboxes */
QCheckBox::indicator {
border-radius: 0.1em;
border: 0.05em solid #5c471c;
margin-top: 0.05em;
width: 0.8em;
height: 0.8em;
}
QCheckBox::indicator:checked {
background-color: #ffd785; /* Light */
}
QCheckBox::indicator:unchecked {
background-color: #705722; /* Dark */
}
QCheckBox::indicator::disabled {
background-color: #828790; /* Gray */
}
/* Radio Buttons */
QRadioButton::indicator {
border-radius: 0.4em;
border: 0.05em solid #5c471c;
width: 0.8em;
height: 0.8em;
}
QRadioButton::indicator:checked {
background-color: #ffd785; /* Light */
}
QRadioButton::indicator:unchecked {
background-color: #705722; /* Dark */
}
QRadioButton::indicator::disabled {
background-color: #828790; /* Gray */
}
/* Combo Boxes */
QComboBox {
background: transparent;
color: #ffd785;
border: 0.05em solid #ffd785;
border-radius: 0.15em;
padding-bottom: 0.2em;
padding-left: 0.4em;
}
QComboBox QAbstractItemView {
background: #bfa163;
color: #4d4940;
}
QComboBox::disabled {
background: #828790;
color: #4d4940;
}
/* Group Boxes (Settings Dialog) */
QGroupBox {
margin-top: 1em;
border: 0.05em solid #ffd785;
text-transform: uppercase;
font-size: 9.25pt;
background-color: rgba(41,41,41,120);
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top;
padding: 0.3em 0.5em 0.3em 0.5em;
color: #ffd785;
}
/* Buttons */
QPushButton {
background: #b89754;
color: #292929;
}
QPushButton::disabled {
background: #828790;
color: #ffffff;
}
/* QSpinBox (Settings -> Emulator -> width/height) */
/* QDoubleSpinBox (Pads -> Mouse Acceleration -> x/y) */
QSpinBox, QDoubleSpinBox {
background: transparent;
/*background-color: #bfa163;*/
border: 0.05em solid #4d4940;
border-radius: 0.10em;
color: #ffd785;
}
/* Styles Sliders */
QSlider::groove:horizontal {
border: 0.10em solid #ffd785;
border-radius: 0.10em;
}
QSlider::handle:horizontal {
background: #ffd785;
width: 0.50em;
}
QSlider#sizeSlider::groove:horizontal {
border: 0.10em solid #ffd785;
border-radius: 0.10em;
height: 1.5em;
}
/* Log and Debugger borders */
QTextEdit {
border: 0.05em solid #4d4940;
}
/* For dock buttons to be visible */
QDockWidget {
background: transparent;
text-transform: uppercase;
color: #4d4940;
font-weight: 500;
}
[floating="true"] {
border-image: url("GuiConfigs/kot-bg.jpg");
}
QDockWidget::title {
background: #bfa163;
padding-top: 0.2em;
}
QDockWidget::close-button, QDockWidget::float-button {
background-color: #bfa163;
}
/* Disable ugly borders */
QTabWidget::pane {
border: 0em solid #4d4940;
}
/* Top menu bar */
QMenuBar {
height:1.50em;
text-transform: uppercase;
}
QMenuBar::item {
margin-right: 0.20em;
margin-left: 0.20em;
padding-left: 1.20em;
padding-right: 1.20em;
}
QMenuBar::item:selected {
background: #4d4940;
color: #aea993;
}
QMenu {
background: #bfa163;
color: #4d4940;
text-transform: uppercase;
}
QMenu::item {
padding-left: 1.5em;
padding-right: 0.75em;
padding-top: 0.25em;
padding-bottom: 0.25em;
}
QMenu::item:selected {
background: #4d4940;
color: #aea993;
border: 0.05em solid #4d4940;
}
QMenu::item:disabled {
background-color: #828790;
color: #4d4940;
}
/* Pad Settings: Controller Image */
QLabel#l_controller {
color: #ffd785;
}
/* Game Grid Font */
QTableWidget#game_grid {
font-weight: 600;
color: #4d4940;
text-transform: uppercase;
selection-color: #aea993;
}
QTableWidget#game_grid::item:selected:active {
selection-background-color: #4d4940;
}
QTableWidget#game_grid::item:selected:!active {
selection-background-color: #615c51;
}
/* Debug UI Settings buttons */
QLabel#color_button {
background: transparent;
}
/* Search bar on main Toolbar */
QLineEdit#mw_searchbar {
margin-left: 0.7em;
color: #4d4940;
font-size: 10.25pt;
}
/* Uniform colors in Toolbar */
QToolButton {
background: transparent;
text-transform: uppercase;
}
QToolButton::hover {
background-color: #b3ac98;
}
/* Set Theme UI colors */
QLabel#gamelist_icon_background_color {
color: transparent;
}
/* Set Windows Taskbar Thumbnail colors */
QLabel#thumbnail_icon_color {
color: #4d4940;
}
QLabel#log_level_always {
color: #00ffff; /* Cyan */
}
QLabel#log_level_fatal {
color: #ff00ff; /* Fuchsia */
}
QLabel#log_level_error {
color: #ff0000; /* Red */
}
QLabel#log_level_todo {
color: #ff6000; /* Orange */
}
QLabel#log_level_success {
color: #00ff00; /* Green */
}
QLabel#log_level_warning {
color: #ffff00; /* Yellow */
}
QLabel#log_level_notice {
color: #ffffff; /* White */
}
QLabel#log_level_trace {
color: #808080; /* Gray */
}
QLabel#log_stack {
color: #b3ac98; /* Light */
}
/* Set TTY colors */
#tty_frame {
color: #b3ac98; /* Light */
}
/* Memory Viewer */
QLabel#memory_viewer_address_panel {
color: #0000ff; /* Font Color: Blue */
}
QLabel#memory_viewer_hex_panel {
color: #4d4940; /* Font Color: Grey */
}
QLabel#memory_viewer_ascii_panel {
color: #4d4940; /* Font Color: Grey */
}
/* Debugger colors */
QLabel#debugger_frame_breakpoint {
color: #000000; /* Font Color: Black */
background-color: #ffff00; /* Yellow */
}
QLabel#debugger_frame_pc {
color: #000000; /* Font Color: Black */
background-color: #00ff00; /* Green */
}
/* Trophy Notification Popup */
QWidget#trophy_notification_frame {
background-color: #b3ac98;
color: #4d4940;
}
-4
View File
@@ -460,10 +460,6 @@ QSpinBox:hover, QDoubleSpinBox:hover {
color: #FFFFFF;
}
QSpinBox::up-button, QSpinBox::down-button, QDoubleSpinBox::up-button, QDoubleSpinBox::down-button {
background: transparent;
}
QSpinBox:disabled, QDoubleSpinBox:disabled {
color: #455971;
background: #26293b;
-4
View File
@@ -482,10 +482,6 @@ QSpinBox:hover, QDoubleSpinBox:hover {
color: #455971;
}
QSpinBox::up-button, QSpinBox::down-button, QDoubleSpinBox::up-button, QDoubleSpinBox::down-button {
background: transparent;
}
QSpinBox:disabled, QDoubleSpinBox:disabled {
background-color: #b3b3b3;
color: #455971;
+18 -8
View File
@@ -71,6 +71,22 @@ QWidget {
color: #4d4940;
}
/* Style QTreeWidget checkboxes */
QTreeWidget::indicator {
border: 0.05em solid #4d4940;
}
QTreeWidget::indicator::unchecked {
background-color: #b3ac98;
}
QTreeWidget::indicator::checked {
background-color: #4d4940;
}
QTreeWidget::indicator::disabled {
background-color: #828790;
}
QTreeWidget::item::selected {
color: #4d4940;
}
/* Mouse Tooltips */
QToolTip {
@@ -80,14 +96,8 @@ QToolTip {
}
/* CG Disasm and Trophy Manager: background-image doesn't work, use static color */
QWidget#cg_disasm, QWidget#trophy_manager {
background: #b3ac98;
}
/* Main Window and Dialogs */
QDialog, QMainWindow#main_window {
/* Main Window, Dialogs and some Dialogs that are actually widgets */
QDialog, QWidget#trophy_manager, QWidget#cg_disasm, QMainWindow#main_window {
border-image: url("GuiConfigs/YoRHa-background.jpg");
}

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