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
Henrik Rydgård
474db602ca
UWP: Fix screen rotation in non-buffered rendering mode
2017-03-07 15:32:26 +01:00
Florent Castelli
70593d1004
android: Change preprocessor define to standard __ANDROID__
...
ANDROID is only standard to the old Makefile buildsystem, not the platform.
2016-10-12 11:14:09 +02:00
Unknown W. Brackets
f101e2710c
Avoid a c++11 rule violation.
...
No default args on lambdas, unfortunately...?
2016-08-06 20:01:50 -07:00
Unknown W. Brackets
fed0089c81
Rewrite 5551 test mask to 0xFF in more cases.
...
If nothing else, this may improve cacheability or something, since states
will be more regular.
May somehow help PowerVR in #7740 ?
2016-05-28 09:11:53 -07:00
Henrik Rydgard
0b1cfaf751
Be more economical with UBO pushbuffer space by reusing the last data when possible.
2016-03-20 19:35:31 +01:00
Henrik Rydgard
a995dd2ff4
Get rid of strange offset in Vulkan matrix converter
2016-03-20 19:31:02 +01:00
Unknown W. Brackets
944a1f380b
Disable alpha test optimization with logic ops.
...
We still need to discard the pixels in the case of a logic op, like
invert. Otherwise we will invert the blended pixels too.
See #8632 .
2016-03-12 09:27:18 -08:00
Henrik Rydgard
58b07e00d7
Assorted fixes and cleanups.
2016-03-06 11:46:41 -08:00
Unknown W. Brackets
6b9b00aa16
Assume DUALSOURCE replace alpha means supported.
...
We already check supports when generating this value, don't need to check
again when using it.
2016-03-05 17:18:04 -08:00
Unknown W. Brackets
8b51bc5b0b
Fix debugging and depth packing with old depth.
...
Which means, OpenGL in general right now.
2016-02-07 22:42:47 -08:00
Unknown W. Brackets
f1c06d25ea
Switch to old-style depth in OpenGL.
...
Some devices really aren't handling the new method well. There seem to be
accuracy problems when specifying the values to OpenGL.
2016-02-06 20:21:14 -08:00
Unknown W. Brackets
87b75235e7
Improve depth accuracy a bit in 16-bit slice mode.
2016-02-06 20:02:18 -08:00
Victor Xie
dc32805256
Made commit 0920f6c
a little more robust.
...
Eliminated division-by-zero when depth range is zero.
2016-02-01 13:17:15 +08:00
Unknown W. Brackets
79750ed1ad
Add a config setting to control depth quality.
...
For those who want 1x PSP like behavior.
2016-01-20 22:11:00 -08:00
Henrik Rydgård
4c8384aa09
Merge pull request #8461 from unknownbrackets/gpu-depth
...
Swap depth range to use minz/maxz
2016-01-20 10:19:51 +01:00
Unknown W. Brackets
02bf70a2d0
Where possible, rewrite 5551 stencil ops too.
...
We can in most cases fix INVERT, and also INCR so INVERT works when we
can't fix it.
Fixes #8422 .
2016-01-19 23:17:58 -08:00
Unknown W. Brackets
e00c9940e8
Correct pixel depth rounding.
2016-01-19 20:19:50 -08:00
Unknown W. Brackets
5de7d2cf8f
Oops, correctly center depth.
2016-01-19 07:51:56 -08:00
Unknown W. Brackets
6ef97f72d2
gedbg: Show scaled depth values properly.
2016-01-19 07:23:06 -08:00
Unknown W. Brackets
b80c02c272
Simulate depth clamping.
...
We'll allow extra space in both directions. It's not exactly right, but
it's a fast approximation.
2016-01-19 07:12:58 -08:00
Unknown W. Brackets
0920f6c6eb
Use minz/maxz as the depth range.
...
This allows values that fall outside the viewport, but still within the
depth range, to be drawn.
2016-01-19 07:12:57 -08:00
Unknown W. Brackets
d1b3768e49
Use a common func everywhere for float depth vals.
2016-01-18 19:29:45 -08:00
Unknown W. Brackets
0828721bc2
Simplify depth calculation a bit.
...
This way we keep the original range better, so we should lose less
precision.
2016-01-17 18:30:58 -08:00
Unknown W. Brackets
3aead9584b
Oops, fix typo causing clamping to clamp wrong.
2016-01-03 19:59:59 -08:00
Unknown W. Brackets
529abd7db4
Correct clamped depth range from [0, 65535].
...
This changes a few things:
* All backends clamp the depth range and keep it positive.
* The depth rounding uniform is now properly dirtied.
* Projection is updated to translate and scale appropriately.
* Depth rounding is halved on OpenGL to account for [-1, 1] range.
Fixes Phantasy Star Portable 2 without the need for a game-specific hack.
2016-01-03 12:29:43 -08:00
Unknown W. Brackets
fd2e302a66
When possible, replace 5551 stencil with 0xFF.
2015-12-31 17:16:41 -08:00
Unknown W. Brackets
e1599821ea
Split out the 5551 logic to be clearer.
2015-12-31 17:12:12 -08:00
Unknown W. Brackets
64a34a6d92
Handle masking correctly for 5551 stencil rewrite.
2015-12-31 17:01:08 -08:00
Unknown W. Brackets
c31a8f860b
Adjust stencil ops for 5551 and 565 buffers.
...
This attempts to better approximate the operations that actually happen,
where possible. Expected to help #5278 .
2015-12-31 17:01:03 -08:00
Unknown W. Brackets
c22953a4b9
Treat invalid blend factors as fixed consistently.
2015-11-19 06:48:06 -08:00
Unknown W. Brackets
eb5072bba5
Warning fixes.
2015-11-18 21:56:05 -08:00
Unknown W. Brackets
bf7f07f918
Optimize inverse blending modes, where possible.
...
Also, take advantage of cases where we can double src and src.a in the
shader, which can in some cases get us closer to accurate.
2015-11-14 12:37:32 -08:00
Henrik Rydgard
fadb19acc6
Remove a very minor difference between the backends in state mapping
2015-11-14 09:56:36 +01:00
Unknown W. Brackets
13a09647e2
d3d9: Disable shader blending, not implemented.
...
Fixes bad graphics in Ridge Racer, etc.
2015-11-13 23:11:06 -08:00
Henrik Rydgard
df94914a63
D3D: No need to convert blendcolor to float and back
...
Fix bug with constantAlpha
Remove misleading comment, thanks unknown
2015-11-12 18:11:23 +01:00
Henrik Rydgard
4a71d4cda2
The ConvertBlendState machinery is now pure, so move it out to GPU/Common
2015-11-12 18:11:20 +01:00
Henrik Rydgard
a6ced1d0b4
Move viewport/stencil conversion out into GPUStateUtils.cpp, use it in D3D as well.
...
D3D bugfixes. Not perfect yet.
2015-11-09 21:21:54 +01:00