Commit Graph

85 Commits

Author SHA1 Message Date
TellowKrinkle 2dfb819d35 Resources: ffx_cas.h Metal support 2022-11-23 11:45:37 +00:00
TellowKrinkle cef8d03d49 Resources: ffx_a MSL support 2022-11-23 11:45:37 +00:00
Connor McLaughlin 4177b090b2 Resources: Add GPUOpen's FidelityFX CAS headers 2022-11-23 11:45:37 +00:00
lightningterror 0988b08f7a GS interlace: Fix Wreturn-type, Wunused-variable, Wsometimes-uninitialized warnings. 2022-11-19 19:28:52 +01:00
sideprojectslab 6924249bcf GS: Reverted field order in MAD shader updated weave shader to same field order as MAD and merged two Weave shaders into one
GS: corrected refactoring errors in interlace shaders
2022-11-18 21:29:37 +00:00
sideprojectslab 21fa2ee87b GS: Improved MAD compatibility with other graphics settings 2022-11-18 21:29:37 +00:00
sideprojectslab 64f6bf52b0 GS: Cleaned up and commented Motiond Adaptive Deinterlacing shader code
GS: fixed compile error in Metal interlace shader
GS fixed more compile errors in Metal interlace shader
GS: Adjusted code indentation in interlace shader for all renderers
2022-11-18 21:29:37 +00:00
sideprojectslab f10e7f4ab7 GS: Implemented Motion Adaptive Deinterlacing for all renderers
implemented FastMAD motion-adaptive deinterlacing for OpenGL renderer, other renderers will crash. FastMAD is replacing blend (either mode) so select blend to activate MAD under the hood

fixed an assert and assessed that one MUST select mode Blend bottom field first to enable MAD

removed forced mode 2, added separate motion thresholds for current field and alternate field motion and optimized MAD for Top-FIeld-First mode

committing kind-of broken status for review

the algorithm works well on most games, but somehow Kingdom Hearts works at half resolution

completely fixed weird artifacts on MAD, I only need to fix a 1-line offset that is causing the top of the screen to flicker

fixed flicker on first line, I still need to fine-tune some coefficients

solved all nastiness by realizing that MAD MUST work on an even resolution, so odd resolutions are rounded up. Now all games I tried look great

made MAD sensitivity adjustable inside GDDevice.h and passed to shaders as a parameters. For this purpose ZrH is now a vec4 to hold more parameters conveniently

ported MAD to DX11 and DX12

removed rounding of texture size to closest multiple of 2 and fized odd number of lines inside the shaders by also passing the vertical resolution as a parameter

improved compatibility of upper buffer offset adjustment for odd resolutions

added Vulkan support
2022-11-18 21:29:37 +00:00
lightningterror cdb886a454 GS-hw: Implement missing st_int shader bit.
Was causing bad shader errors in GT4.
2022-10-24 16:22:44 +02:00
lightningterror abcbdc4a25 GS-hw: Further improve how we handle blend mix 1.
Compensate slightly for Cd*(As + 1) - Cs*As.
Try to compensate a bit with substracting 1 (0.00392) * (Alpha + 1) from Cs.
The initial factor we chose is 1 (0.00392) as that is the minimum color Cd can be, then we multiply by alpha to get the minimum blended value it can be.
2022-10-18 15:20:41 +02:00
Connor McLaughlin c2823aae39 GS: Fix fractional scaling in GL/Vulkan 2022-10-17 15:26:01 +01:00
TellowKrinkle 1ad6605dfb GS:HW: Remove comment on rgba to 8i only-blue optimization
Doesn't seem to improve anything anymore (GPUs do this with csel now anyways, it's like 5 instructions with no divergence)
2022-10-17 10:28:27 +02:00
TellowKrinkle c6add663f8 GS:HW: Clean up ps_convert_rgba_8i 2022-10-17 10:28:27 +02:00
Connor McLaughlin 6c17f7ad49 GS: Support fractional upscale 2022-10-15 17:37:35 +01:00
TellowKrinkle 9b5dd92dad GS:HW: Use 16-bit unorm for HDR 2022-10-11 18:17:27 +02:00
refractionpcsx2 92cd6e8435 GS: Fix DX shader error 2022-10-09 04:53:18 +01:00
TellowKrinkle 0637682eb0 GS:HW: Properly handle fbmask of negative values
Previously was possible with blending and colclip, but now more common with the new hdr algorithm
2022-10-09 04:06:59 +01:00
TellowKrinkle 73ae9f8879 GS:HW: Make HDR algorithm more float-precision-friendly
- Use whole numbers instead of 255ths
- Use range -128 - 127 instead of 0 - 255 for accumulation blends
2022-10-07 20:44:53 +02:00
TellowKrinkle 1b34eb14f8 GS: Pass through primitive ID in geometry shaders in DX12 and VK
Fixes primid destination alpha on sprites
2022-09-06 21:07:56 +02:00
TellowKrinkle 412480b326 GS: Don't add 10 to date flag to indicate initialization
We already have 1 and 2 dedicated to the job
2022-09-06 21:07:56 +02:00
TellowKrinkle 62f9b16139 GS:OGL: Use blend min for primid destination alpha 2022-09-06 21:07:56 +02:00
TellowKrinkle ea81b74e3b GS:OGL: Add fetch_rt function to shader 2022-09-04 23:02:44 -05:00
lightningterror 6279ae63ce GS-hw: Remove remaining 24bit destination checks for Ad. 2022-09-01 10:28:42 +02:00
lightningterror edc82d77a5 GS-hw: Improve how we handle blending on 24bit with Ad factor in renderer. 2022-08-31 20:34:51 +02:00
TellowKrinkle 91601e5647 GS: Manually do bilinear sampling when converting RGBA to depth
Shader bilinear doesn't properly handle the case where r overflows into g (or g overflows into b, etc)
2022-08-20 10:12:24 +01:00
TellowKrinkle 882c09b870 Vulkan: Format convert.glsl 2022-08-20 10:12:24 +01:00
refractionpcsx2 5447da0588 GS: Don't do blend_mix on HDR 2022-08-16 20:54:55 +01:00
refractionpcsx2 1b18e02fe0 GS: Add constant adjustment in blend mix when reverse subtracting. 2022-08-16 20:54:55 +01:00
TellowKrinkle cb64e8d504 GS:HW: More accurate blend equation for blend mix 2022-08-13 00:01:23 +02:00
lightningterror 6b48cf574d GS-hw: Adjust how we handle specific blend mix cases.
Replace Cs*As + Cd*(1 - As) with Cs*As - Cd*(As - 1).
Replace Cs*F + Cd*(1 - F) with Cs*F - Cd*(F - 1).
As - 1 or F - 1 subtraction is only done for the dual source output (hw blending part)
since we are changing the equation.
Af will be replaced with As in shader and send it to dual source output.

