Commit graph

100 commits

Author SHA1 Message Date
kd-11 2d5d5746d1 gl: Harmonize format conversion values
- Return values that are true to the PS3, not the host.
2022-02-13 15:31:39 +03:00
kd-11 ffe00e8619 gl: Clean up format bitcast checks and register D32F type for FORMAT_CLASS16F
- Also hides a dangerous export for vulkan, same as GL
2022-01-26 12:08:36 +03:00
kd-11 7c47b0029c gl: Fully drop alignment restriction for compressed textures
- This is just not part of spec, there is no enforcement for multiple of block size for width or height of s3tc compressed images.
- This restriction does indeed exist for ASTC and ETC but we're not using those formats.
2022-01-02 14:29:38 +03:00
kd-11 c733e794de gl: Use real image dimensions when decoding compressed textures
- Image size is already correctly calculated using block dimensions
2021-10-27 12:30:43 +03:00
kd-11 2587545eed gl: Fix decoding of wide, swizzled textures
- Handle pre-byteswapped data (swizzled usually) in the compute-safe path
2021-10-27 12:30:43 +03:00
kd-11 6ac9e6f9c4 gl: Add some debug visualization to internally verify consistency 2021-06-05 21:02:14 +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
Megamouse a50be7a912 GL: resharper findings (too lazy for const functions) 2021-04-30 08:23:16 +02:00
kd-11 06dc99ab85 rsx: Fix decompression of RB_RG textures.
- Removes several subtle hacks that hid the real issue.
  A compressed texture has more than one texel per 'block'.
2021-04-11 21:36:36 +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 bcb69a54b2 gl: Avoid type shenanigans used to fake byteswap for select formats
- Just use the reversed type instead.
  The new uploader backend combines swizzle+swap so there is no need for tricks anymore
2021-01-24 14:24:55 +03:00
kd-11 7766076042 rsx/vk: DMA stuff 2021-01-24 14:24:55 +03:00
Eladash 7db13fdeff rsx: Move Anisotropic Filter Override to RSX state 2020-12-30 15:37:21 +03: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
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina b382d3b3e9 Remove ASSUME macro
It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
2020-12-10 14:08:02 +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
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
kd-11 220e86bbd1 gl: Accelerate D24X8_UINT operations
- Adds compute decoding for D24X8_UINT on both download and upload routines
- Adds support for D24X8_UINT operations for typeless copy
2020-09-07 18:25:54 +03:00
kd-11 65ead08880 rsx: Refactor and improve image memory manipulation routines 2020-08-27 12:52:28 +03:00
kd-11 faaf28b41d rsx: Basic support for creating depth float formats 2020-08-27 12:52:28 +03:00
kd-11 b41349546c rsx: Proper support for typeless transform of ABGR framebuffers using the RGBA8 format 2020-08-12 20:19:19 +03:00
kd-11 bd21930d1a rsx: Decode swizzled GPU data on CPU readback
- Currently this conversion is being done on the CPU to reuse as much code as possible.
  The expectation is that this almost never happens, so there is not point in increasing maintenance burden by adding compute paths
2020-08-02 16:14:11 +03:00
kd-11 c764925b4d rsx: Properly handle conversion of G8B8 and related formats
- These formats are 16-bit packed, not separate 8-bit channels. Conversion requires byteswap for them.
2020-06-16 22:36:38 +03:00
kd-11 118bfbbe98 rsx: Rewrite data texture remap expansion
- 16-bit channel formats have special 0x4|0xE encoding for only 2 channels, not 4
- float textures do not take any remapping and crash if you try it.
  Depth float textures work fine though.
2020-05-13 14:33:22 +03:00
Megamouse cf229a8e9f some more dynamic settings 2020-04-15 18:25:25 +02:00
scribam f37adc4188 Add fallthrough attribute 2020-04-14 17:06:58 +03:00
kd-11 50b1e26b17 gl: Fix a long-standing regression with typeless transfer caused by a typo.
- The parameters for the final upload should be 'unpack_info' not 'pack_info'!
2020-02-06 12:44:46 +03:00
kd-11 18e0559438 gl: Fix per-level sub-image sizes to comply with OpenGL guidelines for compressed textures 2020-02-06 12:44:46 +03:00
Nekotekina c0f80cfe7a Use attributes for LIKELY/UNLIKELY
Remove LIKELY/UNLIKELY macro.
2020-02-05 10:42:34 +03:00
Nekotekina 15391f45d0 Modernize RSX logging (rsx_log variable) 2020-02-01 11:52:22 +03:00
Nekotekina 377e7d2a73 C-style cast cleanup VI 2019-12-04 17:56:22 +03: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 9cd3530c98 rsx: Set up framework for hw deswizzle 2019-11-05 22:07:22 +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
kd-11 5af8a9fbbc rsx: Fix decoding of some fixed point texture parameters
- Checked envydocs and found the correct format as fixed-point 4.8 with optional sign bit
2019-10-17 18:18:00 +03:00
kd-11 27f48fbc06 gl: Rewrite image transfer operations to support image subregions
- Working exclusively with full sized images is very expensive
2019-10-13 19:00:05 +03:00
kd-11 d9a9766e41 gl: Refactoring and fallback support for compute acceleration 2019-10-13 19:00:05 +03:00
kd-11 105d4b51e6 gl: Use compute shaders for typeless texture decode 2019-10-13 19:00:05 +03:00
kd-11 99fb6d6a5d rsx: Allow GPU-accelerated stream manipulation when doing texture uploads 2019-08-30 21:46:19 +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 141072023b rsx: Fix handling of ARGB8 memory
- Load into memory as straightforward BGRA
- Fixes a bug in vulkan caused by byte shuffling in blit engine vs shader access
- Removes the need for memory shuffling when transferring into a rendertarget
2019-08-21 21:17:15 +03:00
kd-11 a0f0c418d7 gl:Implement proper support for packed 16-bit rendertargets
- Also some minor refactoring
2019-08-15 14:00:17 +03:00
kd-11 7f85b18b46 gl: Add support for 4444 typeless texture 2019-08-15 14:00:17 +03:00
kd-11 956270d9be gl: Add readback/writeback config for format GL_R16 2019-07-09 16:27:59 +03:00
Malcolm Jestadt b5d5113803 gl: Workaround slow PBO usage with Mesa
-Mesa is currently fastest with GL_STREAM_COPY
-See a338dc0186
-Also see https://bugs.freedesktop.org/show_bug.cgi?id=111043
2019-07-03 11:28:29 +03:00
kd-11 c32c1b0a62 gl: Minor API tweaks
- Avoid spamming the driver with samplerParameter calls unless the parameters have actually changed
2019-06-25 20:50:54 +03:00