Commit graph

1125 commits

Author SHA1 Message Date
kd-11 ec2d529832 rsx: Separate loop interrupts from graphics state
- The interrupts are for multithreaded signals andmake the main loop run more aggressively for the next cycle
2022-05-20 16:29:27 +03:00
kd-11 93d93b4805 rsx: Fix typo 2022-05-20 16:29:27 +03:00
kd-11 e368453751 rsx: Rework loop interrupts a bit
- Reset backend interrupt in core handler
- Separate memory config interrupt from regular backend interrupt
2022-05-20 16:29:27 +03:00
kd-11 d0dc095c84 rsx: Silence some log spam 2022-05-20 16:29:27 +03:00
kd-11 9a1e6cc3e8 rsx: Implement RSX reports area access detection and optimize around it
- If nobody is reading RSX reports, do not be in a hurry to write them
- Requires HLE of some methods (cellGcmGetTimestamp) to function correctly
2022-05-20 16:29:27 +03:00
kd-11 e236ba4daf rsx: Improve lowered precision comparison emulation 2022-04-28 01:31:07 +03:00
kd-11 bca7b02ae9 Fix compressed pitch calculation 2022-04-19 22:58:29 +03:00
kd-11 e037b5c438 rsx: Handle in-place image swaps when locking data for WCB/WDB
- Rare, but possible if a surface address is switched from color to depth usage
- In such a case, deref the old image and ref the new one to avoid leaks
2022-03-29 12:35:32 +03:00
kd-11 d98d152d23 rsx: Fix leaking surface cache refs from texture cache
- Lock surfaces in use by texture cache to prevent complete deletion
- Remove discarded surfaces from the reprotect cache to avoid uaf
2022-03-28 19:55:34 +03:00
kd-11 e66d6a9399 Fix interpreter 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
kd-11 bc7ed8eaab rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +03:00
kd-11 1943d9819f rsx: Clean up surface cache routines around RTT invalidate 2022-03-10 20:43:58 +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
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 f382d54e9a gl: Remove pointless assert 2022-02-13 15:31:39 +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 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 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 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 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 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
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
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
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
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
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
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
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 58f0fa3ca5 gl: Enable handling of X16 blit targets 2021-11-24 16:02:24 +03:00
kd-11 f7eacf70ec rsx: Restore shader disassembler to working state 2021-11-05 23:55:07 +03:00
kd-11 c733e794de gl: Use real image dimensions when decoding compressed textures
- Image size is already correctly calculated using block dimensions
2021-10-27 12:30:43 +03:00
kd-11 99fc90648b gl: Disable shader interpreter if hardware does not support bindless textures 2021-10-27 12:30:43 +03:00
kd-11 2587545eed gl: Fix decoding of wide, swizzled textures
- Handle pre-byteswapped data (swizzled usually) in the compute-safe path
2021-10-27 12:30:43 +03:00
kd-11 e1d1d16227 gl: Alias register binding points a bit
- While aliasing is easy to break, it allows outdated hw to run
2021-10-10 16:15:28 +03:00
kd-11 2e22a0d9bb rsx: Optimize thread self-tests 2021-09-28 17:43:15 +03:00
kd-11 7b9fb7ad9c rsx: refactor rsx_utils a bit
- Move obviously standalone things to their own utility files
2021-09-28 17:43:15 +03:00
kd-11 6781eb7c76 rsx: Avoid calling get_system_time() every draw call 2021-09-28 17:43:15 +03:00
kd-11 3e09b97f58 rsx: Minor optimization; avoid preparing unused vertex streams
- Also discards unused program state variables
2021-09-28 17:43:15 +03:00
kd-11 dabfce5c82 rsx: Rework how depth/stencil initialization+clear works 2021-09-21 19:53:46 +03:00
kd-11 472efc08eb rsx: Implement precise ZCULL stats 2021-09-06 20:04:03 +03:00