Commit graph

1144 commits

Author SHA1 Message Date
kd-11
d167582f6b gl: Implement on-chip buffer-to-d24x8 conversion 2022-05-31 23:34:14 +03:00
kd-11
dd6cb054a7 gl: Add missing viewport save 2022-05-31 23:34:14 +03:00
kd-11
b97557ce7b gl: Use DSA for compressed texture upload 2022-05-31 23:34:14 +03:00
kd-11
964fd1095e gl: Properly preserve texture state
- Remove rogue glBindTexture calls and use gl commandstate object instead
2022-05-31 23:34:14 +03:00
kd-11
fcc6c2384b Fix linux build 2022-05-31 23:34:14 +03:00
kd-11
a5d73f41b5 gl: Remove debug message 2022-05-31 23:34:14 +03:00
kd-11
1b305bf789 gl: Workaround for poor AMD OpenGL performance
- Turns out the AMD driver really hates it if you render with a mapped index buffer.
  The driver internally seems to make a copy of the consumed indices and uses that. Very slow.
  I was able to isolate this after observing that glDrawArrays is not entirely shit, but glDrawElements duration scaled linearly with the number of vertices.
2022-05-31 23:34:14 +03:00
kd-11
943752db30 gl: Compute optimizations
- Keep buffers around longer to allow driver heurestics to work
- Properly initialize the shaders to allow optimal workgroup dispatch size
2022-05-31 23:34:14 +03:00
kd-11
60a2a39e88 gl: Deswizzle textures on the GPU 2022-05-31 23:34:14 +03:00
kd-11
532563e861 gl: Update some more buffer-object functions 2022-05-31 23:34:14 +03:00
kd-11
3ee27bd434 gl: Optimize consumption of buffer objects when uploading textures 2022-05-31 23:34:14 +03:00
kd-11
55e68441cb gl: Commit to bindless framebuffer object management 2022-05-31 23:34:14 +03:00
kd-11
129e947720 gl: Improve CS throughput
- Avoids making too many invocations, especially given the 1D nature of some GPU dispatch handlers
2022-05-31 23:34:14 +03:00
kd-11
e964060a6a gl: Handle texture binding using the global state tracker 2022-05-31 23:34:14 +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
ed2068fb03 gl: Rewrite buffer mapping 2022-05-31 23:34:14 +03:00
kd-11
b61c4d3693 gl: Fix stat counters 2022-05-31 23:34:14 +03:00
kd-11
81b9952e34 gl: Do not allow cross-aspect bitcasts
- There is special handling for some cross-aspect bitcasts in vulkan, but this is not possible using OpenGL
2022-05-31 23:34:14 +03:00
kd-11
ec2d529832 rsx: Separate loop interrupts from graphics state
- The interrupts are for multithreaded signals andmake the main loop run more aggressively for the next cycle
2022-05-20 16:29:27 +03:00
kd-11
93d93b4805 rsx: Fix typo 2022-05-20 16:29:27 +03:00
kd-11
e368453751 rsx: Rework loop interrupts a bit
- Reset backend interrupt in core handler
- Separate memory config interrupt from regular backend interrupt
2022-05-20 16:29:27 +03:00
kd-11
d0dc095c84 rsx: Silence some log spam 2022-05-20 16:29:27 +03:00
kd-11
9a1e6cc3e8 rsx: Implement RSX reports area access detection and optimize around it
- If nobody is reading RSX reports, do not be in a hurry to write them
- Requires HLE of some methods (cellGcmGetTimestamp) to function correctly
2022-05-20 16:29:27 +03:00
kd-11
e236ba4daf rsx: Improve lowered precision comparison emulation 2022-04-28 01:31:07 +03:00
kd-11
bca7b02ae9 Fix compressed pitch calculation 2022-04-19 22:58:29 +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
e66d6a9399 Fix interpreter 2022-03-26 16:10:18 +03:00
kd-11
1592ecdc55 rsx: Invalidate transform block on program change
- Since each program now does a remap of the outputs, we need to reupload the constants
- This is not a loss, constants are almost always changing between draw calls anyway
2022-03-26 16:10:18 +03:00
kd-11
96742852eb Fix OGL 2022-03-26 16:10:18 +03:00
kd-11
de0e660d28 rsx: Handle vertex shaders with no constant references
- If no vc[] refs exist, do not upload anything!
2022-03-26 16:10:18 +03:00
kd-11
d057ffe80f rsx: Fix program generation and compact referenced data blocks 2022-03-26 16:10:18 +03:00
kd-11
9a2d4fe46b rsx: Relocatable transform constants 2022-03-26 16:10:18 +03:00
kd-11
bc7ed8eaab rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +03:00
kd-11
1943d9819f rsx: Clean up surface cache routines around RTT invalidate 2022-03-10 20:43:58 +03:00
kd-11
0df903090d rsx: Optimize metrics a bit
- For some reason this has a massive impact on performance above some arbitrary threshold of calls
  Shows up under surface_cache::get_merged_memory_region when doing gathers.
