Commit graph

313 commits

Author SHA1 Message Date
kd-11
4f8b5849b7 rsx: Take depth into account when calculating coverage 2022-01-23 00:03:03 +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
83026fd263 rsx: use coverage ratio to determine when too much data is overlapping 2022-01-07 22:55:27 +03:00
kd-11
92824b6729 rsx: Rework invalidation tagging 2022-01-07 22:55:27 +03:00
kd-11
7563655221 rsx: Bump surface removal threshold values
- It is much slower to attempt surface removal than to render duplicates on the host GPU
2022-01-07 22:55:27 +03:00
kd-11
39ef39aa4e rsx: Exercise caution when testing for overlaps in invalidated sections 2021-12-24 15:13:33 +03: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
a21c6c4628 rsx: Fix handling of scaling requests for packed formats
- One does not simply interpolate RGB565 components as U16 data!
2021-11-24 16:02:24 +03:00
kd-11
97bd8f7bc1 rsx: Update sampler format class when inheriting mipmap slices/sections 2021-11-24 16:02:24 +03:00
Megamouse
4d0330bf82 rsx: fix possible segfault 2021-11-16 09:31:16 +01:00
kd-11
5b0ef401f7 rsx: Fix sampling in X when 0 pitch is given
- A pitch of 0 still allows 1-dimensional addressing.
2021-10-31 14:32:42 +03:00
kd-11
78bcb0fd53 rsx: Do not reuse/destroy sections that have references held
- Avoids a situation where blit-dst and blit-src have overlapping ranges. Uploading blit-dst destroys blit-src and vice-versa.
  This is not the end of the world, but blit-src should be kept around until the operation is completed to avoid stale references!
2021-10-27 12:30:43 +03:00
kd-11
f745971cc8
rsx: Fix coordinate scaling for shadow access (#10668)
- For shadow2DProj the 3rd coordinate is actually the depth value, do not scale
2021-08-06 22:49:50 +01:00
kd-11
99b6963fab rsx: Improve unnormalized coordinate sampling
- Improve rounding when sampling nearest neighbour. This is mostly a problem with NVIDIA
- Implement unnormalized 3D sampling
2021-08-03 00:36:04 +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
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
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
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
568af756cc rsx: Fix expired sampler descriptors
- Rebuilding when strict mode is enabled was incomplete.
  The copy has to be redone if the source has been updated.
2021-06-06 15:37:47 +03:00
Ani
a49446c9e9
Replace gsl::span for std::span (c++20) (#7531)
* Replace gsl::span for std::span (c++20)
* Replace gsl::byte with std::byte

Co-authored-by: Bevan Weiss <bevan.weiss@gmail.com>
2021-05-30 17:10:46 +03:00
kd-11
9e62e98f79
rsx: Minor refactoring (#10358)
- Fix some misnomers.
- Allow finer grained control over texture section creation routines.
2021-05-27 23:44:07 +01: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
Nekotekina
160b131de3 types.hpp: implement smin, smax, amin, amax
Rewritten the following global utility constants:
`umax` returns max number, restricted to unsigned.
`smax` returns max signed number, restricted to integrals.
`smin` returns min signed number, restricted to signed.
`amin` returns smin or zero, less restricted.
`amax` returns smax or umax, less restricted.

Fix operators == and <=> for synthesized rel-ops.
2021-05-22 12:10:57 +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
a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Nekotekina
b3fb6d7d18 Add and fix -Wredundant-decls (GCC) 2021-03-23 22:48:57 +03:00
Nekotekina
53af2dbb3f Add/fix warning -Wignored-qualifiers (GCC/clang)
Fix simple_array::const_iterator as a part of it.
2021-03-09 03:09:50 +03:00
Nekotekina
87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Nekotekina
038148bf06 Fix almost all GCC warnings 2021-02-17 22:59:04 +03:00
kd-11
eba7d3b172 rsx: Add duplicate section detection when there are too many sections in the surface cache
- Check for useless sections.
  Helps in games that create a bunch of sections randomly for one-time use
2021-02-14 20:42:34 +03:00
kd-11
195fb1cf66 rsx: Improve texture cache invalidate
- Bunch of improvements
- Properly signal renderer to rebind textures!
- TODO: Range checks, should be pretty easy
2021-02-10 11:37:14 +03:00
kd-11
52acc23ecf rsx: Fix protection bug 2021-02-10 11:37:14 +03:00
kd-11
bf66c36ba4 rsx/texture_cache: Add support for reusing dirty images if possible
- Avoids a silly situation where a texture is discarded and an identical copy created immediately afterward.
  Unfortunately allocating memory blocks is really slow so avoid it as much as possible.
2021-02-10 11:37:14 +03:00
kd-11
1bad9a939f rsx: Refactor texture cache utils
- Also lays groundwork for optional hashed sections
2021-02-10 11:37:14 +03:00
Nekotekina
8a2a76da1e texture_cache: fix some warnings in AUDIT 2021-01-18 13:49:59 +03:00
Nekotekina
db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
Nekotekina
a8e0d261b7 types.hpp: more cleanup
Also fix compilation.
2020-12-22 19:08:09 +03:00
Nekotekina
fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
kd-11
035a76f26d Fix build 2020-12-16 10:10:06 +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
0ef5743261 rsx: Fix sampler descriptor updates for framebuffer resources
- Each desc manages its own lifetime now instead of relying on global timestamp check
- Fixes situation where same object remains active without update for long
2020-12-16 10:10:06 +03:00
kd-11
f83c2f0b6b rsx: Restructure and simplify some header include chains 2020-12-13 15:38:35 +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
eb66302907 atomic.hpp: replace std::atomic with atomic_t
Dual dependency is nothing good.
2020-12-07 17:13:12 +03:00
RipleyTom
af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
kd-11
2aa5c437e8 rsx: Fix upscaled image reconstruction
- Base the upscaling on the real source and not the "attr" parameter.
- In case of reconstruction, the source is much larger than the subslice in "attr"
2020-11-30 01:20:17 +03:00
Eladash
fefab50e06 Fix vm::range_lock, imporve vm::check_addr 2020-11-11 10:30:09 +03:00
kd-11
7ed82c0791 rsx: Always force typeless copy if memory is crossing aspect boundary 2020-09-22 12:19:54 +03:00
kd-11
9db97278f3 rsx: Lower error message to warning
- Mismatched texture handling is a TODO that will be handled with texturing rewrites
2020-09-19 01:55:59 +03:00