Henrik Rydgård
04a85b1da0
Allows "merging" render targets that overlap on the Y access. Fixes #7295 (Juiced 2)
...
To be safe, gating this behind the related AllowLargeFBTextureOffsets,
which is also required for the effect to work.
Additionally, fixes the offset check for X offsets, which I guess is a
very small risk.
2022-07-24 11:58:07 +02:00
Henrik Rydgård
6b2dec91b5
Finish BlueToAlpha functionality
2022-04-30 18:17:17 +02:00
Henrik Rydgård
462972f7ea
Add option to redirect blue to alpha if 565 mode is rendered and mask is 0x0FFFFF.
...
This is used by several games to render to the alpha channel of RGBA4444
images, which cannot normally be done directly on the PSP.
Can be used as a far more efficient replacement for
ReinterpretFramebuffers/ShaderColorBitmask
2022-04-30 18:17:16 +02:00
Henrik Rydgård
7be86264d0
Move framebufFormat to gstate_c, so we can override it
2022-04-30 18:16:09 +02:00
Henrik Rydgård
32df78a2cc
Make the existing ReinterpretFramebuffers/ShaderColorBitmask path work for Split/Second
...
It took writing and debugging #15500 for me to understand what the issue with the old path was..
Much simpler alternative to #15500 , or we could merge both but disable Split/Second
for this one. Needs some benchmarks I guess...
2022-04-25 00:11:09 +02:00
Henrik Rydgård
69ae3f4c02
Better protection against broken viewports.
...
It's ok if this emits a single pixel sized viewport, since the cause of
this is generally the viewport being specified outside the scissor
rectangle.
Fixes #13921
2021-07-12 21:19:26 +02:00
Henrik Rydgård
7359c8f083
Revert "Make sure we don't try to set a negative viewport size."
...
This reverts commit 0386cafe53
.
2021-07-12 21:03:29 +02:00
Unknown W. Brackets
9857e8d1b1
GPU: Respect stencil write mask for 5551 buffers.
...
If the mask is 0x7F on 5551, that's equivalent to allowing the clear
entirely. See #13391 .
2021-01-24 15:54:13 -08:00
Henrik Rydgård
0386cafe53
Make sure we don't try to set a negative viewport size.
...
Should help #13921 .
2021-01-16 09:45:21 +01:00
Henrik Rydgård
d5fe6154b5
Enable color reinterpret for Ultimate Ghosts & Goblins
...
The game uses it by accident probably, but whatever - it's a clean fix.
Fixes, but only for "modern" APIs, #13717 .
2020-11-27 23:52:33 +01:00
Henrik Rydgård
c61f9bfd09
Fix bug in the new color writemask code, failing to limit it to Outrun properly. Fixes #13650 .
2020-11-10 22:07:20 +01:00
Henrik Rydgård
6310af25fa
Get shader color write masking going on all backends.
2020-11-08 23:45:47 +01:00
Henrik Rydgård
793e89d2e3
Fix some comments, rename a function.
2020-11-08 14:34:04 +01:00
Henrik Rydgård
3d289594f9
ShaderBlend and FramebufferRead are separate concepts. Reflect that in naming.
...
The former has forms that don't need to read the framebuffer.
This exposes that some logic is wrong...
2020-11-08 12:54:05 +01:00
Henrik Rydgård
b7edf75437
Move Display.cpp/h to Common.
2020-10-04 11:42:16 +02:00
Unknown W. Brackets
3055deeba6
GPU: Fix some case warnings.
...
Better to avoid the warnings.
2020-08-19 21:18:44 -07:00
Henrik Rydgård
ba0d04a142
Vulkan: Implement depth texturing through depal.
2020-08-09 20:31:04 +02:00
Henrik Rydgård
e6dfb55d3d
Optimize value conversion in (unused) depth readback.
...
This also exposes factors we can feed into shaders to do the conversion
on the GPU.
2020-08-09 10:47:01 +02:00
Henrik Rydgård
fd3a9d4202
Expand the viewport to cover the scissor region, if it doesn't. Fixes #4845 (bloom in Dante's Inferno).
2020-08-05 19:19:30 +02:00
Henrik Rydgård
1b2d4dd75d
Viewport state conversion: Move the pixel scaling to after the overage clipping.
2020-08-05 19:04:12 +02:00
Henrik Rydgård
eadd3c5785
Remove the LARGE_VIEWPORTS separate path. The fewer paths the better, all need to work anyway.
...
Required fixing a bug in ShaderUniforms.cpp (used by D3D11 and Vulkan,
the two backends that previously exposed LARGE_VIEWPORTS).
2020-08-05 19:03:08 +02:00
Henrik Rydgård
d57edfbdac
Rename FramebufferCommon.cpp/h to FramebufferManagerCommon.cpp/h for consistency
2020-08-03 23:17:22 +02:00
Henrik Rydgård
73046239e3
Android: Add option to ignore camera notches when sizing the display.
...
This is generally what you want, at least on phones with small notches.
Not sure about the most intuitive polarity and name of the setting.. bit
of a shame to create another setting with a negation. But most people
should probably ignore this.
2020-07-05 22:46:25 +02:00
Henrik Rydgård
c8d48a8777
Handle insets correctly for the in-game final screen blit.
...
Should help #12982 in case of phones with inset cameras.
2020-05-31 20:14:40 +02:00
Henrik Rydgård
e559fc022f
Minor refactor in PresentationCommon (combine loose coordinates to a struct)
2020-05-31 19:45:28 +02:00
Unknown W. Brackets
d39b0bdca2
GPU: Split FramebufferCommon into two classes.
...
Only some things moved over so far.
FramebufferCommon does too much, we want to share it with softgpu without
all the buffer management stuff.
2020-05-13 18:07:22 -07:00
Unknown W. Brackets
30ede8240c
GPU: Move hw transform decision to draw engine.
2020-04-04 11:14:32 -07:00
Unknown W. Brackets
7b8d3e0c36
GPU: Improve a 5551 stencil emulation case.
...
Hammerin' Hero (see #10777 ) uses ALWAYS with INCR, which can be rewritten
to maintain more correct stencil values.
2019-06-23 16:14:18 -07:00
Unknown W. Brackets
00d088ab58
GPU: Improve non dual source stencil replace.
...
If we're replacing with a constant FF, we can make it work more often.
Fixes #11249 .
2019-04-07 15:20:56 -07:00
Unknown W. Brackets
c5b844cc98
GPU: Respect stencil write mask on clear.
...
Actually identified this for the softgpu in #11319 , but applying it for
RGBA is a problem in most renderers. Forgot to at least apply it to
stencil.
Fixes #11901 .
2019-03-16 19:42:18 -07:00
Unknown W. Brackets
b955ec70c9
GPU: Correct depth clamp range in range cull.
...
It was just wrong before, causing wrong culling when using a non-standard
viewport scale/center for depth.
Fixes #11701 , fixes #11781 .
2019-02-10 09:58:01 -08:00
Henrik Rydgard
3f8aec5147
Remove the "Disable stencil test" hack. Doesn't seem to serve much purpose anymore.
2018-12-14 13:54:03 +01:00
Unknown W. Brackets
5932cbabc3
GPU: Avoid stencil emulation if possible.
...
This reduces use of replaceAlpha, and reduces use of more complicated
blend states. This simplifies fragment shaders a little.
2018-12-01 14:05:29 -08:00
Unknown W. Brackets
29b5581416
GLES: Correct invalid scissor handling.
...
Also improves Direct3D 9. See #11444 .
Per hardware tests, we should correctly not draw in this case.
2018-10-28 15:56:02 -07:00
Unknown W. Brackets
274b1eaa0e
GPU: Fix typo with wrong type.
...
No behavior change, just fixes a warning.
2018-08-26 11:51:06 -07:00
Unknown W. Brackets
5c01bf61e6
GPU: Apply logic op in more cases.
...
It has well defined behavior with alpha blending, so let's apply it even
when we're blending. Fixes #11316 .
2018-08-24 21:19:54 -07:00
Unknown W. Brackets
734db3d050
GPU: Refactor logic op simulation for better reuse.
2018-08-24 21:05:27 -07:00
Unknown W. Brackets
77f0499f7f
GPU: Rename clipping flag to depth clamp.
...
It seems to just to depth clamp. When depth clamp happens, it affects
clipping a little, but only for vertices that needed clamping.
2018-08-05 17:11:51 -07:00
Unknown W. Brackets
7885a88c0c
GPU: Optimize > 0 alpha test using discard rules.
...
It should be equally unsafe to use src color as dest blend factor, or
use blending with a subtract or min/max equation.
2018-07-29 11:39:06 -07:00
Unknown W. Brackets
fba0de59c1
GPU: Restrict alpha test to zero for dest blend.
...
We could end up with the wrong blending in other cases, because the
exiting color will get multiplied.
Luckily, this is still the common case.
2018-07-29 11:26:04 -07:00
Unknown W. Brackets
5ccd3ee4dc
GPU: Allow skipping discard when write disabled.
...
Even if we depth test, if we don't write, we can still force alpha to
zero.
2018-07-27 20:16:51 -07:00
Unknown W. Brackets
5ad948df73
Vulkan: Avoid discard when we can blend.
...
Where possible, replace alpha and color testing with a zero alpha value.
This allows early fragment tests more often, which may help #11227 . It
may also generally help performance on PowerVR devices.
2018-07-27 20:04:36 -07:00
Unknown W. Brackets
b4496f1975
Core: Move config enums to separate file.
...
These are a bit strewn about and there are constants that aren't
consistently used, which just adds confusion.
2018-06-23 10:59:18 -07:00
Henrik Rydgård
9340260802
Finish the shader manager (almost)
2018-01-27 15:10:17 +01:00
Henrik Rydgård
2dda2bfa78
Dual source blend: Remove bad #ifdef that killed dual src code on Android... oops. Re-enable on nVidia Shield TV/Tablet. Fixes #10136 properly.
2017-12-30 00:53:24 +01:00
Unknown W. Brackets
e8ca467bc9
Vulkan: Allow full depth range with depth clamp.
2017-12-26 16:54:40 -08:00
Unknown W. Brackets
c5897a1c5c
GPU: Cleanup some feature flags usage.
2017-12-21 18:50:41 -08:00
Unknown W. Brackets
9c52155d3f
GPU: Minor cleanup.
2017-12-02 09:47:59 -08:00
Henrik Rydgård
6a3d41892a
Workarounds for issue with "accurate depth". See #9545 , #10087
2017-11-21 12:11:05 +01:00
Henrik Rydgard
56cd991833
All: Only recompute the vertex shader ID when dirty
2017-08-14 11:36:06 +02:00