Commit graph

9377 commits

Author SHA1 Message Date
Nekotekina 0a617a05d0 PPU: correct behaviour under external debugger
May require setting "Assume External Debugger" to true.
2022-03-26 23:09:20 +03:00
kd-11 e66d6a9399 Fix interpreter 2022-03-26 16:10:18 +03:00
kd-11 ef65c47592 vk: Restore UBO alignment
- NV requires some very large alignment thresholds
2022-03-26 16:10:18 +03:00
kd-11 1592ecdc55 rsx: Invalidate transform block on program change
- Since each program now does a remap of the outputs, we need to reupload the constants
- This is not a loss, constants are almost always changing between draw calls anyway
2022-03-26 16:10:18 +03:00
kd-11 96742852eb Fix OGL 2022-03-26 16:10:18 +03:00
kd-11 de0e660d28 rsx: Handle vertex shaders with no constant references
- If no vc[] refs exist, do not upload anything!
2022-03-26 16:10:18 +03:00
kd-11 d057ffe80f rsx: Fix program generation and compact referenced data blocks 2022-03-26 16:10:18 +03:00
kd-11 9a2d4fe46b rsx: Relocatable transform constants 2022-03-26 16:10:18 +03:00
RipleyTom a4d715e25d Warning Fixes 2022-03-23 19:35:10 +01:00
kd-11 af0e1f609e Fix vulkan compilation warnings 2022-03-23 11:26:06 +03:00
kd-11 1ab5b481ff Fix ambiguous comparison operator warning 2022-03-23 11:26:06 +03:00
kd-11 26ee1246ae rsx: Block size back down to 4MB
- 4M is a good compromise, a 720p surface occupies just under 4MB
2022-03-23 11:26:06 +03:00
kd-11 d0402332f7 rsx: Bump surface cache block size to 16M 2022-03-23 11:26:06 +03:00
kd-11 43c7417906 rsx: Rework ranged map
- Adds metadata lookup for intersecting range calculations
- Make fetch/put methods more explicit
2022-03-23 11:26:06 +03:00
kd-11 56540a55ec Fix linux 2022-03-23 11:26:06 +03:00
kd-11 35ec4de776 rsx: Optimize surface store for faster scanning 2022-03-23 11:26:06 +03:00
aliaspider 5797673daa fix vfs::host::rename.
- resolve_path requires the path to be valid and can only be used before
the call to fs::rename, not after.
2022-03-21 08:49:01 +03:00
Megamouse ff34a73fbd cellSaveData: CELL_SAVEDATA_FOCUSPOS_NEWDATA
Untested, but focus position is clamped anyway.
2022-03-18 08:09:50 +01:00
kd-11 bc7ed8eaab rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +03:00
Megamouse 04df392866 Log cpu usage periodically 2022-03-16 19:42:06 +01:00
Megamouse 686d2759f4 cellMic: remove cellMicRead error spam 2022-03-12 20:48:36 +01:00
kd-11 78b8bd80e4 rsx: Unconditionally set MSAA flags if MSAA is active 2022-03-11 01:15:13 +03:00
kd-11 1943d9819f rsx: Clean up surface cache routines around RTT invalidate 2022-03-10 20:43:58 +03:00
NicknineTheEagle 1670769119 Use simpler C00 unlock EDAT check in GUI 2022-03-09 22:39:30 +03:00
kd-11 59a0cf94ab rsx: Fix msvc build 2022-03-08 22:06:26 +03:00
kd-11 3e4faf602a rsx: Fix clang build 2022-03-08 22:06:26 +03:00
kd-11 454a724f4e rsx: Reduce the performance impact of enabling the profiling timer
- Just use TSC if available
2022-03-08 22:06:26 +03:00
kd-11 cfecbb24ca rsx: Avoid calling slow functions every draw call
- Use TSC for timing where interval duration matters.
- Use atomic counter for ordering timestamps otherwise.
2022-03-08 22:06:26 +03:00
kd-11 762b594927 rsx: Fully process texture if surface cache configuration changed 2022-03-08 22:06:26 +03:00
kd-11 8d3d290e33 rsx: Fix build 2022-03-08 22:06:26 +03:00
kd-11 0df903090d rsx: Optimize metrics a bit
- For some reason this has a massive impact on performance above some arbitrary threshold of calls
  Shows up under surface_cache::get_merged_memory_region when doing gathers.
