Commit graph

108 commits

Author SHA1 Message Date
RipleyTom cd87a64621 Headers cleanup 2025-02-11 20:38:35 +01:00
kd-11 14e1214645 rsx: Properly implement 8-bit signed renormalization for textures 2024-06-10 20:41:45 +03:00
Elad Ashkenazi 0b22423ab8 Minor fs::file usage fixes
Do not crash on file creation failure. Make some config writes atomic.
2024-06-10 13:45:23 +03:00
KF c47212ff90 fix typo from PR 15636 2024-05-29 14:14:13 +03:00
kd-11 d545aa01b2 vk: Add support for NVK driver 2024-05-29 03:28:18 +03:00
kd-11 ebf48800e6 rsx: Always enable ROP output rounding if shader precision is higher than low
- Hardware behavior is inconsistent so let's just emulate this when possible
2023-11-21 13:49:16 +03:00
kd-11 186fe53279 rsx: Fix the default shadow codegen path 2023-07-09 19:33:48 +03:00
kd-11 d77a78cdf1 rsx: Rework texture coordinate handling to support clamping and a more sane scale-bias setup 2023-07-04 09:31:51 +03:00
kd-11 89c81d9f22 rsx: Switch common codegen to use the glsl scripts 2023-07-04 09:31:51 +03:00
kd-11 aa5097e0d4 glsl: Update fog enums in shaders 2023-01-11 16:48:53 +03:00
kd-11 9c0b2338cf rsx: Fix shader compilation 2022-12-11 15:21:58 +03:00
kd-11 a0ef1a672c rsx: Implement interpolation using barycentrics 2022-12-11 15:21:58 +03:00
kd-11 c4b259e0f8 rsx: Always enable ROP output quantization on NV 2022-11-18 23:06:47 +03:00
kd-11 d246a37b11 rsx: Move fp16 toggle to a global shader precision option 2022-10-11 14:00:34 +03:00
kd-11 bc7ed8eaab rsx/vk: Rework MSAA implementation 2022-03-17 22:02:20 +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 20bd723e7c rsx: Add floor workaround for GPUs with rounding issues
- Mainly affects nvidia where x/w * w can sometimes return a value smaller than x.
  In such conditions, floor(x) will return x-1 if x is an integer which is horribly wrong and exaggerates minor precision drift to great proportions.
2021-06-09 10:55:55 +03:00
kd-11 39815801aa rsx: Implement proper decoding for some obscure fragment instructions
PK4UBG and UP4UBG were dropped from the NV_fragment_program spec in 2002.
Not much information about them remains but seems pretty straightforward.
2021-06-05 21:02:14 +03: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
kd-11 c5a06dab0a rsx: Refactor program texture state handling to be persistent across shader swaps 2021-05-15 23:51:12 +03:00
kd-11 eb086b0e3f rsx: Add support shadow1D and shadowCube 2021-01-21 10:24:49 +03:00
kd-11 c2cbc62be6 vk: Refactor some uber-headers
- VKHelpers was the rug everything was swept under for a long time.
  This commit essentially deprecates its usage across most of the backend.
2021-01-10 12:04:31 +03:00
kd-11 a96b4412d3 rsx: Do not rely on program env state, instead, always use program ucode analysis results when doing codegen
- Some things can be present in program env but not ucode state
  e.g A texture can be active and bound in a redirected manner but not actually be used in ucode
  In such a case, only the ucode analysis or decompilation can decide whether to inject decoding routines
