Commit graph

313 commits

Author SHA1 Message Date
kd-11
f0ed0285f3 rsx: Implement range-based subresource descriptor cache
- The previous address-based approach was pretty awful when it comes to invalidating
2019-10-17 18:18:00 +03:00
kd-11
fbb9ed4e25 rsx: Add explicit range to cached subresource descriptors 2019-10-17 18:18:00 +03:00
kd-11
c9e3a321b2 rsx: Fixup for surface cache scanning
- Fix regression when gathering cubemaps
2019-10-17 18:18:00 +03:00
kd-11
1ac976771c rsx: Add some texture search options for the cache
- Potentially optimizes texture cache searching using explicit options
2019-10-17 18:18:00 +03:00
kd-11
840b52fe80 rsx: Implement mipmap gathering from texture cache 2019-10-17 18:18:00 +03:00
kd-11
d6d8766f8d rsx: Refactoring
- Move some helper routines out of the cache core
- Prep for multi-layered image search
2019-10-17 18:18:00 +03:00
kd-11
4a19a2dd24 rsx: Explicity describe transfer regions for both source and destination blocks 2019-10-04 18:10:46 +03:00
kd-11
cc313b052f rsx: Improve hit testing when scanning for overlapping surfaces
- Calculate exact sizes when doing hit tests to avoid false negatives
- Defer page checking until actually require to do memory setup
- Introduce align2 helper to do non-pow2 alignments
2019-09-12 23:32:21 +03:00
kd-11
9842823a8c rsx: Check if memory actually exists when overallocating blit targets 2019-09-12 23:32:21 +03:00
kd-11
cd1345b6bb rsx: Do not use nul section if resolution scaling is active on a surface 2019-09-12 23:32:21 +03:00
kd-11
858014b718 rsx: Experiments with nul sink 2019-09-12 23:32:21 +03:00
kd-11
27af75fe71 rsx: Fixup for blit engine when moving inverted regions
- Properly calculate overlap range when sections are inverted
- Simplify transfer logic for inverted regions
2019-09-11 23:30:55 +03:00
kd-11
412c620b9d rsx: Allow sampling from shader_read resources for blit engine
- With harmonization between all texture types implemented, there is no difference between blit_engine_src and shader_read for supported formats
- Adds extra format filtering to ensure no conflicts when copying data
2019-09-10 16:54:02 +03:00
kd-11
75fcfac00e rsx: Modify find_cached_texture to respect gcm_format. Can pass 0 for "dont care" 2019-09-10 16:54:02 +03:00
kd-11
0af9685381 rsx: Deprecate surface_transform::argb_to_bgra which is no longer required.
- vulkan now uses native swizzle mapping for both surface and texture
2019-09-08 13:56:41 +03:00
kd-11
9dc06cef7f rsx: Do not include ro data when attempting to do section merge
- Avoids crazy situations like trying to merge from a 3d or cubemap in memory
2019-09-02 16:49:04 +03:00
kd-11
e55d216619 rsx: Workarounds for some buggy games
- Replace assert with log message until hardware testing confirms findings
2019-08-28 14:54:51 +03:00
kd-11
27aeaf66bc gl: Restructure buffer objects to give more control over usage
- This allows creating buffers with no MAP bits set which should ensure they are created for VRAM usage only
- TODO: Implement compute kernels to avoid software fallback mode for pack/unpack operations
2019-08-27 21:59:02 +03:00
kd-11
f9aea076ae rsx: Implement depth_buffer_float support.
- Since this is transparent to the application at all time, it only becomes a problem when doing memory transfer or DEPTH->RGBA conversion in shaders.
2019-08-26 20:03:31 +03:00
kd-11
c67c97844e rsx: Fixup for blit engine range calculations 2019-08-21 21:17:15 +03:00
kd-11
5d1b7eb945 rsx: Fix reference leaks in texture_cache<->surface_cache communication
- Properly commit orphaned blocks not invalidating existing cache structures
- Do not ignore overwritten objects when commiting as unprotected fbo. Avoids stale references to invalidated surface objects.
2019-08-21 21:17:15 +03:00
kd-11
dca29def5e rsx: Temporary workaround for race condition in blit engine 2019-08-18 20:45:48 +03:00
kd-11
5e299111cc rsx/vk: Restructure surface access barriers and implement RCB/RDB
- Implements render target data load (aka Read Color Buffer/Read Depth Buffer)
- Refactors vulkan surface barrier to be much cleaner.
- Removes redundant surface barrier invocations after doing a merged load
  from surface cache.
- Adds explicit access modes when gathering surfaces from cache.
2019-08-18 20:45:48 +03:00
kd-11
dfe709d464 rsx: Surface cache restructuring
- Further improve aliased data preservation by unconditionally scanning.
  Its is possible for cache aliasing to occur when doing memory split.
- Also sets up for RCB/RDB implementation
2019-08-18 20:45:48 +03:00
kd-11
fc09572648 rsx: Implement texel border decode
- Texel borders are no longer actually supported in modern APIs
- Removes the border texels and uses border color instead which is incorrect but should work fine
2019-07-11 13:22:13 +03:00
kd-11
c072c511a1 rsx: Add support for slice padding rows when gathering slices for cubemap/3d 2019-07-09 16:27:59 +03:00
Eladash
43f919c04b Fixup after #6143 (#6146)
vm::spu max address was overflowing resulting in issues, so cast to u64 where needed. Fixes #6145.
    Use vm::get_addr instead of manually substructing vm::base(0) from pointer in texture cache code.
    Prefer std::atomic_thread_fence over _mm_?fence(), adjust usage to be more correct.
    Used sequantially consistent ordering in semaphore_release for TSX path as well.
    Improved memory ordering for sys_rsx_context_iounmap/map.
    Fixed sync bugs in HLE gcm because of not using atomic instructions.
    Use release memory barrier in lwsync for PPU LLVM, according to this xbox360 programming guide lwsync is a hw release memory barrier.
    Also use release barrier where lwsync was originally used in liblv2 sys_lwmutex and cellSync.
    Use acquire barrier for isync instruction, see https://devblogs.microsoft.com/oldnewthing/20180814-00/?p=99485
