Henrik Rydgård
036cde7768
Merge pull request #6313 from unknownbrackets/gpu-minor
...
Implement in-shader blending on gles2 / gl2
2014-06-14 09:21:30 +02:00
Unknown W. Brackets
444128dcdd
Support NEVER alpha/color tests.
2014-06-13 23:44:40 -07:00
Unknown W. Brackets
1d9f7b04fc
Implement in-shader blending on gles2 / gl2.
...
I'm sure it'll be slow, though...
2014-06-13 23:42:59 -07:00
Henrik Rydgard
3e97713d16
Revert "Remove option" (disable alpha test)
...
Fixes issue #6286 .
This reverts commit d2ce635bbf .
2014-06-10 23:13:42 +02:00
Henrik Rydgard
34b5a1c2f3
Disable precision qualifiers on desktop GL
2014-06-10 22:44:53 +02:00
Unknown W. Brackets
b163ab9203
Use an extra shader id bit to skip offsetting.
...
Since the vast majority of the time it will be 0.
2014-06-08 14:28:18 -07:00
Unknown W. Brackets
865941a66d
Ignore needShaderTexClamp when not texmapping.
2014-06-08 14:27:57 -07:00
Unknown W. Brackets
acab898be0
Keep track of x/y offset for render-to-tex.
...
Fixes intro in Valkyrie Profile now that we're wrapping correctly.
2014-06-08 14:27:05 -07:00
Unknown W. Brackets
ed39bb7a9c
When projecting textures, flip V in frag shader.
...
Slower, but this way we actually project correctly.
2014-06-07 19:32:19 -07:00
Unknown W. Brackets
da438b7c68
Fix clamping to the correct texel.
...
This fixes things when edges bleed in from a larger framebuffer. We need
to clamp to the internal texels of the range.
2014-06-07 19:30:46 -07:00
Unknown W. Brackets
33b4cc2bcc
Apply clamp and wrap to tex projection as well.
...
Not sure if this is the correct method or not, since it doesn't really
work properly right now.
2014-06-07 14:19:53 -07:00
Unknown W. Brackets
cc841bbe4c
Apply tex wrap/clamp in shader for render-to-tex.
...
Fixes graphical artifacts in Wild Arms XF (which depends on how you get
there, because it's based on the size of the framebuffer.)
2014-06-07 13:13:58 -07:00
Henrik Rydgard
a64fe6324a
Remove report I don't think we need anymore
2014-06-05 21:18:08 +02:00
Unknown W. Brackets
4461c7e3c4
Oops, remove an old wrong comment.
2014-05-31 22:07:43 -07:00
Unknown W. Brackets
766968e942
Don't use shader blending without buffers.
...
Ugh, making ComputeFragmentShaderID() slower again...
2014-05-30 09:01:22 -07:00
Unknown W. Brackets
fce7d8c697
Ignore the funcs for min/max/absdiff.
...
Seems from reports that they are indeed ignored, just wanted to verify.
2014-05-27 01:45:21 -07:00
Unknown W. Brackets
0eae30dddb
Set a bit to account for fixa/fixb/etc. logic.
2014-05-27 01:45:20 -07:00
Unknown W. Brackets
b8a2410934
Oops, typo.
2014-05-27 01:45:19 -07:00
Unknown W. Brackets
41ca303bee
Skip a few more fixa/fixb combos.
2014-05-27 01:45:18 -07:00
Unknown W. Brackets
a67327759f
Double using multiply not add, should be fine.
2014-05-27 01:45:17 -07:00
Unknown W. Brackets
4b978ed6f9
Apply unsupported blending modes in the shader.
...
This handles unsupported fixed color combinations, alpha doubling, etc.
Where possible, tries to avoid it - it means using a blit (without the
framebuffer fetch extension), which can slow things down a lot with tons
of drawcalls.
2014-05-27 01:45:17 -07:00
Unknown W. Brackets
99458d7797
Avoid forcing nearest/disabling linear if possible.
...
If we know that the test is trivially true, we don't need to worry about
the test. May help #4405 .
2014-05-15 22:38:44 -07:00
Unknown W. Brackets
f660c04983
Optimize double alpha blending for 1/0 textures.
...
If the blend is 2*a / 1-a, and the alpha is either 1 or 0, we can still
use color doubling instead. Fixes #3379 (Persona 2.)
2014-05-11 14:17:19 -07:00
Henrik Rydgard
cf4887ecdd
Update native to detect the EXT and NV extensions separately. Only look at the NV one.
2014-04-18 19:30:10 +02:00
Henrik Rydgård
45246ad9d3
Merge pull request #5891 from raven02/kill-alpha
...
Remove 'DisableAlphaTest' option
2014-04-15 22:00:18 +02:00
raven02
d2ce635bbf
Remove option
2014-04-16 03:57:57 +08:00
raven02
cd024e88e8
Add #extension GL_EXT_shader_framebuffer_fetch : require
2014-04-14 19:55:34 +08:00
raven02
a9d7be1eab
Should be id0
2014-04-13 16:13:59 +08:00
raven02
e358a6dcbe
Handle ABSDIFF blending mode using GL_EXT_shader_framebuffer_fetch
2014-04-13 16:01:55 +08:00
Unknown W. Brackets
1209bc7ba4
Optimize ComputeFragmentShaderID() a bit.
...
I've seen it decently high on some profiles (1-2%). This cuts it down by
12.5% when used in a tight loop. The temporary was 8%, the ifs were the
other 4.5%.
2014-03-29 10:21:04 -07:00
Unknown W. Brackets
2b7d2fdc4b
Optimize > and != 0 alpha tests.
...
There's no need to do rounding in this case. These are very common.
Also, if the test was !=, convert it to >, which may work better on
PowerVR.
2014-03-29 10:16:06 -07:00
Henrik Rydgard
f99925261d
Merge branch 'raven02-patch-42'
...
Conflicts:
GPU/GLES/FragmentShaderGenerator.cpp
2014-03-29 17:26:33 +01:00
raven02
664efe6812
Return false when alpha blending disabled
2014-03-29 22:04:59 +08:00
raven02
2944856c42
FS : Add missing gstate.isTextureMapEnabled()
2014-03-29 21:03:28 +08:00
Henrik Rydgard
37e9fc59b3
2x alpha: Safer change than the last attempt. Still fixes P2. I think this can be simplified, anyway.
2014-03-29 12:10:44 +01:00
Henrik Rydgard
27767fa85c
Revert "Rethink 2x src alpha->color doubling. Fixes #3379."
...
This reverts commit 47efded29f .
2014-03-29 12:01:47 +01:00
Henrik Rydgard
47efded29f
Rethink 2x src alpha->color doubling. Fixes #3379 .
2014-03-29 11:40:17 +01:00
Unknown W. Brackets
69c2500dc6
Make sure vai->flags are set while hashing.
...
Since we decode the verts in this case we have a fresh flag. Might
be #5718 ?
2014-03-25 08:19:38 -07:00
Henrik Rydgard
dc07d3410a
More checks for alpha test elimination
2014-03-24 17:33:20 +01:00
Henrik Rydgard
f33ddad364
Eliminate further alpha tests
2014-03-24 12:41:33 +01:00
Henrik Rydgard
b174996c1c
Add a conservative check that prevents alpha testing in a few cases.
...
This will become really powerful if we add some code to the vertex decoder
to check for non-full alpha in the vertices, and set gstate_c.vertexFullAlpha if none
is found (probably want to do the reverse, set it to true and clear if any non-255 alpha is found).
Alpha testing is a performance killer on many mobile GPUs so big efforts to
avoid it can be worth it.
2014-03-23 16:32:38 +01:00
Henrik Rydgard
20d480a374
Minor GPU code cleanups
2014-03-23 16:32:38 +01:00
Unknown W. Brackets
b9f4cc4481
Double colors only when texturing, and after test.
...
Per tests.
2014-01-12 11:45:29 -08:00
Henrik Rydgård
c277fe3019
Don't declare fragColor0 unless we will use it. See #4877
2013-12-29 11:26:56 +01:00
raven02
9676f6943f
Restore Alpha/ColorDoubling to do before color test
2013-12-25 15:39:37 +08:00
raven02
f97aacce45
Reformat stencilToAlpha a bit
2013-12-24 22:36:57 +08:00
Henrik Rydgard
832c933cb8
Some shader fixes
2013-12-17 23:38:58 +01:00
Henrik Rydgard
f8312716f3
Only use dual source when actually needed.
...
Does generate a few more shaders but hopefully isn't a problem, should get rid of most of the slowdown in most games.
2013-12-16 23:44:28 +01:00
Henrik Rydgard
a9a15d5196
Don't use dual source when stencil disabled
2013-12-16 23:41:42 +01:00
Henrik Rydgard
0d2ec01e83
Switch CanReplaceAlphaWithStencil response to an enum
2013-12-16 23:24:32 +01:00