Unknown W. Brackets
0e85225e29
Bring back the depth range hack.
2016-02-06 20:28:45 -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
9354e253bd
Fix some warnings in shader cache read.
...
In case something gets truncated.
2016-01-21 00:24:45 -08:00
Unknown W. Brackets
597596884e
Add a smart C FILE * helper.
...
When all you want is for it to close by itself on error.
2016-01-20 23:33:56 -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
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
Henrik Rydgard
6df8573583
Minor fixes
2016-01-17 22:53:06 +01:00
Henrik Rydgard
b39206f922
Use the app cache directory on Android for the shader cache.
2016-01-17 22:15:23 +01:00
Henrik Rydgard
dfcfb530d7
Log how long it takes to compile shaders at the start.
2016-01-17 20:53:58 +01:00
Henrik Rydgard
5cd5812239
Handle shader compile errors gracefully when loading shader cache.
2016-01-17 20:44:52 +01:00
Henrik Rydgard
b246442374
Hook up GL shader cache. Cache linked shader programs.
2016-01-17 20:44:51 +01:00
Henrik Rydgard
790210f6ef
Minor fixes
2016-01-17 20:33:22 +01:00
Henrik Rydgard
36e1840ea0
More parameter removal
2016-01-17 20:33:22 +01:00
Henrik Rydgard
c8b1064d20
GL Cleanup: No longer redundantly store the shader ID inside the shader objects
2016-01-17 20:33:14 +01:00
Unknown W. Brackets
00b57f6a16
Correct clamped depth offset.
...
Oops, forgot to fix this when I fixed the scale. It's already for a
[-1, 1] range, and needs to be corrected for accordingly.
Fixes #8425 , other depth issues in Phantasy Star Portable 2.
2016-01-16 00:18:25 -08:00
Unknown W. Brackets
7e54368998
Correct depth offset when clamped.
...
Of course, the scale is already half, so we just need to double for d3d9,
and not double for OpenGL of course.
Our offset is already in [0, 1] so we keep it.
2016-01-03 19:59:35 -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
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
941988cde4
Correct prescale issues with render-to-texture.
...
Still need to apply the scaling of the texture coordinates here (or
somewhere, maybe we prescale that as well? Except it's figured later on
in the process...)
2015-12-20 21:13:43 -08:00
Unknown W. Brackets
1fb271a607
Enable EXT_blend_func_extended.
...
Not really tested.
2015-11-27 16:01:25 -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
45da00d381
Fix viewport offset in gl non-buffered
2015-11-12 15:22:20 +01:00
Henrik Rydgard
aac0cd3227
Minor consistency improvement between d3d and opengl code
2015-11-05 00:08:48 +01:00
Henrik Rydgård
452ed71e68
Couple of LLVM compiler warnings
2015-11-04 12:46:38 +01:00
Henrik Rydgard
1ce6801d42
Shifted projection matrices need a few more parts flipped. This could fix bugs in games, too.
...
Fixes the strange camera issues in FF:CC.
2015-11-02 20:08:21 +01:00
Henrik Rydgard
c1db771056
Fix non-through rectangles
2015-11-02 20:08:11 +01:00
Henrik Rydgard
e9770b3679
Fix non-buffered rendering
2015-11-02 20:07:50 +01:00
Henrik Rydgard
f4248cb550
Remove a whole lot of flipping special cases
2015-11-02 20:07:30 +01:00
Henrik Rydgard
7f4e473e8c
Add new shader viewing tool
2015-10-14 18:10:21 +02:00
Henrik Rydgård
d12f74d49b
Slightly more elegant error handling
2015-10-14 17:44:50 +02:00
Henrik Rydgård
6bd1a43e20
Minor cleanups
2015-10-14 11:18:45 +02:00
Henrik Rydgård
87f45ed307
OpenGL: Generate vertex shaders directly from the shader ID.
2015-10-14 10:50:29 +02:00
Henrik Rydgård
39f04ab5d6
OpenGL: Generate fragment shaders directly from the ID.
2015-10-14 10:50:08 +02:00
Henrik Rydgard
4d18d478a0
Sample renderWidth/pixelWidth/height once per frame for the framebuffer manager.
2015-09-19 16:19:03 +02:00
Unknown W. Brackets
c7e6f051e4
Split the texture application into two stages.
...
The latter simply applies the texture.
This makes our IsAlphaTestTriviallyTrue() check correct.
2015-09-13 09:30:39 -07:00
Henrik Rydgard
ab3468ea02
Move native/gfx_es2/gl_state.cpp/h into GPU/GLES/GLStateCache.cpp/h
2015-09-06 13:45:17 +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
7b0a31ade5
Adjust D3D depth calculations to get them to match OpenGL as close as I can get it.
2015-08-29 17:43:09 +02:00
Henrik Rydgard
76eacf32f4
Change the offset to 0.0
2015-08-27 18:02:45 +02:00
Henrik Rydgard
fd18f14508
Fix GT and hopefully other games that got a black screen
2015-08-27 17:58:41 +02:00
Henrik Rydgard
d89da71057
Get rid of a division in the vertex shader by precomputing the inverse.
2015-08-26 17:40:06 +02:00
Henrik Rydgard
fee776b6e0
Correct scale factors for through mode depth rounding.
2015-08-26 15:55:58 +02:00
Henrik Rydgard
9e18fb7e90
Round Z in the vertex shader to match a 16-bit Z buffer.
...
However this inexplicably does still not solve the Phantasy Star issue!
2015-08-26 15:25:21 +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
29fc9e81a4
Use the gstate.getViewport* accessors.
2015-08-26 15:24:35 +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
vnctdj
e791bea8a9
Consistently use *gr for the Graphics i18n category
2015-07-01 23:50:16 +02:00
Henrik Rydgard
0b2a1dfe53
Profile a few more scopes
2015-05-26 00:39:27 +02:00
Unknown W. Brackets
5fa3bf0eb9
Move the viewport transform to the proj matrix.
...
The viewport has an implementation defined maximum size. On some devices,
it's as low as 2048 or 4096.
Tales of Destiny 2, for example, uses a large viewport, which may be
outside this range at 1x or 2x on such devices. This makes it work much
better. It may also have better subpixel precision.
2015-03-22 23:35:24 -07:00