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
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
Henrik Rydgard
e11d0a7e1c
Minor GPU interface cleanup
2016-01-06 23:49:02 +01: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
18cdf9f352
Remove the depth range hack.
...
Ths removes the game-specific hack to workaround depth issues.
2016-01-03 12:05:59 -08:00
Unknown W. Brackets
164594b044
Use a VAO for all drawing, and VBOs throughout.
2015-12-19 09:18:34 -08:00
Unknown W. Brackets
fbc4b4e7a1
Use glCopyImageSubData() when it's available.
...
There's 4 different extensions providing this functionality. NV is
supported on desktop and mobile, EXT/OES on mobile, and ARB on desktop.
Mostly these are only supported by desktop cards and NVIDIA mobile.
Good improvement in performance on NVIDIA when blit is called a lot, since
it doesn't need to rebind anything or change state. Example is in desert
city in Tales of Phantasia.
2015-12-06 10:39:21 -08:00
Henrik Rydgard
4b360a571c
Remove the depth range hack option, turning it into an ugly game specific compatibility hack.
...
I hate doing this, but it's not really better off as an option.
See #8171
2015-11-15 23:00:25 +01:00
Henrik Rydgard
067431b35b
Region is not used in the viewport calculations - remove wrong commented out code
2015-11-04 11:04:47 +01:00
Henrik Rydgard
f4248cb550
Remove a whole lot of flipping special cases
2015-11-02 20:07:30 +01:00
Henrik Rydgard
65b78b18ea
Only enable fragment shader depth rounding for Heroes Phantasia, should reduce flicker.
...
Doens't fix but helps #6485
2015-10-11 20:52:00 +02:00
Henrik Rydgard
b07b002040
Introduce "Compatibility Flags".
...
These should be used very restrictively, see comment in Compatibility.h.
Should help #8004 , by disabling depth rounding in Fight Night round 3.
2015-09-27 01:23:20 +02:00
Unknown W. Brackets
dff4aeb30f
Correct uv bound pointers in arm vertexjit.
2015-09-13 14:55:10 -07:00
Unknown W. Brackets
5c233fa545
Add initial decoding check for uv bounds.
2015-09-13 10:00:33 -07:00
Henrik Rydgard
0237b84efd
Reduce use of #ifdef USING_GLES2 some more
2015-09-05 23:09:06 +02:00
Henrik Rydgard
186d624ef3
Cleanup of FBO+blit flags. Requires the change in native to stop lying.
2015-09-05 22:40:45 +02:00
Henrik Rydgard
5b2ffd1434
Fix some naming, remove NV_draw_texture, move decisions out
2015-09-05 22:11:28 +02:00
Henrik Rydgard
f524049277
Move more GPU feature checks upfront. Re-check when exiting settings menu.
2015-09-05 21:23:58 +02:00
Henrik Rydgard
a71be3f75f
Start moving GPU feature compatibility decisions to startup
...
(and a single, cache-friendly flag field)
2015-09-05 19:58:47 +02:00
Henrik Rydgard
1e8a1b801f
Rename viewportX1/X2 etc to scale + center, which is what they actually are.
2015-08-26 15:24:35 +02:00
Henrik Rydgard
d7f4c47c22
Refactor: Even more getting rid of gstate access in the framebuffer manager.
2015-08-05 12:13:14 +02:00
Henrik Rydgard
2430c283a5
More GPU cleaning, removing uses of GPUState.h where not needed.
...
Want to get rid of direct accesses to GPUState in modules that may be reused in
my future next-gen backends, that will reformat display lists into command lists that will
then be optimized and executed, out of sync with the real GPUState.
Candidate modules that may be reused in full are Framebuffer and Depal, possibly TextureCache to some degree.
2015-07-29 12:37:49 +02:00
Henrik Rydgard
aae254254b
Fix bad cleanup change, thanks to tapcio for pointing it out in 07b17560f
2015-07-28 01:09:48 +02:00
Henrik Rydgård
07b17560f4
Add some useful accessors to GPUState (backported from a work-in-progress branch)
2015-07-26 12:24:16 +02:00
Henrik Rydgård
0726912f09
sceDisplay, GPUState cleanup and comments
2015-07-25 09:46:11 +02:00
Unknown W. Brackets
425ff3d78f
Track bone matrix updates for future morph usage.
...
This makes them upload later, if/when they're needed.
Fixes #7746 , Shadow of Destiny artifacts when software skinning is
enabled.
2015-05-16 21:49:25 -07:00
Unknown W. Brackets
5822faabf9
Make sure to wrap clut indexes at 1024 bytes.
...
So that's 256 for 32-bit and 512 for 16-bit.
2015-04-26 00:42:58 -07:00
Unknown W. Brackets
5b61c03b7f
Avoid accidental sign ext for > 24 bit clut shift.
2015-04-26 00:26:24 -07:00
Unknown W. Brackets
67662ee23f
Force clut address to align to 16.
...
Hardware seems to ignore the lower bits when loading.
2015-04-12 22:39:49 -07:00
Unknown W. Brackets
0fc311a319
dx9: Compensate for viewport w/h adjustments.
...
Fixes text in Final Fantasy 4, world map in Star Ocean, etc.
2014-12-18 22:24:47 -08:00
Lioncash
a962bc5a6c
Mark some functions as const
2014-12-07 17:08:13 -05:00
Henrik Rydgard
01a1438dce
Improve depth buffering in D3D by computing a depth-flipped proj matrix but only when needed.
2014-09-08 23:10:23 +02:00
Unknown W. Brackets
1f51fe7843
d3d: Avoid rewriting textures, just swizzle.
...
Luckily A is in the same place and the same width, so we can do this for
all but framebuffers easily.
Technically we could do it in OpenGL as well.
Small (1-2%) performance improvement in FF2.
2014-08-28 01:20:21 -07:00
Unknown W. Brackets
a43c3771a3
More correctly blend when hitting the frame cap.
...
If we hit too many blits per frame, fall back correctly in the shader.
2014-08-18 23:20:48 -07:00
The Dax
8a78f5e814
Pause rendering when minimized, when appropriate (hopefully? This is sort of hard to test.).
2014-07-21 10:30:51 +02:00
Unknown W. Brackets
2883988f22
Ignore the high bits of the framebuffer address.
...
And depth buffer. On a PSP, these bits don't affect where it renders to
even slightly.
2014-06-21 08:29:38 -07:00
Unknown W. Brackets
2038bc5527
Support alpha / color test masks on desktop/gles3.
...
Won't work on GLES 2, though...
2014-06-16 00:33:48 -07:00
Unknown W. Brackets
f6649794df
Respect max texture level in GE debugger preview.
2014-06-15 10:31:16 -07:00
Unknown W. Brackets
030b562eb9
Support render-to-offset within a framebuffer.
...
Fixes #6324 .
2014-06-14 17:08:41 -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
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
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
Unknown W. Brackets
580143e5e2
Disable vertex arrays before depal as well.
2014-05-31 22:07:42 -07:00
Unknown W. Brackets
29a9ff369e
Make a note when we need to reset the shader.
...
Hmm, not sure this is the cleanest way.
2014-05-27 22:12:25 +02: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
16f4622ac7
Remove cached light variables to reduce work when parsing DLs.
...
Also removes some duplication between GL and the inactive D3D code.
2014-04-21 12:51:19 +02:00
raven02
abc5c86339
Split out texture level
2014-04-19 06:45:17 +08:00
Unknown W. Brackets
6cfc61665d
Switch to a bitmask instead.
2014-04-13 14:45:55 -07:00
Unknown W. Brackets
4c1c694d4b
Use flags to avoid hashing textures when unchanged.
...
If only parameters change (like wrapping or clut, etc.) we don't need to
rehash the data - we know it hasn't changed.
Should reduce the distance between lazy texture hashing on and off.
2014-04-13 14:22:39 -07: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