Commit Graph
86 Commits
Author SHA1 Message Date
Unknown W. Brackets 4731a2918c GPU: Use more typesafe shader IDs.
Since they really are fairly distinct, let's make sure we can't mix them
accidentally.
2017-12-02 09:07:27 -08:00
Henrik Rydgård d884eeda99 DX9: Revert a bad optimization, hopefully fixing #10205. Vulkan: Add a missing check. 2017-11-30 15:28:15 +01:00
Unknown W. Brackets 72e0a24724 GPU: Reset shader state on shader reset.
Was ending up with lastFSID being -1, but being used.

Seen in gpu/commands/blend test.
2017-09-20 08:37:54 -07:00
Henrik Rydgård c2bd739b49 Optimize uniform uploads for D3D9 and GL as well. 2017-08-20 13:53:39 +02:00
Henrik Rydgard 078e1151f9 Dirty-flag the fragment shader ID. 2017-08-14 11:36:07 +02:00
Henrik Rydgard 56cd991833 All: Only recompute the vertex shader ID when dirty 2017-08-14 11:36:06 +02:00
Unknown W. Brackets c19faf8ac8 D3D9: Correct half-pixel offset. 2017-05-23 23:45:55 -07:00
Unknown W. Brackets ad8a0e6cc0 Add an ini setting to hide performance warnings. 2017-03-11 19:31:00 -08:00
Henrik Rydgård 440e72d250 Clean up among the logs. Remove MASTER_LOG. 2017-03-06 13:10:23 +01:00
Henrik Rydgard 6e940dfeda D3D11, Vulkan: Switch to 4x3 matrixes where possible.
Lets us unify more shader code between D3D11 and D3D9, and fixes HW
skinning on D3D11.
2017-02-14 11:59:13 +01:00
Henrik Rydgard ba95e0f4d9 Initial stab at porting the DX9 backend to D3D11. Not working yet. 2017-02-09 13:28:40 +01:00
Henrik Rydgard ba52ba8714 Move global.cpp to native/gfx/d3d9_shader.cpp 2017-02-05 20:50:17 +01:00
Henrik Rydgard 9c275730c5 Move pD3DDevice into dx_state.h. 2017-02-05 20:46:26 +01:00
Henrik Rydgard f00f7d2fb8 Remove some dependencies on the pD3DDevice globals 2017-02-05 20:36:00 +01:00
Henrik Rydgard 62a171c616 Minor DX9 optimization 2017-01-24 18:12:20 +01:00
Henrik Rydgard e4cb44c243 Merge the texture flags into the dirty flags 2017-01-24 18:12:20 +01:00
Henrik Rydgard b423998c36 Move uniform dirty-flag to gstate_c, opening up for other uses. 2017-01-24 18:12:20 +01:00
Henrik Rydgard 3c221a7ebd Extract the dirty flag from the shader managers so code that dirties uniform flags can be shared. 2017-01-23 21:11:39 +01:00
Henrik Rydgard f139246a78 Switch D3D and Vulkan to 64-bit dirty flags 2017-01-23 17:32:18 +01:00
Henrik Rydgard bd4436c6eb Centralize EstimatePerVertexCost and Execute_BlockTransferStart 2017-01-23 17:22:17 +01:00
Henrik Rydgard b0697b62d7 Fix bug in setting certain uniforms in DX9. Fixes #9224 2017-01-21 21:54:42 +01:00
Henrik Rydgard 9d7983eee8 Remove the ability to turn off prescaleUV entirely. It's simply better to do it in the vertex decoder. 2016-12-20 13:27:44 +01:00
Unknown W. Brackets a1fbcc3d93 Avoid directly calling osm from Core/GPU code.
This allows UI to handle the message however it wants to, and reduces
cross linkage issues.
2016-05-27 22:05:30 -07:00
Henrik Rydgard 58f77e8f5f Buildfix 2016-04-10 10:55:13 +02:00
Henrik RydgardandUnknown W. Brackets d67b148712 Add math dataconv funcs for packed values. 2016-03-06 11:33:53 -08:00
Unknown W. Brackets 79792a3c38 d3d9: Account for half-pixel z offset. 2016-01-20 22:53:47 -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
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
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
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 5667f34805 Invert proj matrix offset properly in D3D. 2015-11-09 21:21:55 +01:00
Henrik Rydgard 8b3ff8a5b6 Correctly flip matrices in DX9 as well. 2015-11-04 22:37:42 +01:00
Henrik Rydgard 85229efef4 D3D9: Generate shaders directly from shader IDs, just like we do in GL. 2015-10-25 00:34:23 +02:00
Henrik Rydgard 92389a4966 Use a common ShaderId class. Start moving shader ID code to GPU/Common 2015-10-24 23:24:06 +02:00
Henrik Rydgard 08b340f423 More D3D hackery: Take inverted Z in proj matrix into account.
Also, *2 breaks it for no good reason so don't do that.
2015-08-30 22:45:24 +02:00
Henrik Rydgard 488c62e534 This makes slightly more sense than the last commit. 2015-08-29 20:38:19 +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 2b7d08e3af Also apply the GT fix in D3D, doh 2015-08-27 18:01:00 +02:00
Henrik Rydgard bf6aef44cd Oops, didn't finish the D3D code 2015-08-26 17:45: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
The Dax 7104629b24 Add the Phantasy Star Portable 2 depth range hack to Direct3D9 as well.
It seems to work fine for me..
2015-02-23 04:42:04 -05:00
Henrik Rydgard eaa1f0c23d Port over the fog NaN/inf fixes from OpenGL to Direct3D. Fixes skies in Outrun and probably a few other things 2014-12-22 00:48:16 +01:00