Also check if A*Alpha in the shader overflows, if it does then adjust the
alpha that is sent for HW blending further to compensate.
2022-08-07 14:08:04 +02:00
refractionpcsx2 42b334efcd GS-HW: Use correct alphas when AA1 is enabled + ABE disabled. 2022-07-18 09:40:21 +01:00
Stuart Kenny f7d76ebf1d GS: Add lottes crt to present shader. 2022-06-22 16:26:19 +02:00
lightningterror d2904c1fd5 GS: Fix up wave filter shaders. 2022-06-14 21:25:47 +02:00
Connor McLaughlin a9819542d4 GS: Split convert and present shaders 2022-06-05 21:27:16 +01:00
Stuart Kenny 0b2536dd3e GS/HW: Fix typos in wave filter shader 2022-05-31 17:36:16 +01:00
refractionpcsx2 89d44a5f60 GS: Offset interlace when upscaling 2022-05-24 18:03:07 +01:00
Connor McLaughlin b0f20c9973 GS/DX11: Fix MMOD=1 merge background color 2022-04-18 04:29:19 +01:00
Connor McLaughlin 1993203d26 GS: Add Direct3D 12 renderer 2022-04-15 12:56:41 +01:00
TellowKrinkle 5ecaa9459d GS: Add Metal renderer 2022-03-31 23:51:27 -05:00
Connor McLaughlin d32d8cc0ec Shaders/FXAA: Fix warnings with Vulkan compiler 2022-03-28 09:24:51 +02:00
Connor McLaughlin 0cb9655523 GS/Vulkan: Remove unused color attribute
Would likely be getting optimized out anyway.
2022-03-28 09:24:51 +02:00
Connor McLaughlin 3067bef82d GS/Vulkan: Implement FXAA 2022-03-28 09:24:51 +02:00
Connor McLaughlin 486764be03 GS/Vulkan: Implement shadeboost 2022-03-28 09:24:51 +02:00
Connor McLaughlin 4a5180bc0a GS: Put shadeboost params in uniforms
Compiling variants for these is silly.
2022-03-28 09:24:51 +02:00
Connor McLaughlin 1927896442 GS: Fix some edge cases with fbfetch
Second alpha pass with A masked, DATE enabled, etc.
2022-03-21 20:24:09 +00:00
Connor McLaughlin 45682c382f GS: Add NO_COLOR flag to PS (depth-only) 2022-03-20 23:41:33 +00:00
Connor McLaughlin 19d310475b GS: Draw alpha pass when dual source blend is missing 2022-03-20 23:41:33 +00:00
Connor McLaughlin a8b9df3952 GS: Utilize GL_EXT_framebuffer_fetch where available 2022-03-20 23:41:33 +00:00
Connor McLaughlin bb75c78c1a GS: Add option to disable texture barriers/geometry shaders 2022-03-20 23:41:33 +00:00
Connor McLaughlin f73398ea84 GS/Vulkan: Fix warning when compiling RGBA8->RGB5A1 shader
Also gets rid of the program info log length check, since that's been
long removed in glslang.
2022-02-20 14:03:33 +00:00