2019-06-29 18:48:42 +03:00
kd-11
86119f58d6 rsx: Typo fix 2019-06-14 16:19:52 +03:00
kd-11
bca5f94b3f rsx: Add option to toggle MSAA 2019-06-14 16:19:52 +03:00
kd-11
ea8409dcfd rsx: Re-enable optional sample-to-pixel transformation 2019-06-14 16:19:52 +03:00
kd-11
4a5bbba277 rsx: Enable MSAA
- vk: Enable depth buffer resolve+unresolve
- vk: Add AMD stenciling extension support
- rsx: Temporarily disables MSAA-compatible hacks such as transparency AA
- TODO: Add paths to optionally disable MSAA
2019-06-14 16:19:52 +03:00
kd-11
0d906d6974 rsx: Remove surface aa_mode hacks 2019-06-14 16:19:52 +03:00
scribam
44265aa27d rsx: Apply Clang-Tidy fix "modernize-use-equals-default" 2019-06-12 15:11:52 +03:00
scribam
cba828384d rsx: Apply Clang-Tidy fix "modernize-pass-by-value" 2019-06-12 15:11:52 +03:00
scribam
81a3b49c2f rsx: Apply Clang-Tidy fix "readability-container-size-empty" 2019-06-12 15:11:52 +03:00
kd-11
507ec8252b vk: Refactor renderpass management
- Ensures the current renderpass matches the image properties even when a cyclic reference is detected
- Solves SDK debug output error spam due to mismatching layouts and renderpasses
2019-05-25 14:07:29 +03:00
kd-11
4037225e98 vk: Workaround for cyclic feedback loops
- Transition attachments to LAYOUT_GENERAL in case of a feedback loop
  - Fixes appearance of garbage along polygon edges in some
post-processing passes.
  - Also reverse this transition when rendering goes back to normal
2019-05-17 16:41:17 +03:00
kd-11
05eb1e9193 rsx: Fix zombie image references from inside the texture cache
- Do not add locked orphans to the flush_always cache! They will not remove their cache entries as they are not bound
2019-05-16 19:25:26 +03:00
kd-11
214bb3ec87 rsx: Always initialize memory unless it is guaranteed to be wiped 2019-05-16 19:25:26 +03:00
kd-11
88290d9fab rsx: Hack around using data regions as transfer targets 2019-05-16 19:25:26 +03:00
kd-11
3c7d8a1099 rsx: Minor texture/surface scanning optimization
- Also re-enable optimization in blit engine accidentally disabled during debugging
2019-05-16 19:25:26 +03:00
kd-11
9f0090772a rsx: Fix write tagging when comments are transferred in by blit engine 2019-05-16 19:25:26 +03:00
kd-11
88c20afd3a rsx: Implement unaligned surface inheritance with hierachial contribution
- Allows render targets to behave like stacked 3D views same as shader inputs are resolved
- Basically implements most of 'Read Color/Depth Buffers" option for 'free'.
- Allows splitting RTV/DSV resources if they are superceded by a partial surface
- Also allows intersecting new resources through the surface cache for proper inheritance from other scattered data
- TODO: Refactor bind_surface_as_rtt and bind_surface_as_ds to reduce asinine code duplication
2019-05-16 19:25:26 +03:00
kd-11
6b7cd458e3 rsx: Silence some diagnostics unless compiled with debugging options 2019-05-01 15:36:21 +03:00
kd-11
48cb265c2c rsx: Bounds check on local resource for atlas merge.
- Local resources can also have padded pitch dimensions and false-positives on range overlap tests
2019-05-01 15:36:21 +03:00
kd-11
ec9aa74008 rsx: Fix section base offset calculation for blit_dst targets which affects confirmed memory range
- Fixes flushes only writing partially to target memory
2019-05-01 15:36:21 +03:00
kd-11
df3b46a611 rsx: Improve texture sourcing and clipping when reverse scanning is enabled
- When reverse scanning, offsets are inverted and offset value of 0 is logically equivalent to an offset of -1
- Add an explicit message if clipping happens to avoid silent errors/bugs
2019-04-12 15:36:21 +03:00
kd-11
e4e86455f2 rsx: Fix temporary subresource caching behaviour
- Do not cache if a gathered subresource contains a bound RTT
- Change op to dynamic copy if parent is still bound
2019-04-09 13:40:54 +03:00
kd-11
3249000511 rsx: Improvements to texture scanning
- Removes CPU-only transforms that broke GPU-side code.
 -- Channels in GPU compute are laid out in cell-order, but CPU was uploading in favorable order and compensating with swizzles.
 -- This leads to 2 different layouts depending on the location of the data (CPU vs GPU)
- Implement R8G8_R8B8 interleaved format decode
- General improvements
2019-04-09 13:40:54 +03:00
kd-11
366e4c2422 rsx: Preliminary support for format conversions using typeless resolve 2019-04-09 13:40:54 +03:00