2020-12-25 02:39:08 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +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 da6760ed98 vk: Simplify shadow comparison operations for non-integer formats
- Just use hardware PCF, it makes everyone's life easier.
2020-09-09 22:11:12 +03:00
kd-11 f4ec28d932 rsx: Merge instruction expand flag with the other sign expand flags
- Avoids double expansion when both the exp_tex flag is set AND the texture also is sampled as signed
- Should fix missing eyeballs in Mass Effect 1 with the previous sign expansion fix
2020-06-12 20:19:20 +03:00
kd-11 1677618c75 rsx: Implement stippled rendering 2020-05-30 14:47:10 +03:00
Nekotekina 92e3eaf3ff Fix signed-unsigned comparisons and mark warning as error (part 2). 2020-02-19 22:54:58 +03:00
Megamouse fe75311be2 move config structs to own files and clean up some headers 2020-02-17 15:08:17 +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
kd-11 db5d03c340 vk: Generate dynamic binding table based on the capability of the drivers
- This alleviates constraints imposed on shaders to allow running on some not-so-great platforms.
2020-01-09 15:38:23 +03:00
kd-11 c4e59b5115 vk: Clamp depth export in FS
- PS3 matches OGL behavior where writing to the depth export
register results in clamping.
2020-01-01 22:39:20 +03:00
kd-11 0b2f9f0f17 rsx: Add support for delayed shader discard.
- Noticed a glitch on AMD hw and windows drivers where discard seems to affect entire 4x4 cells.
- Dead fragments (outside the primitive boundary) could have their discards trigger as they do not have proper access to variables.
- This introduces dead fragments along triangle edges, causing a diagonal line pattern across the screen that is very annoying.
2019-10-22 13:44:49 +03:00
kd-11 901942f24a rsx: Replace pointless f32[4] restriction on texture parameters.
- Use a struct instead to improve readability and remove pointless OpBitCast
2019-10-22 13:44:49 +03:00
kd-11 eed32cf3a4 rsx: Decompiler fixups and improvements
- Fix 2D coordinate sampling of W coordinate.
  W is actually HPOS.w and not 1. Z is however always 0.
- Optimize register usage a bit
  Disassembling compiled SPV shows that global declaration results in less ops than using inout modifiers. Modifiers generate extra mov instructions.
2019-08-26 20:03:31 +03:00
kd-11 3e28e4b1e0 rsx/decompiler: Restructure program register behavior
- Fix reading of varying registers in FP
  Different registers have different behavior
- Always write to varying registers. If a register is not written to, it is initialized to (0, 0, 0, 1)
- Reimplements two-sided lighting correctly without hacks
- Also bumps shader cache version
2019-08-26 20:03:31 +03:00
kd-11 6a32f716db rsx: Reimplement vertex layout streaming
- Remove string comparisons from the hot-path!
- Use attribute streaming and push constants to avoid forcing a descriptor block copy every other draw call/pass.
  While this isn't so bad on nvidia cards, it makes AMD cards a slideshow.
2019-06-25 20:50:54 +03:00
kd-11 6be7c58fa4 glsl: Refactoring, cleanup and optimizations
- Avoid generating unused code
- Reduce GPR usage in emitted code
2019-06-25 20:50:54 +03:00
scribam 370dcd9d6e rsx: Apply Clang-Tidy fix "readability-simplify-subscript-expr" 2019-06-12 15:11:52 +03:00
scribam 44265aa27d rsx: Apply Clang-Tidy fix "modernize-use-equals-default" 2019-06-12 15:11:52 +03:00
scribam 8f2647555a rsx: Apply Clang-Tidy fix "readability-redundant-string-init" 2019-06-12 15:11:52 +03:00
scribam c4667133c4 gl/vk: Add constexpr to varying_registers and sync functions between the two backends 2019-06-12 10:59:31 +01:00
msuih ef587d4cdc Limit shaderlog writing behind log_programs setting 2019-05-31 19:49:32 +03:00
kd-11 f2cac26154 rsx: Refactor out GLSLTypes from GLSLCommon to avoid warning spam due to unused functions when included in settings dialog code 2019-05-31 13:27:43 +03:00
kd-11 e118c9e5da update glslang 2019-05-30 11:48:38 +03:00
kd-11 2bec304cca vk: Allow some drivers to bypass window polling if not needed 2019-05-05 13:37:55 +03:00
kd-11 60f3059d22 rsx: Compensate for nvidia's low precision attribute interpolation
- The hw generates inaccurate values when doing perspective-correct
  interpolation of vertex output attributes and makes the comparison (a ==
  b) fail even when they are a fixed constant value.
- Increase equality tolerance when doing comparisons in fragment
  shaders for NV cards only to work around this issue.
- Teepo fix
2019-04-25 16:23:05 +03:00