2022-03-08 22:06:26 +03:00
kd-11 6812fa4764 rsx: Fix surface write coherency when MSAA is active 2022-03-08 22:06:26 +03:00
Megamouse cd97d74f0f cellMusic/Decode: add SelectContents functions 2022-03-08 09:02:59 +01:00
Megamouse aafd74f9ea cellMusicDecode: initial implementation
Implements the basic functionality of cellMusicDecode.
Works with Space Invaders (if you add the list selection from the other PR).
Probably fixes SSX custom music.
2022-03-05 18:34:27 +01:00
Megamouse 15e74357cf cellMusic: implement qt music handler 2022-03-03 08:25:46 +01:00
kd-11 0dbfe314a3 vk: Encode image type when caching resources 2022-03-01 21:51:55 +03:00
kd-11 00a1864a95 Revert "rsx: Downgrade depth-1 3D images to 2D (#11593)"
This reverts commit 6c096b72b5.
2022-03-01 21:51:55 +03:00
kd-11 6c096b72b5
rsx: Downgrade depth-1 3D images to 2D (#11593)
- Fixes problems with implicit view types derived from dimensions.
2022-03-01 10:45:50 +03:00
kd-11 e035000864 vk: Do not enable passthrough DMA unconditionally (yet)
- There are still some kinks to work out. Host labels do not fix all the bugs which means I missed something.
2022-02-26 10:28:46 +03:00
kd-11 6db5d83615 Flush dma offloader on texture read sema 2022-02-25 10:53:55 +03:00
kd-11 f3823232e0 Disable passthrough DMA for proprietary intel driver 2022-02-23 21:15:08 +03:00
kd-11 6b8b23c401 vk: Drain the label queue before using the CPU fallback to avoid out-of-order signals
- This avoids crashes in some game engines which expect RSX semaphores to signal in the order they are submitted.
2022-02-23 12:57:04 +03:00
kd-11 6fd2a9b677 rsx: Remove leftover dprints 2022-02-23 12:57:04 +03:00
kd-11 da559b5568 vk/rsx: Tuning and optimization for host labels 2022-02-23 12:57:04 +03:00
kd-11 24587ab459 rsx: Add the option to the advanced tab 2022-02-23 12:57:04 +03:00
kd-11 c7e49b58a8 rsx: Implement host GPU sync labels 2022-02-23 12:57:04 +03:00
kd-11 10e6b43a2f Drop redundant declaration 2022-02-21 23:58:01 +03:00
kd-11 0809e7cf9f Fix build 2022-02-21 23:58:01 +03:00
kd-11 12fd43e1c6 vk: Remove unused variables 2022-02-21 23:58:01 +03:00
kd-11 397a795e75 vk: Remove hardcoded command buffer list length 2022-02-21 23:58:01 +03:00
kd-11 1f9ade0ab6 vk: Remove pointless function (VKGSRender::open_command_buffer)
A relic of the past, back before we wrote wrappers for raw handles.
2022-02-21 23:58:01 +03:00
kd-11 83407c386c vk: Move renderer types to a separate file
- Makes my life easier managing conflicts
2022-02-21 23:58:01 +03:00
kd-11 b791d90b35 vk: Rewrite command buffer chains 2022-02-21 23:58:01 +03:00
nastys 574e934bf3 macOS: Implement shortcuts 2022-02-21 19:11:52 +01:00
Megamouse b1a9e87ecf cellSearch: fix cellSearchStartListSearch
Fixes listing BGM in Gundam.
The returned content was always empty.
Playback of the tracks will still require a MusicSelectionContext and cellMusic playback, which isn't implemented yet.
2022-02-20 21:06:46 +01:00
Megamouse 0a34403ef8 Qt: create rpcs3 shortcuts 2022-02-20 13:23:27 +01:00
Megamouse 2147fe479c cellSearch: more logging 2022-02-20 12:29:37 +01:00
Megamouse 93e7988df7 rsx: add boost mode shortcut 2022-02-20 11:56:11 +01:00
nastys 7801e8368b Add MoltenVK Semaphore setting 2022-02-20 08:47:16 +01:00
Megamouse 91d7f28c67 cellSearch: log audio and video metadata 2022-02-19 14:27:47 +01:00
Megamouse 8171c7766c cellSearch: silence irrelevant log error 2022-02-19 14:27:47 +01:00
Megamouse 3f69ceac40 cellMusic: fix cellMusicSetVolume log messages 2022-02-19 14:27:47 +01:00
Megamouse 4be9e0d396 RSX: Fix rsx capture stop
RSX captures froze on stop, at least with Vulkan.
2022-02-16 19:50:57 +01:00
RipleyTom 6bd8a93ff4 Fixes some unchecked derefs in sceNp logging 2022-02-16 17:08:58 +01:00
Eladash e39797d860 Fix sys_fs_close FD state logging 2022-02-16 18:09:13 +03:00
kd-11 254ddcad51 vk/dma: Initialize COW DMA block contents to avoid leaks
- It is possible to lose data when uploading since the result of map_dma can change types and handles.
- Consider sync-on-exit for inherited spans

Not a problem when using passthrough DMA, but this extension does not work properly on NVIDIA + windows
2022-02-16 16:33:27 +03:00
Eladash fd6c33980b
cellSaveData: Check filename format of savedata files (#11502) 2022-02-14 22:03:40 +03:00
kd-11 2d5d5746d1 gl: Harmonize format conversion values
- Return values that are true to the PS3, not the host.
2022-02-13 15:31:39 +03:00
kd-11 314b63eebf vk: Drop unused native format ABGR8 2022-02-13 15:31:39 +03:00
kd-11 f382d54e9a gl: Remove pointless assert 2022-02-13 15:31:39 +03:00
kd-11 df5295ae85 vk: Per work-queue scratch resources
- Avoids parallel tasks from trampling over each other's data
2022-02-13 14:39:42 +03:00
kd-11 c8ad8b18bb vk: Ignore queue transfer stuff when using 'fast' mode 2022-02-13 14:39:42 +03:00
kd-11 44cc254620 Fix linux build 2022-02-13 14:39:42 +03:00
kd-11 cef512a123 vk: Spec-compliant async compute 2022-02-13 14:39:42 +03:00
Megamouse d6597038ee Input: multithreaded handlers
Implements naive multithreading for input handlers.
2022-02-10 20:38:11 +01:00
kd-11 ec3e8de780 rsx: End the current frame before performing cache cleanup to release in-flight data 2022-02-10 22:20:56 +03:00
kd-11 f667b52cca vk: Rewrite resource management 2022-02-10 22:20:56 +03:00
kd-11 48b54131f6 vk: Fix up multiple resource allocation routines
- Originally part of async bringup. Imported to allow smoother transition.
2022-02-10 22:20:56 +03:00
Megamouse d172b9add6 Rename CallAfter to CallFromMainThread 2022-02-07 19:42:08 +01:00
kd-11 2d9f21a2ea rsx: Lower performance warnings to 'warn' level instead of 'error' level to avoid causing panic for users 2022-02-07 09:25:01 +03:00
kd-11 247759b75b rsx: Fix memory tagging and add some security checks 2022-02-07 09:25:01 +03:00
RipleyTom 987166f4da Fix IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP 2022-02-06 20:37:12 +01:00
kd-11 90d368ae30 vk: Speed up cached image search a bit 2022-02-06 15:49:50 +03:00
kd-11 a2d33a7d76 vk: Fix WCB crash 2022-02-06 15:49:50 +03:00
kd-11 51f9310b9f vk: Silence compiler warnings 2022-02-06 15:49:50 +03:00
kd-11 dca3d477c9 vk: Use image hot-cache for faster allocation times
- Creating new images is expensive.
- We can keep around a set of images that have been recently discarded and use them instead of creating new ones from scratch each time.
2022-02-06 15:49:50 +03:00
nastys 6b370e85d5 Add overlay animations 2022-02-06 12:26:34 +01:00
Eladash e951c619c5
Implement Emulator::GracefulShutdown() 2022-02-05 11:49:29 +01:00
RipleyTom 6c5b8dc31c rpcn: add cookie impl to tickets 2022-02-03 13:25:15 +01:00
Megamouse 8efc29972d input: add missing nullptr checks for pad 2022-02-01 19:28:04 +01:00
Vestral 7977fbb9c5 Audio: prevent click at play/pause
Cubeb uses internal rate resampler and it's not being flushed during call to stream_stop.
This results in noticeable click when emulator is unpaused.
Reset last sample buffer on pause for all backends.
2022-01-31 21:20:57 +01:00
Vestral 681bab558b XAudio: fix deinitialization order 2022-01-31 21:20:57 +01:00
Vestral 107107107c SoundTouch resampler integration 2022-01-31 21:20:57 +01:00
Hyogi Sim 3a804674c9 Fix linkage error on debug build with clang-13
Debug build with clang-13 fails with "undefined references" to the
static const members in spu_channel class. This patch replaces the const
definitions with constexpr constants.
2022-01-31 17:05:18 +03:00
Malcolm Jestadt 91673f8fdc SPU LLVM: Add relaxed xfloat option
- This new setting is on by default
- It's active when approximate default is disabled
- Approximate xfloat is now exposed to the gui
2022-01-31 08:02:48 +03:00
kd-11 86919ec0e1 rsx: Validate requested images before attempting to upload them
- Do not allow dimensions of 0 to reach the backend APIs
2022-01-30 14:58:51 +03:00
kd-11 0e320d17c1 vk: Fix 'grow' behavior when we reach the size limit
- Just swap out the current heap ptr and spawn a fresh one. Chances are, we can spare 1GB of host memory.
2022-01-30 10:56:15 +03:00
kd-11 d063f0b335 vk: Fix working buffer calculation for emulated D16F operations 2022-01-30 10:56:15 +03:00
Eladash 781b2b4548
Implement fs::isfile (#11447) 2022-01-29 22:10:48 +03:00
Nekotekina 16aae4eb77 Fixup creating image path 2022-01-26 15:46:16 +03:00
Nekotekina 3a1082fe0d Fix overlays::image_info constructor 2022-01-26 15:46:16 +03:00
Nekotekina dba2baba9c Implement utils::memory_map_fd (partial)
Improve JIT profiling dump format (data + name, mmap)
Improve objdump interception util (better speed, fix bugs)
Rename spu_ubertrampoline to __ub+number
2022-01-26 15:46:16 +03:00
kd-11 ffe00e8619 gl: Clean up format bitcast checks and register D32F type for FORMAT_CLASS16F
- Also hides a dangerous export for vulkan, same as GL
2022-01-26 12:08:36 +03:00
kd-11 3fa45ff994 Fix missing typeless info update 2022-01-26 12:08:36 +03:00
Eladash 73ff506b88 overlay_controls.cpp: Improve image_info ctor withstandability 2022-01-26 10:35:52 +03:00
kd-11 3a1676e558 vk: Fix float16 requirement issue 2022-01-25 21:34:21 +03:00
Nekotekina 0db9850a73 Add loop building utilities for ASMJIT
Refactor copy_data_swap_u32 a bit
2022-01-25 03:16:37 +03:00
Nekotekina 11ee1f3eb2 Improve JIT profiling on Linux
Add JIT object dumping functionality.
Add source for objdump interception utility.
2022-01-25 03:16:37 +03:00
Nekotekina 14951d8713 Fix abuse of fs::pending_file
Debug dumps don't fall into category which needs atomic rewrite.
2022-01-24 22:39:01 +03:00
Nekotekina 065ee621b8 Call avcodec_register_all in case of old ffmpeg
Apparently it's still possible to break without it.
2022-01-24 22:39:01 +03:00
Nekotekina 12c83b340d Remove built_function
With today's branch prediction techniques, it's hardly useful.
2022-01-24 22:21:41 +03:00
kd-11 1fa82eec89 vk: Rework format feature validation
- Requirements have changed a lot over the years. We no longer blit Z formats around for example because they never support linear filtering
- Removing some unused requirements allows more hardware to be usable
2022-01-24 19:14:27 +03:00
kd-11 2f7d38bb81 rsx: Improve coverage checking logic to handle 3D and cubemap resources 2022-01-23 00:03:03 +03:00
kd-11 4f8b5849b7 rsx: Take depth into account when calculating coverage 2022-01-23 00:03:03 +03:00
kd-11 7f216f2581 rsx: Fix local slice height calculation 2022-01-23 00:03:03 +03:00
kd-11 6ffd38c393 vk: Only enable DCC workaround if the format features allow it 2022-01-22 13:16:48 +03:00
nastys 801e7f3c2f macOS: Implement texture swizzling for 16-bit formats 2022-01-22 00:17:17 +01:00
nastys c7140df5f8 Initial support for Apple GPUs 2022-01-22 00:17:17 +01:00
nastys 6b5f0957ce Disable macOS swizzling workaround 2022-01-22 00:17:17 +01:00
Jan Beich f2ed50e6b0 cellVdec: constify AVInputFormat for ffmpeg >= 5.0
rpcs3/Emu/Cell/Modules/cellAdec.cpp:326:19: error: assigning to 'AVInputFormat *' from 'const AVInputFormat *' discards qualifiers
                        input_format = av_find_input_format("oma");
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/Modules/cellAdec.cpp:332:19: error: assigning to 'AVInputFormat *' from 'const AVInputFormat *' discards qualifiers
                        input_format = av_find_input_format("mp3");
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-01-21 21:36:17 +03:00
Jan Beich 511ca82e30 cellAVdec: constify AVCodec for ffmpeg >= 5.0
rpcs3/Emu/Cell/Modules/cellAdec.cpp:325:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
                        codec = avcodec_find_decoder(AV_CODEC_ID_ATRAC3P);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/Modules/cellAdec.cpp:331:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
                        codec = avcodec_find_decoder(AV_CODEC_ID_MP3);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/Modules/cellVdec.cpp:143:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
                        codec = avcodec_find_decoder(AV_CODEC_ID_MPEG2VIDEO);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/Modules/cellVdec.cpp:148:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
                        codec = avcodec_find_decoder(AV_CODEC_ID_H264);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/Modules/cellVdec.cpp:153:12: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
                        codec = avcodec_find_decoder(AV_CODEC_ID_MPEG4);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-01-21 21:36:17 +03:00
Nekotekina 00274bb4da PPU: port FP convert instructions to Aarch64 2022-01-21 16:07:48 +03:00
Nekotekina a4d94a83b9 PPU/simd.hpp: minor changes in DP instructions 2022-01-21 13:57:46 +03:00
Nekotekina 0de9960772 PPU: rewrite MFOCRF+MFCR instructions 2022-01-21 12:49:52 +03:00
Nekotekina aa7c9dd15d PPU: rewrite LVSL/LVSR instructions
Make the tables endian-agnostic.
2022-01-21 00:05:40 +03:00
Nekotekina 17b1a34ebf PPU: rewrite LVLX/LVRX/STVLX/STVRX instructions 2022-01-20 21:16:00 +03:00
Nekotekina 349f251d14 PPU LLVM: use masked stores for STVLX/STVRX
Drop maskmove intrinsic, not portable.
Its implicit NT hint may also hurt performance.
2022-01-20 21:16:00 +03:00
kd-11 3942a464fe vk: Avoid leaking descriptor copies 2022-01-20 19:21:24 +03:00
kd-11 2331dc3256 vk: Keep the total number of allocated samplers under control 2022-01-20 19:21:24 +03:00
Nekotekina 327c577024 PPU: print internal interpreter build error 2022-01-20 14:42:58 +03:00
Nekotekina b42fae0989 PPU: refactor shift and splat instructions
Fix utils::rol32/64 functions.
Fix immediate clamping in splat instructions.
Other fixes.
2022-01-19 23:01:31 +03:00
Nekotekina 4728478247 PPU: improve interpreter codegen
Implement more sensible check for EVEX prefix and SSE
2022-01-18 04:20:06 +03:00
Nekotekina 4704367382 Remove unnecessary asmjit::imm_ptr 2022-01-18 00:10:32 +03:00
Nekotekina 14cca55b50 PPU: refactor vector rounding instructions
Fix: nearbyint -> roundeven
2022-01-18 00:10:32 +03:00
Nekotekina 248f9424ac PPU: refactor VPack instructions 2022-01-18 00:10:19 +03:00
Nekotekina b404d37eb0 PPU: more interpreter refactoring (VPERM)
Notably, runtime-built SSSE3 version of VPERM.
Some other instructions are refactored and vectorized.
Aarch64 impl of multiple instructions including VPERM.
2022-01-18 00:10:19 +03:00
RipleyTom 58fdf58150 Force close socket in sys_net_bnet_close 2022-01-17 21:27:20 +01:00
kd-11 000ec71629 Fix invalid descriptor setup if subdraw0 has broken vertex setup 2022-01-17 12:38:10 +03:00
kd-11 3e794e7fdb rsx: Optimize 8-bit rounding logic a bit
- NV hw does not like the raw use of round()
2022-01-17 10:28:23 +03:00
kd-11 c38ca21a81 rsx: Round up 8-bit ROP output on NVIDIA cards
- NV GPUs have a tendancy to be off by a very small margin, breaking rendering when greaterThan/lessThan checks are used.
- NOTE: Currently this setting is using the sRGB flag which indicates 8-bit output.
  Only one game is currently known to care about this behaviour so this is good enough for now.
2022-01-17 10:28:23 +03:00
kd-11 f923eaf09a rsx: Surface format remapping enhancements 2022-01-17 10:28:23 +03:00
Nekotekina 5b980b99a0 PPU: Rename new ppu_use_nj_bit setting to flip it back
Some mistakes were made.
2022-01-16 01:34:47 +03:00
Nekotekina 22240777aa PPU Interpreter: fix accuracy flag dispatch 2022-01-16 01:00:37 +03:00
Nekotekina f95395b351 PPU LLVM: improve accuracy of VSL/VSR
Passes tests, should now be equal to interpreter.
2022-01-15 21:13:31 +03:00
Nekotekina df24cff0b1 PPU LLVM: fix VMINFP and VMAXFP accuracy
PPU cache needs to be cleared.
2022-01-15 17:36:57 +03:00
Nekotekina 6dda047128 PPU LLVM: fix VNMSUBFP sign handling
PPU cache needs to be cleared.
2022-01-15 17:36:57 +03:00
Nekotekina e9efa73eed PPU: restore previous NJ mode handling option
Fix the divergence between PPU Interpreter and LLVM.
2022-01-15 17:36:57 +03:00
Nekotekina 580bd2b25e Initial Linux Aarch64 support
* Update asmjit dependency (aarch64 branch)
* Disable USE_DISCORD_RPC by default
* Dump some JIT objects in rpcs3 cache dir
* Add SIGILL handler for all platforms
* Fix resetting zeroing denormals in thread pool
* Refactor most v128:: utils into global gv_** functions
* Refactor PPU interpreter (incomplete), remove "precise"
* - Instruction specializations with multiple accuracy flags
* - Adjust calling convention for speed
* - Removed precise/fast setting, replaced with static
* - Started refactoring interpreters for building at runtime JIT
*   (I got tired of poor compiler optimizations)
* - Expose some accuracy settings (SAT, NJ, VNAN, FPCC)
* - Add exec_bytes PPU thread variable (akin to cycle count)
* PPU LLVM: fix VCTUXS+VCTSXS instruction NaN results
* SPU interpreter: remove "precise" for now (extremely non-portable)
* - As with PPU, settings changed to static/dynamic for interpreters.
* - Precise options will be implemented later
* Fix termination after fatal error dialog
2022-01-15 06:48:04 +03:00
kd-11 d6aa834b5f vk: Enable shading rate hack for all GPUs
- This is a hack, ideally we should be using coverage-based masking when writing the exploded texture.
- We do not have access to the fragment coverage mask and it is non-trivial to integrate it in a competent manner.
2022-01-14 10:21:38 +03:00
MSuih f526027778
Revert recent file system changes (#11370)
* Revert "FS: use std::filesystem::u8path"

This reverts commit cd016be86e.

* Revert "VFS: fix missing path deliminators"

This reverts commit 84753db574.

* Revert "Bugfix of Emulator::Load disc path searching"

This reverts commit b9179de288.

* Revert "fs: Reimplement path resolving using std::filesystem::weakly_canonical"

This reverts commit 0c4b2ff06b.
2022-01-13 07:24:04 +03:00
Megamouse 84753db574 VFS: fix missing path deliminators 2022-01-13 00:07:25 +03:00
Eladash a60cee6536 Update PPUTranslator::MTFSFI for its intention to be clearer 2022-01-12 03:37:39 +03:00
Eladash b9179de288 Bugfix of Emulator::Load disc path searching
Turns out fs::file does not always fail when provding a path to a directory.
2022-01-12 03:37:39 +03:00
Eladash 0c4b2ff06b fs: Reimplement path resolving using std::filesystem::weakly_canonical 2022-01-12 03:37:39 +03:00
nastys ef66b002e0
Implement proper macOS version check (#11352) 2022-01-11 23:17:26 +01:00
nastys 29a6db8960 Disable OpenGL on macOS 2022-01-10 19:18:49 +03:00
kd-11 6d737e61fd rsx: Use 32 bit integers for pitch
- RSX max pitch = 65536 which requires 17 bits
2022-01-10 12:27:30 +03:00
kd-11 d874ca5d8c cellGame: Fall back to VERSION field if APP_VER is missing from PARAM.SFO 2022-01-10 12:27:30 +03:00
Vestrel 1adc408ad7
More sys_uart packets (#11332)
* Additional sys_uart packets added
2022-01-10 03:43:54 +03:00
kd-11 83026fd263 rsx: use coverage ratio to determine when too much data is overlapping 2022-01-07 22:55:27 +03:00
kd-11 92824b6729 rsx: Rework invalidation tagging 2022-01-07 22:55:27 +03:00
kd-11 7563655221 rsx: Bump surface removal threshold values
- It is much slower to attempt surface removal than to render duplicates on the host GPU
2022-01-07 22:55:27 +03:00
kd-11 6889b48973 rsx: Add optimized version of section removal code 2022-01-07 22:55:27 +03:00
Vestral 9766d87126 cellAudio: fix enqueued samples computation 2022-01-07 09:48:51 +01:00
Eladash bba528e2ae
rsx: Fix wrong fault report in initialization (#11323)
* rsx: Fix wrong fault report in initialization

* Ensure emu.isstopped() == true at RPCS3 startup

Based on zero initialization.
2022-01-05 20:41:01 +03:00
clienthax 350257e1a4 Fcntl 0xc0000007, 0xc0000015, 0xc000001c 2022-01-04 22:47:06 +03:00
Florin9doi 0e07d3c58f USB: Improve SingStar emulation 2022-01-04 18:03:23 +01:00
Malcolm Jestadt 31a5a77ae5 SPU: Use REP MOVSB in do_dma_transfer
- Try to use REP MOVSB when the size of the transfer is above a certain threshold
- This threshold is determined by the ERMS and FSRM cpuid flags
- The threshold values are (roughly) taken from GLIBC
- A threshold of 0xFFFFFFFF indicates that the cpu has neither flag
2022-01-02 21:35:46 +03:00
Megamouse 1c014299eb HLE: fix some types 2022-01-02 18:18:31 +03:00
kd-11 7c47b0029c gl: Fully drop alignment restriction for compressed textures
- This is just not part of spec, there is no enforcement for multiple of block size for width or height of s3tc compressed images.
- This restriction does indeed exist for ASTC and ETC but we're not using those formats.
2022-01-02 14:29:38 +03:00
Nekotekina cb2748ae08 Update ASMJIT (new upstream API) 2021-12-29 02:45:00 +03:00
Alex James 900d7df40f GDB: Rework to_hex/hex_to functions
macOS defines uint64 as an alias of unsigned long long. Drop the length
modifiers to resolve the warning on macOS:

rpcs3/rpcs3/Emu/GDB.cpp:107:37: warning: format specifies type 'unsigned long *' but the argument has type 'u64 *' (aka 'unsigned long long *') [-Wformat]
        sscanf_s(val.c_str(), "%" HEX_U64, &result);
                               ~~~~~~~~~~  ^~~~~~~

Also use std::from_chars to implement hex_to_{u8,u32,u64} instead of
sscanf.
2021-12-28 02:02:44 +03:00
clienthax 6837370a62 Handle SYS_NET_IPPROTO_IP get/setsockopt
Improve net logging.

Should allow latest vsh to load (Depending on windows version apparantly..)
2021-12-27 20:58:09 +03:00
Nekotekina d836033212 LLVM: enable some JIT events (Intel, Perf)
Made some related adjustments.
Currently incomplete.
2021-12-26 16:41:37 +03:00
Nekotekina 510041a873 rsx_methods.cpp: optimize compile time (120s to 10s)
Untemplate NV308A_COLOR
2021-12-26 14:40:21 +03:00
Nekotekina 8b4b6ba946 copy_data_swap_u32: build AVX-512 path 2021-12-26 14:40:21 +03:00
Nekotekina 599e00d6da BufferUtils: remove dead code (vertex streaming)
RIP. It won't be useful.
2021-12-26 14:40:21 +03:00
Nekotekina 3cd8891ab8 Re-refactor copy_data_swap_u32 again
Drop AVX2 path for now, since it usually operates on small data.
Rely on automatic SSE vectorization on recent compilers.
Side refactoring on JIT.h to workaround weird conflict issue.
2021-12-26 14:40:21 +03:00
kd-11 a9303acfdf rsx: Fix zclip w scaling 2021-12-26 12:50:31 +03:00
Eladash 6ee9d0f35f sys_rsx: Outlaw mapping sys_vm memory to RSX IO address-space 2021-12-25 02:22:49 +03:00
nastys a0040e6fb1
macOS: Implement texture converter for Metal (2) (#11289)
* macOS: Implement texture converter for Metal (2)

* Fix texture conversion formatting
2021-12-24 15:46:37 +03:00
kd-11 28d7af313b rsx: Remove noisy debug print 2021-12-24 15:13:33 +03:00
kd-11 39ef39aa4e rsx: Exercise caution when testing for overlaps in invalidated sections 2021-12-24 15:13:33 +03:00
kd-11 56dd09f4fe rsx: Handle floating point shenanigans
- If near and far clip are too close together, the API will not distinguish between them leading to out of bounds values
2021-12-22 22:08:53 +03:00
kd-11 de495952fd rsx: Enable fallback for devices without wide integer Z buffers 2021-12-22 22:08:53 +03:00
kd-11 1ce5349199 rsx: Remove zclip hackery
- Calculates precise Z value as requested by the game
- Works properly if the underlying Z format matches the PS3 1:1 but may cause minor problems otherwise
2021-12-22 22:08:53 +03:00
Nekotekina dcd011048d Implement "built_function" utility (runtime-generated assembly)
Similar to build_function_asm, but links without indirection.
Achieved by emitting code directly into a byte array.
2021-12-22 19:27:20 +03:00
Nekotekina 12e3c9e08b Use PAUSE in vk::query_pool_manager::get_query_result 2021-12-21 23:28:09 +03:00
Nekotekina 262ff01619 Use aligned stores in write_index_array_data_to_buffer
Ensure that target buffer is cache line aligned.
Improve stx::make_single to support alignment.
2021-12-21 23:28:09 +03:00
Nekotekina 76ccaf5e6f BufferUtils: refactoring
Optimize CPU capability tests for arch-tuned builds.
Separate streaming and non-streaming utilities.
Rewritten copy_data_swap_u32(_cmp) with AVX2 path.
2021-12-21 23:28:09 +03:00
nastys 47e4a95d8f
Fix remap_vector redefinition on macOS (#11271) 2021-12-21 10:36:09 +01:00
Nekotekina c0bafbc804 TSX: enable same data optimization for PUTLLC 2021-12-19 20:23:01 +03:00
Nekotekina 61c64d1060 TSX: refactoring M
Remove first stage 'optimistic' transactions.
2021-12-19 20:23:01 +03:00
Nekotekina 3e1e1a683c TSX/PPU: fix conditional store regression 2021-12-17 21:48:01 +03:00
Megamouse bf739aa156 Input: implement stick multipliers for keyboard 2021-12-17 17:21:44 +01:00
RipleyTom 43b7d1fe98 Add missing virtual destructors to some base class 2021-12-15 18:05:55 +03:00
Megamouse cc21d1b3cf cellSaveData: prevent some potential crashes due to corrupt files 2021-12-14 20:30:47 +01:00
nastys 08333e0876
macOS moltenVK support and SIGBUS handling (#11252) 2021-12-12 21:35:56 +01:00
Malcolm Jestadt 2f93df480b SPU LLVM: Disable affineqb shufb paths temporarilly 2021-12-10 19:32:10 +03:00
Megamouse f48c535802 cellAudio: Recover XAudio on failed initialization 2021-12-09 01:46:44 +01:00
Megamouse 5f7e5a9844 cellAudio: relax FAudio error handling 2021-12-09 01:46:44 +01:00
Megamouse 3f3b4bc363 cellAudio: recover Cubeb on failed initialization 2021-12-09 01:46:44 +01:00
Megamouse 68466f05b6 cellAudio: move some stuff to cpp 2021-12-09 01:46:44 +01:00
Megamouse e6b4655142 cellAudio: use members instead of config values 2021-12-09 01:46:44 +01:00
kd-11 d523f9cc6b rsx: Avoid skipping input mask checks due to static flow control 2021-12-08 23:58:32 +03:00
kd-11 7ca15c60bb rsx: Improve image aspect tests
- Replace old format-based detection with proper aspect test.
  Explicit image aspect has been available for a long time, but older
  code was not updated.
2021-12-08 23:58:32 +03:00
Nekotekina 8abd3e8bb4 PPU LLVM: fix bitcast usage to enable constant folding 2021-12-07 15:35:51 +03:00
Nekotekina 6730dc1dc4 LLVM DSL: print some debug info in get_const_vector<v128> 2021-12-07 13:21:24 +03:00
Nekotekina d6420b8803 Put std::hash specialization out of std 2021-12-07 13:04:10 +03:00
Megamouse a4ad0a9468 cellVideoOutConfigure: treat unknown aspect as AUTO 2021-12-06 20:50:57 +01:00
Malcolm Jestadt 0617e9e14b SPU LLVM: Fix vgf2p8affineqb usage
- Reverse the order of the bytes in the selection masks. Previously it was assumed that byte 0 would determine the output of bit 0, but byte 7 determines the output of bit 0.
2021-12-06 12:34:11 +03:00
Nekotekina e3e39e8de3 PPU LLVM: rewrite and optimize saturation bit
Use vector accumulator
2021-12-03 00:14:06 +03:00
Nekotekina 209b14fbac PPU LLVM: inline remaining vector instructions 2021-12-03 00:14:06 +03:00
Nekotekina 04c9d01390 PPU LLVM: modernize most vector instructions
Rewritten VSUM instructions:
VSUMSWS, VSUM2SWS, VSUM4SBS, VSUM4SHS, VSUM4UBS
2021-12-03 00:14:06 +03:00
Nekotekina c9d8e59dbf PPU LLVM: allow to drop setting SAT flag (optimization, module-wide)
Implement ppu_attr::has_mfvscr (partially, module-wide search).
If this instruction isn't found, allow to drop setting SAT flag.
It's based on presumption that only MFVSCR can retrieve SAT flag.
2021-12-03 00:14:06 +03:00
Nekotekina 86b194014b PPU LLVM: rewrite more packing instructions
Rewritten VPKUHUM, VPKUHUS, VPKUWUM, VPKUWUS.
Decoupled saturation test from sat pack pattern.
2021-12-03 00:14:06 +03:00
Nekotekina e7c827f73b PPU LLVM: rewrite some packing instructions
Rewritten VPKSHSS, VPKSHUS, VPKSWSS, VPKSWUS.
Decoupled saturation test from sat pack pattern.
2021-12-03 00:14:06 +03:00
Nekotekina abe498f35c PPU LLVM: modernize some code with new DSL
PPU: rewritten instructions VMHADDSHS, VMHRADDSHS
PPU: added optimized path for VPERM (ra=rb)
2021-12-03 00:14:06 +03:00
DH 49c02854f5 [rsx] reduce size of config structs 2021-12-02 21:36:57 +03:00
DH cccfb89aa0 [Config] Use std::less<> for std::map<...>
Reduces amount of string copies
[Utilities] fmt::replace_all: avoid creation of temporary strings
2021-12-02 21:36:57 +03:00
DH 2981867375 sys_spu_thread: Removed unused field access 2021-12-02 21:36:57 +03:00
kd-11 02832d9623
rsx: Add some sensible fallbacks (#11219)
* rsx: Add some sensible fallbacks

* Update GLPresent.cpp

* Update VKPresent.cpp

* Update rsx_utils.h

* Update rsx_utils.cpp
2021-12-02 16:02:08 +03:00
Eladash 0ab36ef44d
sys_spu: Implement SPU image segment info checks (#11211) 2021-12-02 13:17:10 +03:00
kd-11 9bb46aa944 rsx: Simplify unconstrained aspect ratio conversion
- There is a reason resolutions are defined by only a height variable.
2021-12-01 21:55:53 +01:00
Megamouse 474baca6d8 rsx: default initialize RsxDisplayInfo 2021-12-01 21:55:53 +01:00
Megamouse 88d0b7d135 cellAvconfExt: add some trivial param checks 2021-12-01 21:55:53 +01:00
Megamouse aea1ec2594 avconf: Add const to fxo references 2021-12-01 21:55:53 +01:00
kd-11 22a7b026e7 rsx: Fix image scaling
- Specifically fixes a corner case where double transforms are required.
  Technically this can be made more readable using transformation matrices:
  * M1 = transform_virtual_to_physical()
  * M2 = transform_image_to_virtual()
  * M3 = M1 * M2
  * Result = Input * M3
  But we don't use a CPU-side matrix library and it is not reasonable to do this on the GPU.
2021-12-01 21:55:53 +01:00
Megamouse c8d4a0dcdc VK/GL: honor game's aspect ratio when scaling 2021-12-01 21:55:53 +01:00
Eladash f16949c292
fs::file: always use strict reading mode for large reads (#11206) 2021-12-01 19:09:07 +03:00
Vestral e5005597fe CellAudio fixes 2021-11-29 20:43:00 +01:00
kd-11 38bfefcdfa vk: Fix incorrect mixed transfer modes for mipmapped VTC 2021-11-28 01:44:21 +03:00
kd-11 44fe6f6d39 rsx: Fix sloppy format matching test 2021-11-27 17:47:41 +03:00
RipleyTom 4fe17fcecf
sys_usbd improvements (#11202) 2021-11-27 01:49:35 +00:00
RipleyTom 5e158bd3f2 Impl sys_usbd_get_device_location 2021-11-25 00:53:00 +01:00
clienthax 2b924175aa
Emulated v406 usio 2021-11-24 21:59:48 +01:00
Vestrel 37a722cc1d
Audio backend improvements
Callback based audio update.
Upgraded common backend interface.
Added Cubeb backend.
Support multiple audio providers.
Dropped pulse, alsa, openal backends.
2021-11-24 19:41:05 +01:00
orbea a84223bdc6 rpcs3: Fix the DATADIR path for AppImage
Even when DATADIR is defined the other paths may still be correct.

Fixes: https://github.com/RPCS3/rpcs3/issues/11195
2021-11-24 19:14:06 +01:00
kd-11 4df1a938b1 Unused var 2021-11-24 16:02:24 +03:00
kd-11 94a3b1cfe8 rsx: Roll back some optimizations
- Just use RGB565 for all blit targets. Avoids really dumb transforms done by GPU hw.
- When X16 is used, all the channels get written to R channel alone. CmdBlit does perform format conversion!
- gl: Force image copy when blit is requested with compatible targets. Avoids format conversion issues.
2021-11-24 16:02:24 +03:00
kd-11 a21c6c4628 rsx: Fix handling of scaling requests for packed formats
- One does not simply interpolate RGB565 components as U16 data!
2021-11-24 16:02:24 +03:00
kd-11 58f0fa3ca5 gl: Enable handling of X16 blit targets 2021-11-24 16:02:24 +03:00
kd-11 97bd8f7bc1 rsx: Update sampler format class when inheriting mipmap slices/sections 2021-11-24 16:02:24 +03:00
clienthax 4c0ef37a5c Stub uvc camera init 2021-11-23 23:41:13 +01:00
AniLeo 1df8f52a9f vk: Remove lavapipe workaround
Current lavapipe version now has support for 
shaderStorageBufferArrayDynamicIndexing
2021-11-23 22:48:46 +01:00
shockdude f9434091c3
sys_usbd: make emulated turntable interrupt transfer as fast as possible
Also add missing mutex
2021-11-23 02:19:36 +00:00
orbea 59f253ba24 cmake: Use GNUInstalldirs 2021-11-22 21:45:55 +01:00
Eladash c52d447381 sys_fs: Place all path-format checks upfront, implement more checks 2021-11-22 21:03:07 +03:00
Eladash 524b065bc8 Debugger: Show PPU reservation data
Asterisk marks the offset of data that had been given to the guest PPU code.
2021-11-22 14:48:34 +03:00
Eladash f7b55ec8d4 lv2: Add missing reservation disowning in lv2_obj::yield 2021-11-22 14:48:34 +03:00