Commit graph

217 commits

Author SHA1 Message Date
kd-11 5907a6a67d gl: Fix crash in texture cache due to incorrect surface handling 2025-02-11 02:28:31 +03:00
kd-11 042be7d7d1 gl: Implement basic MSAA rendertarget support
- Enough to get some popular titles working.
- Some depth resolvers still need work
2025-02-11 02:28:31 +03:00
kd-11 99ace42447 gl: Enforce full image creation argument declaration
- Closes a class of bugs caused by implicit conversion of similar argument types
2025-02-11 02:28:31 +03:00
kd-11 808f67a3b2 gl: Stub dynamic sample count when creating textures 2025-02-11 02:28:31 +03:00
kd-11 681debd8f6 gl: Finalize host labels implementation 2024-10-23 16:33:44 +03:00
kd-11 826f805902 rsx: Use a proper struct to wrap around channel remap operations 2024-10-03 15:02:09 +03:00
oltolm 862727e9bf simplify template code like std::invoke_result<T>::type 2024-04-21 18:15:17 +03:00
kd-11 e5c831a800 rsx/vk: Fix GPU tile encoding
- Decoding also needs some love, but currently WIP
2024-02-10 15:15:02 +03:00
kd-11 6c33c38c08 rsx: Fix RSX tiling when using optimized DMA views 2024-01-01 19:44:47 +03:00
kd-11 51fc193395 rsx: De-spaghettify nv3089::image_in
- This function was a disaster with random code added in without much thought over a decade.
- Restructures the logic into decode and transfer steps for easier management.
2023-12-26 18:30:00 +03:00
kd-11 4decad6f6b rsx: Force compatibility checks when applying fast-path optimizations 2023-07-04 09:31:51 +03:00
kd-11 8f98e572e1 rsx: Use designated initializer for the dangerous copy_region_descriptor type
- We need to move more dangerous braced initializations to c++20
- Also adds a base address variable which will come in handy
2023-07-04 09:31:51 +03:00
kd-11 b788e05396 rsx: Implement GPU copy ellision through coordinate transform
- TODO: Some corner cases still exist where format may not be a match after a cache merge.
2023-07-04 09:31:51 +03:00
kd-11 90cf47cdce rsx: Handle some corner cases in surface locking 2022-12-17 20:16:58 +03:00
kd-11 bf96cbe980 rsx: Fix const RTV/DSV cast from texture cache 2022-12-17 20:16:58 +03:00
kd-11 a05e3f02b8 rsx: Avoid expensive protection scan by sharing some data between surface and texture cache 2022-12-17 20:16:58 +03:00
kd-11 df46e5137c gl: Fix texture reconstruction logic
- Use correct target types
- Fix key generation to apply differently for each target type
2022-10-07 11:53:34 +03:00
kd-11 82bac4173e gl: Reuse scratch images 2022-07-18 18:58:22 +03:00
kd-11 e95084f138 gl: Use DSA for imageview configuration and avoid needless bind operations 2022-07-18 18:58:22 +03:00
kd-11 9fc6382909 gl: Finalize BGRA storage format internals
- Performance is terrible but it works properly now
2022-07-13 02:09:58 +03:00
kd-11 bb5ce67d57 gl: Handle corner cases for CopyBufferToImage
- Handle 3D textures and cubemaps
- Handle writing to mip > 0
2022-07-13 02:09:58 +03:00
kd-11 35ef19cfc8 gl: Refactor the rest of GLHelpers 2022-07-13 02:09:58 +03:00
kd-11 09824a718f gl: Separate BGRA8 storage from RGBA8 2022-07-13 02:09:58 +03:00
kd-11 a421270c19 gl: Use new scratch buffer system 2022-06-03 11:54:09 +03:00
kd-11 74696d2e44 gl: Commit to a consistent global state 2022-05-31 23:34:14 +03:00
kd-11 78746fdb6f gl: Commit to using DSA for internal buffer management
- Gets rid of spammy BindBuffer calls on every draw
2022-05-31 23:34:14 +03:00
kd-11 d0dc095c84 rsx: Silence some log spam 2022-05-20 16:29:27 +03:00
kd-11 e037b5c438 rsx: Handle in-place image swaps when locking data for WCB/WDB
- Rare, but possible if a surface address is switched from color to depth usage
- In such a case, deref the old image and ref the new one to avoid leaks
2022-03-29 12:35:32 +03:00
kd-11 d98d152d23 rsx: Fix leaking surface cache refs from texture cache
- Lock surfaces in use by texture cache to prevent complete deletion
- Remove discarded surfaces from the reprotect cache to avoid uaf
2022-03-28 19:55:34 +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 7ca15c60bb rsx: Improve image aspect tests
- Replace old format-based detection with proper aspect test.
  Explicit image aspect has been available for a long time, but older
  code was not updated.
2021-12-08 23:58:32 +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 58f0fa3ca5 gl: Enable handling of X16 blit targets 2021-11-24 16:02:24 +03:00
kd-11 6781eb7c76 rsx: Avoid calling get_system_time() every draw call 2021-09-28 17:43:15 +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 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 b3fb6d7d18 Add and fix -Wredundant-decls (GCC) 2021-03-23 22:48:57 +03:00
kd-11 bec91aab7b rsx: Relax inheritance checks a bit
- It is not a fatal error for a texture to be defined where a framebuffer once existed.
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 b7bf316c1a Don't randomly include "stdafx.h"
It's file for precompiled headers.
Include what is used, don't rely on transitive includes.
2020-12-22 14:32:30 +03:00
Megamouse 066e53da55 minor cleanup 2020-12-19 08:33:53 +01: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
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
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
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina 605d57c541 sys_event: cleanup (replace vm::temporary_unlock)
Also made minor changes in sys_rsx.cpp.
Removed unused exception std headers.
2020-10-30 17:49:07 +03:00
kd-11 2e88924cb9 rsx/gl: Refactoring and cleanup
- Fix incorrect memory requirement calculation for D32FS8X24_PACK64 data type on GL
- Removes a lot of spaghetti code in GL backend from years of accumulation
- Retires several now-useless methods from RSX util toolbox
2020-09-08 13:53:06 +03:00
kd-11 85e5b077f7 gl: Overhaul upload and download routines for textures to go through shared image_to_buffer and buffer_to_image routines.
- This automatically adds support for depth float textures as well
2020-09-07 18:25:54 +03:00