Commit Graph

96 Commits

Author SHA1 Message Date
Unknown W. Brackets
52baec21a8 GPU: Refactor cull range calculation together. 2018-09-17 22:27:25 -07:00
Unknown W. Brackets
639a3f406d D3D9: Implement vertex range culling. 2018-09-17 07:27:26 -07:00
Unknown W. Brackets
797327eecd GPU: Handle bad fog params as large signed vals.
From tests, it seems they're just treated as valid exponents.

Using 65535 since that's the range of depth, can't think of a game using a
larger value for a fog parameter, probably never even this large.
2018-09-10 00:28:02 -07:00
Unknown W. Brackets
b05f75f667 D3D9: Set alpha mask reference in uniforms.
Just so we don't have surprises later if we implement masking.
2018-09-08 20:05:19 -07:00
Unknown W. Brackets
4dafb163a3 D3D11: Split color test out by component.
Not working correctly together.  See #10629.
2018-09-08 20:03:26 -07:00
Unknown W. Brackets
9bac603976 GPU: Use HW transform for flat spline/bezier.
We can control the provoking vertex here, but it's less likely to matter.
2018-06-28 19:30:20 -07:00
Unknown W. Brackets
2606365ba4 GPU: Use software transform for flat shading.
Except on GLES where it works fine with the default provoking index.

This fixes #10969 so that it works everywhere.
2018-06-06 05:53:50 -07:00
Henrik Rydgård
36fd2711d6 Revert "Remove further remains of hardware skinning."
This reverts commit 40db61a680.
2018-04-10 12:22:41 +02:00
Henrik Rydgård
d8651fd85b Combine the lightAngle and spotCoef float uniforms into one float2. Saves 64 bytes from the light uniform buffer, making it an even 512.
Probably a very small perf optimization.
2018-03-12 11:17:45 +01:00
Henrik Rydgård
40db61a680 Remove further remains of hardware skinning. Fixes #10661 2018-03-05 00:03:47 +01:00
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 Rydgard
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