Commit graph

62 commits

Author SHA1 Message Date
kd-11 7fa521a046 rsx/vk: Redesign how conditional rendering hints work
- Pass a sync address to the backend
- Ignore the hint if the query is running in lazy mode
- Do not submit CBs too close to each other. Submits are expensive
2022-05-20 16:29:27 +03:00
kd-11 b645a7faf5 vk: Rebuild swapchain in case of unexpected errors during present 2022-03-28 19:55:34 +03:00
kd-11 bc7ed8eaab rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +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 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 b791d90b35 vk: Rewrite command buffer chains 2022-02-21 23:58:01 +03:00
kd-11 2331dc3256 vk: Keep the total number of allocated samplers under control 2022-01-20 19:21:24 +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 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
Megamouse 88bb26afb4 vk: make upscaler dynamic
The config option was marked as dynamic, but was never actually changed ingame
2021-11-06 01:02:54 +01:00
kd-11 456b649b19 vk: Do not force check for successful texture cache load
The following set of conditions can fail
1. We hit a RTT owned texture
2. The texture is invalidated (failed memory integrity test) and set to write/read-through

In this situation, RTT overlap check will skip this surface, and a match can be found in texture cache if WCB/WDB is enabled.
The incoming hit however has no managed payload. This is expected behavior, the search should load from CPU.
2021-08-06 22:07:23 +03:00
kd-11 d0a824996b vk: Add basic support for FSR 1.0
- Only implemented for image upscaling.
- Disabled by default. Emulators cannot ensure upscalers are injected at the right rendering step.
- GUI integration not implemented.
2021-08-06 17:18:48 +03:00
kd-11 13abe785a9 vk: Try to spread memory usage evenly across compatible types if possible
- Avoids running into budget constraints if you just dump everything into one heap
2021-07-27 10:52:21 +03:00
kd-11 c18e5e07cc vk: Implement VRAM spilling
- The idea is to shift memory to "shared graphics memory" when VRAM is running out
2021-07-15 18:05:35 +03:00
kd-11 88abf3a6ba vk: Introduce the concept of VRAM allocation pools
- Each buffer or image has to declare which pool it belongs to. This will aid with memory management down the line.
2021-07-15 18:05:35 +03:00
kd-11 f85881c18c vk: Enable use of input attachments 2021-06-01 12:54:10 +03:00
Megamouse 83d3658ef0 scale debug overlay based on current dpi settings
Depending on the dpi settings, the debug overlay was almost unreadable.
I also took the liberty to refactor some redundant client size calls and to add some margin to the left of the debug text.
2021-05-26 20:31:29 +02:00
Nekotekina 2491aad6f2 types.hpp: implement min_v<>, max_v<>, SignedInt, UnsignedInt, FPInt concepts
Restrict smax to only work with signed values for consistency.
Cleanup <climits> includes.
Cleanup <limits> includes.
2021-05-23 19:43:51 +03:00
kd-11 e3944bc67f rsx: Handle transfer_read differently from transfer_write
- Transfer writes are expected to clobber surface cache contents. Do NOT reload from CPU memory for writes.
- TODO: During transfer write to surface cache objects, lock memory if it was unlocked to avoid silly problems.
2021-05-09 13:07:47 +03:00
Megamouse cbd895a29c
Move code to cpp (#9938)
* GL: move GLOverlays code to cpp
* GL: move GLCompute code to cpp
* VK: move VKOverlays code to cpp
* VK: move VKCompute code to cpp
2021-03-10 00:58:08 +01:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
kd-11 c2cbc62be6 vk: Refactor some uber-headers
- VKHelpers was the rug everything was swept under for a long time.
  This commit essentially deprecates its usage across most of the backend.
2021-01-10 12:04:31 +03:00
Megamouse 11db3151ae
VK refactoring Part 2 (#9542) 2021-01-05 10:49:03 +03: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 fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +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
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +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 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
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +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
kd-11 bca3a3f4ed
vk: Open CB before doing frame cleanup so that callbacks work (#9041) 2020-10-10 10:02:55 +01:00
kd-11 65ead08880 rsx: Refactor and improve image memory manipulation routines 2020-08-27 12:52:28 +03: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 b0c7ca6d1f vk: Improve video memory manager to attempt recovery in out of memory situations 2020-07-25 14:48:11 +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
kd-11 1677618c75 rsx: Implement stippled rendering 2020-05-30 14:47:10 +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
Megamouse 8f0af6a6fe rsx/interpreter: merge shader settings
- merge disable_asynchronous_shader_compiler and interpreter_mode
- removes disable_asynchronous_shader_compiler setting
- Adds the resulting settings as radio buttons to the gui tab
2020-04-30 15:02:59 +03:00
kd-11 2281c4f662 Fix build 2020-04-30 15:02:59 +03:00
kd-11 b4bf48c33b vk: Integrate shader interpreter 2020-04-30 15:02:59 +03:00
Megamouse cf229a8e9f some more dynamic settings 2020-04-15 18:25:25 +02:00
kd-11 70f2577b9e vk/gl: Use best-fit semantics when scanning texture cache for flippable images
- Allows sourcing flip data from the blit engine resources which avoids expensive flush and re-upload
2020-03-07 16:58:35 +03:00
kd-11 1725f7a34b rsx: Add anaglyph 3D filter 2020-03-07 16:58:35 +03:00
kd-11 6e3406b3f5 video: Allow selection of 3D stereo resolutions 2020-03-07 16:58:35 +03:00