Commit graph

313 commits

Author SHA1 Message Date
kd-11
d3898fda57 rsx: Release misconfigured texture memory before attempting reupload 2020-09-19 01:55:59 +03:00
kd-11
65ead08880 rsx: Refactor and improve image memory manipulation routines 2020-08-27 12:52:28 +03:00
kd-11
794378d5e9 rsx: Do not create depth textures as blit engine targets. 2020-08-27 12:52:28 +03:00
kd-11
4df933275b rsx: Propagate raster type of fbo sourced data throughout the pipeline.
- Tracks which kind of raster was done (Z-ordered vs linear) throughout the application.
- This allows to identify if data is in the expected format or not.
2020-08-02 16:14:11 +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
42a9ac9e6c rsx: Brute-force removal of superseded surfaces 2020-07-16 19:11:26 +03:00
kd-11
632af8d723 rsx: Support partial texture descriptors
- It is safe to declare w > pitch and it works as long as sampling inside the legal 2D area is obeyed.
2020-07-10 15:26:07 +03:00
kd-11
bd41a108d8 nv3089: Account for subpixel addressing
- Those strange offsets noted in some games seem to match to subpixel addressing.
  For example, when scaling down by a factor of 4, a pixel offset of 2 will end up inside pixel 0 of the output
2020-05-24 11:31:37 +03:00
Mrlinkwii
c22d778143
Spelling fix in texture_cache.h (#8219)
heurestic_end -> heuristic_end
2020-05-14 21:42:21 +03:00
kd-11
310f367fb1
rsx: Improve blit engine memory validation (#8215)
- In blit engine logic there is a tendancy to over-allocate so as to avoid having to sticth together textures later
- Sometimes this can lead to out of bounds access and crash applications, so memory must be validated
2020-05-14 12:57:58 +01:00
scribam
2e397e38a4 Typos 2020-04-14 17:06:58 +03:00
scribam
f37adc4188 Add fallthrough attribute 2020-04-14 17:06:58 +03:00
kd-11
7025985c0d rsx: Improve section scanning when updating surface cache resources in blit engine. 2020-03-15 16:51:23 +03:00
kd-11
84a542fbce rsx: Blit engine improvements
- Detect writes to the display output memory and handle it specially.
  It already defines a known 2D region.
- Try and detect situations where raw transfers would be of benefit.
2020-03-08 10:30:13 +03:00
kd-11
54775d91dc rsx/blit-engine: Account for a rare corner case
- It is possible to have a RTV<->DSV transfer with compatible-sized formats.
  Mark the depth size as typeless in such a situation to avoid crossing the aspect barrier with the API.
2020-03-04 21:21:59 +03:00
Nekotekina
972e0ab31d Remove -Wno-reorder and make it an error 2020-02-21 15:20:34 +03:00
Megamouse
fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +03:00
kd-11
3787108ee7 rsx: Typo fix in audit condition 2020-02-10 21:48:35 +03:00
Eladash
b7043ce000 Make rsx::get_address report caller location 2020-02-08 22:18:56 +03:00
Nekotekina
c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina
1a78e0e80c Make RPCS3 compile in C++2a mode 2020-02-04 23:43:55 +03:00
kd-11
9d9b5c4d66 rsx: Rewrite coverage test to take sum of areas into account.
- TODO: A proper sweep algorithm to calculate sum of overlapping rectangles
2020-02-04 16:20:52 +03:00
kd-11
b9ec012922 rsx: Allow for proper data checks when WCB/WDB is enabled 2020-02-04 16:20:52 +03:00
kd-11
7d2ed9200d rsx: Remove sections that are wholly inherited by new blocks
- Allows sections reclaimed by the surface store due to overlap/inheritance to be identified and removed.
- Additionally, potentially lowers the number of flushes required per block with multiple overlaps improving efficiency and theoretically performance.
2020-02-01 15:14:29 +03:00
Nekotekina
15391f45d0 Modernize RSX logging (rsx_log variable) 2020-02-01 11:52:22 +03:00
kd-11
1206a5d4b7 rsx: Tweak blit engine heurestics a bit
- Reject writes to RTT if the source data is of unknown origin.
  non-RTT data and only 1 line in length is suspicious and often GPU data like programs or other rendering inputs.
2020-01-29 12:54:06 +03:00
kd-11
79216917b3 rsx: Workaround for broken rtt resampling
- Avoids WCB requirement for now to keep res scaling working correctly.
- TODO: Fix this properly
2020-01-26 13:58:48 +03:00
kd-11
44f2cacf7b rsx: Blit engine tuning
- Attempt to identify blit operations that will be flushed immediately
after and just do them on CPU instead if the transformation is trivial.
- If only a single blit section is contributing to an atlas merge op, the
threshold should be 100%. The only acceptable result here is a
truncation.
2020-01-26 13:58:48 +03:00
kd-11
7a275eaa3a rsx: Fix incomplete blit operations getting used as texture inputs
- Raise passing 'score' from 50% to 90% to filter out very incomplete
merge operations.
- Catch unfit sections passing the match test; possible for blit_dst
data but will likely be always harmless. Disabled in release builds by default.
2020-01-26 13:58:48 +03:00
kd-11
db014d8a58 rsx: Fix section length calculations when generating new blit targets. 2020-01-16 17:57:31 +03:00
kd-11
309251ce7a rsx: Touch locked dst memory after blit transfer operations in case it is locked by WCB/WDB 2020-01-16 11:12:08 +03:00
Nekotekina
377e7d2a73 C-style cast cleanup VI 2019-12-04 17:56:22 +03:00
kd-11
429a76a140 rsx: Remove redundant check 2019-11-23 16:11:18 +03:00
kd-11
41e7d2aa0a rsx: Select correct image aspect for blit engine targets. 2019-11-19 13:18:15 +03:00
kd-11
41c3180276 rsx: Fix invalid format checks for DMA sections which are typeless 2019-11-19 13:18:15 +03:00
kd-11
9dab0575fa rsx: Add missing format check for the RTV<->DSV transfer case
- TODO: Rewrite resource handling routines
2019-11-18 13:17:00 +03:00
kd-11
4a0e1c79ed rsx: Improve format validation for blit engine
- Check all possible cases where format mismatch is possible.
- Warn if a slow path is going to be taken. Should help with future
optimizations.
2019-11-18 13:17:00 +03:00
Emmanuel Gil Peyrot
f76720ceb0 Remove extraneous ::narrow<int>() calls
GSL’s gsl::span didn’t use the correct type for its index_type, which is
why they were needed.
2019-11-09 19:30:06 +01:00
Emmanuel Gil Peyrot
ef368c5171 rsx: Replace gsl::byte with C++17’s std::byte 2019-11-09 19:30:05 +01:00
kd-11
aa3eeaa417 rsx: Separate subresource_layout:dim_in_block and
subresource_layout::dim_in_texel

- These two are not always linked when working with compressed textures.
The actual texels extend past the actual size of the image if the size
is not aligned. e.g if height is 1, the real height is 4, but its not
possible to determine this from the aligned size. It could be 1, 2, 3 or
4 for example.
- Fixes image out-of-bounds writes when uploading from CPU
2019-10-29 20:03:54 +03:00
kd-11
d04241ad25 rsx: Allow compressed textures to be unaligned in size
- Align based on row length but let the texture itself be of arbitrary dimensions
2019-10-28 15:20:45 +03:00
Eladash
945abcc6cd rsx: Align down index array offset
* Also use improved to_be_t<> template (recetly ignoring one byte long types) for vm gsl::byte referencing, remove redundent narrow<> cast (same type)
2019-10-22 13:45:09 +03:00
kd-11
09de3b7974 rsx: Tweak behaviour of the "Use GPU texture scaling" option
- If either source data or dest is a render target, do image operations on the GPU same as before
- If swizzle is desired, use CPU fallback
- If no scaling and no format conversion is required, use CPU fallback
- If scaling is desired and the transfer target is in local memory, use the GPU
- When doing trivial copies, use the routine in rsx_methods instead of
  duplicating code. Also has the benefit of better range checking.
2019-10-20 21:38:40 +03:00
kd-11
868547aec8 rsx: Minor improvement to fbo region invalidation
- When commiting a block as fbo, keep blit_dst data as well.
- Avoids removing (and losing data from) blit targets that just happen to share a page with a framebuffer.
2019-10-20 21:38:40 +03:00
kd-11
996534c559 rsx: Fixup for aspect mismatch 2019-10-20 15:25:07 +03:00
kd-11
404073c74a rsx: Force-align compressed formats to 4x4 texel blocks and disable 1D compressed textures.
- The PS3 allows defining 1D compressed images but this obviously doesn't work well on desktop.
2019-10-18 14:46:37 +03:00
kd-11
eff4e95c99 rsx: Minor cache fixup for cyclic references.
- Logic was broken by mipmaps PR. Do not issue a texture barrier if a temp copy is being done.
2019-10-18 14:46:37 +03:00
kd-11
eee2237e19 rsx: Track uncached cache resources
- Uncacheable resources can be reused as soon as they're made visible to the draw call.
- Since they're likely to be reused every draw call until the shader changes, it is important to reuse as much as possible
2019-10-18 14:46:37 +03:00
kd-11
decf9cfcf6 rsx: Notify the backend to release or delete temporary surfaces after we're done with them. 2019-10-18 14:46:37 +03:00
kd-11
e166dbccc8 rsx: Fix visibility of blit destination targets 2019-10-17 18:18:00 +03:00