Commit Graph

2261 Commits

Author SHA1 Message Date
Ryan Houdek 0578ec92c0 Merge pull request #1665 from Sonicadvance1/yielding_the_dual_core_world
Idle loop in GPU loop on dual core systems.
2014-12-09 02:22:27 -06:00
Markus Wick ff4526b4a9 Merge pull request #1657 from Tinob/master
Add HW bounding Box support to d3d backend
2014-12-08 09:05:22 +01:00
Ryan Houdek d58bba2160 Idle loop in GPU loop on dual core systems.
Previously we had decided to busy loop on systems due to Windows' scheduler being terrible and moving us around CPU cores when we yielded.
Along with context switching being a hot spot.
We had decided to busy loop in these situations instead, which allows us greater CPU performance on the video thread.
This can be attributed to multiple things, CPU not downclocking while busy looping, context switches happening less often, yielding taking more time
than a busy loop, etc.

One thing we had considered when moving over to a busy loop is the issues that dual core systems would now face due to Dolphin eating all of their CPU
resources. Effectively we are starving a dual core system of any time to do anything else due to the CPU thread always being pinned at 100% and then
the GPU thread also always at 100% just spinning around. We noted the potential for a performance regression, but dismissed it as most computers are
now becoming quad core or higher.

This change in particular has performance advantages on the dual core Nvidia Denver due to its architecture being nonstandard. If both CPU cores are
maxed out, the CPU can't effectively take any idle time to recompile host code blocks to its native VLIW architecture.
It can still do so, but it does less frequently which results in performance issues in Dolphin due to most code just running through the in-order
instruction decoder instead of the native VLIW architecture.
In one particular example, yielding moves the performance from 35-40FPS to 50-55FPS. So it is far more noticeable on Denver than any other system.
Of course once a triple or quad core Denver system comes out this will no longer be an issue on this architecture since it'll have a free core to do
all of this work.
2014-12-07 05:36:44 +00:00
Lioncash 9bcadc8029 Common: Remove locale based functions from CommonFuncs.
Since %f isn't used anymore in the shader generators, these can go.
2014-12-05 20:55:29 -05:00
Rodolfo Bogado 93b4540e19 Add HW bounding Box support to d3d backend 2014-12-05 15:03:24 -03:00
Markus Wick f00ad2e65c Merge pull request #1656 from kayru/orthographic_projection_epsilon
Moved projection epsilon back to g_fProjectionMatrix[15]
2014-12-05 17:34:50 +01:00
Yuriy O'Donnell 7ba417b73d Moved projection epsilon back to g_fProjectionMatrix[15], which essentially scales vertices instead of just biasing. 2014-12-05 09:41:41 +01:00
Markus Wick 02dae1d1ba VideoCommon: fix include order 2014-12-04 15:15:16 +01:00
skidau 4a424e93a4 Merge pull request #1622 from FioraAeterna/texmtxfloat4
Vertex loader: optimize texmtx_write_float4
2014-12-04 13:10:22 +11:00
Rohit Nirmal ac22a2184b Fix building with PCH disabled. 2014-12-03 19:59:47 -06:00
skidau bfc62d2ada Merge pull request #1366 from kayru/orthographic_projection_epsilon
Added projection matrix epsilon that fixes depth clipping issues in some games
2014-12-04 09:10:36 +11:00
Lioncash 88cd27bbca Merge pull request #1392 from kayru/d3d_viewport_depth
D3D: Replaced shader-based depth range remap with viewport
2014-12-03 14:49:30 -05:00
Fiora e3578683e3 Vertex loader: optimize texmtx_write_float4
Seems to be pretty high in the profile in some geometry-heavy games like The
Last Story, and the compiler-generated assembly is terrifyingly bad, so
SSE-ize it.
2014-12-03 11:17:05 -08:00
Ryan Houdek 5c3bbf7409 Works around broken Intel Windows video drivers.
Just use regular boolean negation in our pixel shader's depth test everywhere except on Qualcomm.
This works around a bug in the Intel Windows driver where comparing a boolean value against true or false fails but boolean negation works fine.
Quite silly.

