lightningterror
c0e47767b7
GS/HW: Adjust dither on Blend Mix when Cs-Cd * Af blend.
2024-03-10 23:41:18 +00:00
refractionpcsx2
65649b3cbb
GS/HW: Adjust dither on Blend Mix when Cs-Cd * As blend.
2024-03-10 23:41:18 +00:00
refractionpcsx2
4b88256df2
GS/HW: Allow palette lookups from depth and deswizzle manual deswizzles
2024-02-01 00:13:39 +00:00
refractionpcsx2
badede2e2d
GS/HW: ignore lower 3 bits of 16bit color for AEM check
2024-01-15 14:45:00 +00:00
refractionpcsx2
01842a3c6b
GS/HW: Allow blending on normal shuffles
2024-01-09 13:17:52 +00:00
Stenzek
d9abe10308
Misc: Remove explicit PCH include, switch to SPDX
2023-12-24 14:03:14 +10:00
lightningterror
f96e7a9156
GS/HW: Rename dfmt to dst_fmt.
...
It was confusing whenever the d meant depth or destination, this should make the code easier to read.
2023-10-19 19:25:13 +02:00
lightningterror
7fadb6ed05
GS/HW: Cleanup texture shuffle shaders.
2023-08-11 15:23:50 +01:00
lightningterror
713bd132dc
GS/D3D: Add initial support for complex shuffles.
2023-08-11 13:14:19 +01:00
Stenzek
784118e9c1
GS/HW: Don't drop fractional colour before modulating
...
Fixes banding in Xenosaga, Tales of the Abyss, Beyond Good and Evil.
2023-07-28 16:31:35 +01:00
lightningterror
3dce969a5e
GS-shaders: Add missing copyright headers.
2023-07-21 10:24:15 +02:00
Stenzek
7f7dd60587
GS/HW: VS expand instead of GS for DX/GL/Vulkan
2023-04-13 11:12:11 +01:00
Stenzek
f569ad0970
GS/HW: Allow translating targets for depth sources
...
Fixes broken half screen in Miami Vice and 10 Pin - Champions Alley.
2023-04-09 17:56:49 +01:00
Stenzek
faecc6913b
GS/HW: Texture cache improvements
...
GS/HW: Only use temporary source for recursive draw
.. and don't insert it into the page map.
GS/HW: Lookup page list for depth sources
GS/HW: Avoid target copies by using shader sampling
GS/HW: Make texture cache a global pointer
GS/HW: Remove GetID() from GSTexture
It only made sense for OpenGL, was always zero in Vulkan.
GS/HW: Rewrite texture sampling hazard detection
Also avoid redundant channel shuffle setup.
GS/HW: Turn Haunting Ground CRC into an OI fix
2023-03-30 21:55:50 +01:00
Stenzek
435e73d838
GS/HW: Texture cache improvements
...
Change texture scale from vector to scalar
- Independent X and Y scaling is long gone.
- Also separate size and scale in TC lookup
Move clear value for texture to base class
Align heights to page size
- Since FRAME and Z are in page units, we can't have two targets
- overlapping within the same page.
- Stops some small resizes too.
- Test cases: Genji and Spider-Man 2 shadows.
Don't modify target TEX0 on shuffle/clear
Move upscale multiplier to uniform
Make P8 conversion page-aware
Fix incorrect depth preload shader
Improve HLE of texture shuffles
When a texture shuffle is split into two half-screen draws, we skip the
first, and draw the whole thing in the second, taking care of when both
the texture and framebuffer are offset.
2023-03-13 20:29:05 +00:00
lightningterror
06aed8491c
GS-hw: Separate the Alpha masked Ad case from blend hw bit.
...
Allows for cleaner code.
2023-03-11 20:44:11 +01:00
lightningterror
62497b9300
GS-hw: Rename PS_CLR_HW to PS_BLEND_HW shader macro.
2023-03-11 20:44:11 +01:00
lightningterror
59aba9f757
GS-hw: Support Ad masked alpha on blend mix 1 and 2 clr cases.
2023-03-09 21:08:52 +01:00
lightningterror
911d35e800
GS-hw: Fix invert rounding for accumulation blend on gl.
...
Also make the checks consistent for all renderers.
2023-03-06 23:36:54 +01:00
lightningterror
e8cf4822b1
GS-d3d: Automatically adjust color compensation based on rgb value for hw blend clr3 case.
...
Auto adjust when any color is higher than 128 ( 1.0f) to get more accurate color results.
2023-03-06 19:49:27 +01:00
lightningterror
f478b3959c
GS-d3d: Add clr3 case for blend mix 2.
...
When Cs*(Alpha + 1) overflows compensate with adjusting Alpha output for Cd*Alpha.
2023-03-03 16:35:10 +01:00
TellowKrinkle
7781907f0e
GS: Blend truncation and dither goes the other way when subtracting
...
Truncation happens after subtraction, so it's the equivalent of rounding the value to subtract *up* instead of down
2023-02-26 07:22:32 +01:00
lightningterror
7f7950cd6b
GS-d3d: Check each channel individually if it overflows and do corrections.
2023-02-24 02:06:00 +01:00
refractionpcsx2
925e874ada
GS-HW: Fix real 16bit value shuffles
2023-02-17 19:06:35 +00:00
Stenzek
7d08a54ad9
GS/HW: Optimize TC source size based on CLAMP
2023-02-09 10:51:06 +00:00
Stenzek
0619555232
GS/HW: Use texel fetch/load instead of sampler for palettes
...
Saves a multiply in the shaders in some cases, and frees up one
descriptor slot.
2023-01-11 23:37:43 +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
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
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
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
Connor McLaughlin
1993203d26
GS: Add Direct3D 12 renderer
2022-04-15 12:56:41 +01: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
lightningterror
b8236b1b1c
GS-hw: Partially revert #5540
...
Allow to wrap on colclip.
For real tho, ideal solution is sw blend, doing any clamp/wrap is wrong on blend mix.
2022-02-19 00:38:13 +01:00
lightningterror
1a3d77b2c0
GS-hw: Fix d3d11 depth sample shader.
...
Also adjust some comments to match updated shader names.
2022-02-18 19:21:01 +01:00
lightningterror
06766ddb98
GS-hw: Don't wrap on 16bit destination format for blend mix.
...
Helps Dog's Life blending, we shouldn't wrap as we do more blend math afterward which will be wrong if we wrapped before.
2022-02-18 19:00:54 +01:00
lightningterror
7151848406
GS-hw: Rename alpha_clamp to blend_mix.
2022-02-18 19:00:54 +01:00
Connor McLaughlin
dfe4bc199f
GS/HW: Use integers for depth conversion shaders
...
Fixes z-fighting in reflections in DBZ BT3, maybe others?
2022-02-15 10:41:37 +01:00