Commit graph

3362 commits

Author SHA1 Message Date
kd-11
abd8bbd6ef vk: Allocate enough scratch memory for GPU deswizzle
- Forgot to take alignment into account.
2021-07-27 10:52:21 +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
6a9d1edee1 vk: Fix use-after-free hazard by checking if we're faulting from within the texture cache
- If we're using the texture cache, DO NOT delete resources.
2021-07-25 20:55:09 +03:00
kd-11
69bdbe97a8 vk: Make use of multi-pool memory types 2021-07-25 20:55:09 +03:00
kd-11
de7ed1cbe9 vk: Scrap minimum scratch buffer size and just allocate what is requested. 2021-07-25 20:55:09 +03:00
kd-11
7d3bbd3cf7 vk: Dynamically select panic boundaries based on resolution scale 2021-07-25 20:55:09 +03:00
kd-11
59e7379010 vk: Implement heap aggregation
- Aggregate heaps of same type under one object and allow allocator to try each matching type.
2021-07-25 20:55:09 +03:00
kd-11
0502f7881f vk: Disable async texture streaming on all NVIDIA cards 2021-07-20 23:00:00 +03:00
Megamouse
50354253c8 replace some random Emu.Pause with fatal errors 2021-07-20 19:47:00 +02:00
Eladash
6f901636bf rsx: Fix vertical windows' clip 2021-07-18 13:44:23 +02:00
kd-11
0d87d909c6 vk: Fix double-spill for invalidated resources 2021-07-17 21:28:11 +03:00
kd-11
2d4df57d87 vk: Fix nul deref in spill code
- Restores code lost in a rebase
2021-07-17 21:28:11 +03:00
kd-11
b7df539871 vk: Fix null deref in texture cache when dumping temporary storage 2021-07-17 21:28:11 +03:00
kd-11
d53f2f10fb rsx/vk: Improve recovery during OOM situations
- Do not spill when running on IGP with only one heap as it will just crash anyway.
- Do not handle collapse operations when OOM. This will likely just crash and there are better ways to handle old surfaces.
- Spill or remove everything not in the current working set
- TODO: MSAA spill without VRAM allocations
2021-07-17 21:28:11 +03:00
kd-11
aaac4c1bde Clang workaround for c++20 non-compliance 2021-07-15 18:05:35 +03:00
kd-11
974a3c8807 Fix linux build 2021-07-15 18:05:35 +03:00
kd-11
369f1132f3 Formatting fixes
- Non-functional stuff, move along
2021-07-15 18:05:35 +03:00
kd-11
2524c35638 vk: Improve handling of texture cache temporary resources
- Temp resources from the texture cache are used to hold composite objects being sent to the GPU and can waste a lot of memory.
- Remove them if we run out of memory as they can linger around for a long time.
2021-07-15 18:05:35 +03:00
kd-11
d906ccc77e vk: Switch on the new VRAM management system 2021-07-15 18:05:35 +03:00
kd-11
a2f93b0696 rsx: Implement a simple cache eviction routine
- Can remove all non-essential textures from the cache except those passed as an exclusion list
2021-07-15 18:05:35 +03:00
kd-11
77c9dff054 vk: Minor whitespace fix
- Non-functional formatting and warning fixes
2021-07-15 18:05:35 +03:00
kd-11
09f9f21261 vk: Add overallocation quota for texture cache 2021-07-15 18:05:35 +03:00
kd-11
5f6d1644cf vk: Refactor VkTextureCache by moving most of the code to cpp file
- Makes adding next set of changes easier
2021-07-15 18:05:35 +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
000414c47d vk: Refactor surface cache by moving code to cpp file 2021-07-15 18:05:35 +03:00
kd-11
2ffa8f4623 vk: Rename rsx::vk_render_targets to vk::surface_cache
- Makes some changes much easier going forward to pull in vk-specific stuff into vk namespace.
- TODO: The same thing needs to happen with GL
2021-07-15 18:05:35 +03:00
kd-11
53c9fb3e00 vk: Improve memory load balancing and reporting
- Track pool usage
- Take allocation percentages into account when making decisions on whether there is overloading or not
2021-07-15 18:05:35 +03:00
kd-11
342b25d00e vk: Expose memory heap sizes to the runtime.
- This will help to make decisions regarding VRAM utilization instead of relying on budget blindly
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
71a5e5333a rsx: Fix invalid reference when purging unlocked sections 2021-07-15 18:05:35 +03:00
kd-11
194bfc54d1 rsx: Implement dynamic vertex offset updates
- Vertex offsets can be updated mid-draw to dynamically render different meshes without breaking up draws
2021-06-30 10:07:33 +03:00
kd-11
2c7c1c501d rsx: Implement support for extended vertex programs
- Some games are kinda pushing it with RSX register space and spilling VP data into adjacent unused space.
2021-06-28 10:52:05 +03:00
Eladash
dcb2e8cd9e rsx: Improve VBLANK accuracy 2021-06-27 16:39:08 +03:00
Kilowog01
d59707bc4b
Trophy notification improvements (#10482)
* Makes the text more similar to the original PS3 trophy notification.
2021-06-25 16:25:44 +03:00
kd-11
926fa73fee vk: Remove unused input from attachment clear pass 2021-06-25 14:45:36 +03:00
kd-11
cd8cb9cced rsx: Don't leak data during partial clears
- Partial clears either in active clear channels or scissor region must get barrier inserts to load previous data.
- Fixes some incorrectly discarded data during clear where data in untouched/uninitialized channels is lost.
2021-06-25 14:45:36 +03:00
Eladash
bbaa93c846
RSX Cache: Prevent crash on failure to obtain cache directory (#10474) 2021-06-19 16:57:07 +03:00
kd-11
9fadd48ea3 vk: Ensure async scheduler thread is never auto-spawned by fxo
- This thread is a resource hog for design reasons.
2021-06-17 00:43:20 +03:00
kd-11
4bf9700562 rsx: Remove unused variable leftover from refactoring 2021-06-17 00:43:20 +03:00
kd-11
966aec7ad7 rsx: Resync excluded memory regions to avoid memory tests failing after flush events
- This is a mostly correct fix, but a corner case exists that can leak old data to the surface cache
2021-06-15 15:42:16 +03:00
kd-11
78972cd611 rsx: Refactor surface inheritance logic 2021-06-15 15:42:16 +03:00
kd-11
c3415bcff2 rsx: Fixup for byte order when passing data via vertex registers that are not inline arrays (register vertex data and push buffers) 2021-06-14 23:20:35 +03:00
kd-11
d3ff67ffb5 rsx: Pass vertex attributes streamed via register write in PS3-correct format
- TODO: Optimize this, we can avoid the double bswap in FIFO and then in attribute push
  Not very important since nobody is doing register push in high-performance path.
2021-06-14 10:24:03 +03:00
Eladash
76bfe54c7e Improve bitwise serialization trait 2021-06-11 16:54:17 +03:00
kd-11
cd6552d344 vk: Properly destroy renderpass cache 2021-06-09 22:35:50 +03:00
kd-11
20bd723e7c rsx: Add floor workaround for GPUs with rounding issues
- Mainly affects nvidia where x/w * w can sometimes return a value smaller than x.
  In such conditions, floor(x) will return x-1 if x is an integer which is horribly wrong and exaggerates minor precision drift to great proportions.
2021-06-09 10:55:55 +03:00
Eladash
c918f395b9 Make rsx::simple_array compatible with serialization 2021-06-08 19:29:46 +03:00
Eladash
2169e8d935 Implement serialization.hpp, remove cereal submodule
Bump RSX capture version, use new serializer.
2021-06-07 16:28:42 +03:00
kd-11
ddbe496097 rsx: Fix depth/color mismatch resolve in texture cache
- Sometimes we need a depth texture but only a color texture is available.
2021-06-07 01:03:49 +03:00
kd-11
3f80d0b7d8 rsx: Fix surface deduplication crash 2021-06-07 01:03:49 +03:00