Should fix issues #7830 and #7899.
2014-12-03 00:33:42 -06:00
Rohit Nirmal 239eaf122a VideoCommon: Fix -Wsign-compare warnings. 2014-11-29 17:40:14 -06:00
Yuriy O'Donnell a886d8a8ee Renamed DEPTHPARAMS to PIXELCENTERCORRECTION
This shader constant was previously used for depth remapping in D3D and for pixel center correction. Now it only serves one purpose and the new name makes it clear.
2014-11-29 11:42:52 +01:00
Yuriy O'Donnell cc2227fbc3 D3D: Replaced shader-based depth range remap with viewport
This fixes UI rendering in some games mentioned in https://code.google.com/p/dolphin-emu/issues/detail?id=7785
2014-11-29 11:11:28 +01:00
Fiora 7acd5eba17 Vertex loader: use ABI_CallFunction
Should result in faster/shorter code sequences on platforms where generated
code is close enough to the code segment (e.g. Windows).
2014-11-28 20:26:00 -08:00
Ryan Houdek ce059769f6 Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
2014-11-28 11:45:38 -06:00
Jules Blok 6d51455195 VideoConfig: Further optimize convergence and separation values and update their descriptions.
Previous convergence distance was much too large.
2014-11-27 16:19:26 +01:00
Lioncash 4afb85ef33 Merge pull request #1584 from degasus/master
OGL: also show driver warnings on release builds
2014-11-25 12:41:47 -05:00
Stevoisiak 6da394a4d0 More formatting and consistency fixes 2014-11-24 17:16:59 -05:00
Jules Blok a04edbcb9a VideoConfig: Add separation and convergence modifiers to the game ini. 2014-11-24 15:10:52 +01:00
Jules Blok f64aadd362 VideoConfig: Limit the StereoMonoEFBDepth option to the game ini and introduce a separate section for it. 2014-11-24 12:25:35 +01:00
Jules Blok 0f4d59f612 VideoConfig: Rename StereoFocalLength to StereoConvergence. 2014-11-24 11:58:38 +01:00
Jules Blok 9b2cd82da5 GeometryShaderGen: Set the properties of the VS_OUTPUT struct in the uid. 2014-11-23 14:30:12 +01:00
degasus ed9f258b27 GeometryShader: Don't read from output variables 2014-11-23 14:30:12 +01:00
Jules Blok 106df04e8e GeometryShaderGen: Declare the vertex array size. 2014-11-23 14:30:12 +01:00
Jules Blok 422125c1a9 GeometryShaderGen: Add comments. 2014-11-23 14:30:12 +01:00
Jules Blok 24e4de3643 VideoConfig: Move stereoscopy settings to the Enhancements section. 2014-11-23 14:30:12 +01:00
Jules Blok 0f63186371 TextureCache: Add "Mono EFB Depth Copy" stereoscopy option. 2014-11-23 14:27:40 +01:00
Jules Blok f3ddf37d07 VideoCommon: Switch to Nvidia stereoscopy offset formula. 2014-11-23 14:27:40 +01:00
Jules Blok 8210b9c915 TextureCache: Ensure that all render target textures have as many layers as the frame buffer.
Also fixes a case where the D3D code path did not initialize num_layers leading to undefined behaviour.
2014-11-23 14:27:40 +01:00
Jules Blok 27f3f804a0 ShaderGen: Only pass VS_OUTPUT between shaders if stereo 3D is enabled.
GLSL130 doesn't support passing structs between shaders.
This is not a problem for stereo 3D which has a GLSL150 requirement.
2014-11-23 14:27:40 +01:00
Jules Blok 51a4d6a4be GeometryShader: Adjust positions after projection.
By adjusting the positions in clip space we can avoid the re-projection.
2014-11-23 14:27:40 +01:00
Jules Blok ee76c03160 TextureCache: Recompile EFB2Tex shaders when stereo 3D is toggled. 2014-11-23 14:27:40 +01:00
Jules Blok acc65ee608 GeometryShader: Replicate missing position manipulations from vertex shader. 2014-11-23 14:27:40 +01:00
Jules Blok 3baa01fc73 VideoConfig: Use a smaller focal length default. 2014-11-23 14:27:39 +01:00
Jules Blok f74d1b16ed OGL: Add Top-and-Bottom stereoscopy mode. 2014-11-23 14:27:39 +01:00
Jules Blok 1261bd02ca VertexShaderManager: Add stereoscopy options to swap the left and right eye. 2014-11-23 14:27:39 +01:00
Jules Blok c3ad6e7820 PostProcessing: Add support for anaglyph stereoscopy mode. 2014-11-23 14:27:39 +01:00
Jules Blok 6c8f3fa861 VideoConfig: Add StereoMode enumeration. 2014-11-23 14:27:39 +01:00
Jules Blok d7804a4d3e Cosmetics. 2014-11-23 14:27:39 +01:00
Jules Blok 9b22e15180 VideoConfigDiag: Add stereoscopy options group. 2014-11-23 14:27:38 +01:00
Jules Blok 4d9589b35f Cosmetics. 2014-11-23 14:27:38 +01:00
Jules Blok 9b4185ffdf ShaderGen: Make use of padding to store the stereo flag. 2014-11-23 14:27:38 +01:00
Jules Blok f370cb386c ProgramShaderCache: Always generate a geometry shader UID, even if stereoscopy is disabled. 2014-11-23 14:27:38 +01:00
Jules Blok 6cacfad010 GeometryShader: Transform the projection within the geometry shader.
Reduces the amount of data transferred through uniforms.
The shearing transformation is reduced to a single multiplication/addition for optimization.
2014-11-23 14:27:38 +01:00
Jules Blok 4fd943aedd VideoConfig: Limit the Stereo 3D option to the OpenGL backend. 2014-11-23 14:27:38 +01:00
Jules Blok 63b37e29d1 ShaderGen: Rename "eye" to "layer".
Keeping things generic.
2014-11-23 14:26:56 +01:00