2022-03-08 22:06:26 +03:00
kd-11
6812fa4764 rsx: Fix surface write coherency when MSAA is active 2022-03-08 22:06:26 +03:00
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
f382d54e9a gl: Remove pointless assert 2022-02-13 15:31:39 +03:00
kd-11
86919ec0e1 rsx: Validate requested images before attempting to upload them
- Do not allow dimensions of 0 to reach the backend APIs
2022-01-30 14:58:51 +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
c38ca21a81 rsx: Round up 8-bit ROP output on NVIDIA cards
- NV GPUs have a tendancy to be off by a very small margin, breaking rendering when greaterThan/lessThan checks are used.
- NOTE: Currently this setting is using the sRGB flag which indicates 8-bit output.
  Only one game is currently known to care about this behaviour so this is good enough for now.
2022-01-17 10:28:23 +03:00
kd-11
f923eaf09a rsx: Surface format remapping enhancements 2022-01-17 10:28:23 +03:00
Nekotekina
580bd2b25e Initial Linux Aarch64 support
* Update asmjit dependency (aarch64 branch)
* Disable USE_DISCORD_RPC by default
* Dump some JIT objects in rpcs3 cache dir
* Add SIGILL handler for all platforms
* Fix resetting zeroing denormals in thread pool
* Refactor most v128:: utils into global gv_** functions
* Refactor PPU interpreter (incomplete), remove "precise"
* - Instruction specializations with multiple accuracy flags
* - Adjust calling convention for speed
* - Removed precise/fast setting, replaced with static
* - Started refactoring interpreters for building at runtime JIT
*   (I got tired of poor compiler optimizations)
* - Expose some accuracy settings (SAT, NJ, VNAN, FPCC)
* - Add exec_bytes PPU thread variable (akin to cycle count)
* PPU LLVM: fix VCTUXS+VCTSXS instruction NaN results
* SPU interpreter: remove "precise" for now (extremely non-portable)
* - As with PPU, settings changed to static/dynamic for interpreters.
* - Precise options will be implemented later
* Fix termination after fatal error dialog
2022-01-15 06:48:04 +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
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
56dd09f4fe rsx: Handle floating point shenanigans
- If near and far clip are too close together, the API will not distinguish between them leading to out of bounds values
2021-12-22 22:08:53 +03:00
kd-11
de495952fd rsx: Enable fallback for devices without wide integer Z buffers 2021-12-22 22:08:53 +03:00
Nekotekina
76ccaf5e6f BufferUtils: refactoring
Optimize CPU capability tests for arch-tuned builds.
Separate streaming and non-streaming utilities.
Rewritten copy_data_swap_u32(_cmp) with AVX2 path.
2021-12-21 23:28:09 +03:00