Commit Graph

557 Commits

Author SHA1 Message Date
Unknown W. Brackets
e30ab95179 d3d9: Fix maxSeenV when not known.
And just make the code reused between both.  Fixes #8478.
2016-01-22 18:48:54 -08:00
Unknown W. Brackets
79792a3c38 d3d9: Account for half-pixel z offset. 2016-01-20 22:53:47 -08:00
Unknown W. Brackets
0443fbebd0 Add methods to download depth to PSP RAM. 2016-01-20 22:11:03 -08:00
Unknown W. Brackets
2916298695 gedbg: Add scaled 16-bit z support. 2016-01-20 22:11:02 -08:00
Unknown W. Brackets
f9970dba94 d3d9: Respect per-pixel depth rounding.
Using the 16-bit depth range.
2016-01-20 22:11:01 -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
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
b40c3fd839 Use video format when uploading to framebuffers.
Expected to help Bounty Hound, #8392.
2016-01-17 12:57:27 -08:00
Unknown W. Brackets
f60aef2e16 Add a more specific interface for video frames.
Since we know more about them.  No functional change yet.
2016-01-17 12:57:26 -08:00
Unknown W. Brackets
73bcf16612 Flush before loading the CLUT.
In case it's what was being rendered to.
2016-01-17 12:55:48 -08:00
Henrik Rydgard
332310c2d6 Remove redundant parameters 2016-01-17 20:33:21 +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
Henrik Rydgard
7e24801fc1 Specify which games need vertex depth rounding instead of which ones don't.
Vertex depth rounding is a not-fully-accurate hack, and most games are better off with the extra depth precision
of 24-bit Z than reducing it to a not-fully-accurate 16-bit. So let's only use it where necessary, like in Phantasy Star.

See issue #8187.
2016-01-16 11:31:27 +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
Henrik Rydgård
d479990595 Merge pull request #8413 from hrydgard/framebuffer-remove-unused
Remove some unused functionality from the framebuffer managers
2016-01-10 23:47:29 +01:00
Unknown W. Brackets
c6ffed6484 gedbg: Add mechanics to grab CLUT buffer. 2016-01-10 09:25:19 -08:00
Henrik Rydgard
88ed44189d Remove some unused functionality from the framebuffer managers 2016-01-10 14:59:27 +01:00
Unknown W. Brackets
2fc296a1fb gedbg: Format a few more cmds. 2016-01-07 22:42:20 -08:00
Unknown W. Brackets
909d477719 Support CLUTs at an x offset.
Used by Kurohyo 2.  Highly unlikely to be a mis-estimate within stride.
2016-01-05 00:02:58 -08:00
Unknown W. Brackets
19877144ba Avoid redownloading CLUT when reloaded.
In Brave Story, the game reloads the CLUT frequently, but doesn't actually
render to the CLUT that often.  It also switches between a few different
rendered CLUTs - so caching that we've downloaded is a HUGE win.

In case someone reading this message is interested, it actually renders
these CLUT tables from what appears to be a color wheel.  Crazy huh?
2016-01-04 22:21:33 -08:00
Unknown W. Brackets
28a07c70c6 Explicitly download rendered cluts.
This avoids triggering logic that tries to get the sizing right, or
optimize frequent copies.  CLUTs often get estimated wrong, so it's better
to copy just the correct range, always.
2016-01-04 21:29:03 -08:00
Unknown W. Brackets
a6c64f74d1 Cleanup download process a bit more. 2016-01-04 20:51:43 -08:00
Unknown W. Brackets
4176ee241f Reuse more code between GPUs for download. 2016-01-04 20:40:07 -08:00
Unknown W. Brackets
36c8b043f3 d3d9: Fix CLUT4 optimization color creation.
Fixes #8385.
2016-01-04 07:36:47 -08:00
Henrik Rydgård
f0812297a6 Merge pull request #8376 from unknownbrackets/gpu-depth
Correct universally for clamped depth range
2016-01-04 09:55:02 +01:00
Unknown W. Brackets
6cc69ed25f Factor out texture shader application.
This allows it to be reused between depal and indexed textures (second not
implemented yet.)
2016-01-03 23:50:49 -08:00
Unknown W. Brackets
14b350a5fe d3d9: Fix render-to-texture not working.
Broken by a copy/paste mistake in #7870 form OpenGL.
2016-01-03 23:44:43 -08:00
Unknown W. Brackets
e427d09628 Determine scaleFactor once per frame.
This way, for auto, we can properly treat it like scaleFactor = 1 when the
resolution is small.
2016-01-03 23:06:15 -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
2494176919 Remove incorrect CLUT4 optimization. 2016-01-02 13:20:30 -08:00
gmvbif
f8f7dadba4 Delete fields from FrameBufferDX9 with the same names as in the FrameBufferCommon 2016-01-02 09:40:47 +03:00
Henrik Rydgård
8be22f47cd Merge pull request #8348 from unknownbrackets/texcache
Centralize code in the texture cache, minor cleanups
2016-01-01 17:55:41 +01:00
Henrik Rydgård
614eff1931 Merge pull request #8349 from unknownbrackets/d3d9-minor
Fix some Direct3D 9 validation errors
2016-01-01 11:14:23 +01: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
69daa75228 Move more common code around in texcache. 2015-12-31 11:41:02 -08:00
Unknown W. Brackets
41b00a9cab d3d9: Initialize viewport without errors. 2015-12-31 11:17:24 -08:00
Unknown W. Brackets
b556472303 d3d9: Fix blitting coordinates. 2015-12-31 11:17:19 -08:00
Unknown W. Brackets
235881af1f d3d9: Avoid error when clearing temp FBOs. 2015-12-31 11:17:12 -08:00
Unknown W. Brackets
a45f05c598 Move NotifyFramebuffer and LoadClut to common code. 2015-12-31 11:13:39 -08:00
Henrik Rydgård
337f27d0d9 Merge pull request #8340 from unknownbrackets/texcache
Be forgiving when maxSeenV increases
2015-12-31 09:43:18 +01:00
Unknown W. Brackets
5806df07b4 Handle disabled display cleanly.
Otherwise we might accidentally match a vfb at 0.

Fixes #6317.
2015-12-30 17:44:32 -08:00
Unknown W. Brackets
7a864f5aa1 Be forgiving when maxSeenV increases.
This still allows us to optimize < 512 heights, but at the same time,
doesn't hit spritesheets as hard and avoids the scaling penalty.
2015-12-30 17:15:50 -08:00
Unknown W. Brackets
d18164bd4d d3d9: Clean up some scaling handling. 2015-12-30 16:54:25 -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
Henrik Rydgard
01669cbd92 Hide the "Internal resolution" etc static display unless FPS counter is on.
Seems fairly related and I don't want to add more options.
2015-11-27 00:17:14 +01:00
Unknown W. Brackets
1339f6b1f3 Report formats on usage of rendered clut. 2015-11-26 14:31:46 -08:00