Commit Graph

326 Commits

Author SHA1 Message Date
Jules Blok ed2c74a024 D3D: Set s_last_fullscreen_mode when constructing the renderer. 2014-07-26 13:47:11 +02:00
Pierre Bourdon 8e865f3848 Merge pull request #506 from Armada651/d3dfullscreen
D3D: Add exclusive fullscreen support.
2014-07-26 13:22:11 +02:00
Jules Blok 06b13f12d3 D3D: Make the global swapchain static again. 2014-07-26 13:04:46 +02:00
Jules Blok 6724ce6275 Cosmetic changes based on feedback on PR #506. 2014-07-26 13:04:39 +02:00
Jules Blok bd9953d97e Remove the 3D Vision hack.
The hack was needed because the Nvidia 3D Vision heuristics are documented to only support surfaces that are the same size as the backbuffer. This would be the case if you enabled the hack and selected the "Auto (Window Size)" internal resolution.

However, on recent drivers the same effect is achieved by selecting the "Auto (Multiple)" internal resolution. Therefore the hack is no longer required.
2014-07-26 12:45:10 +02:00
Pierre Bourdon 906b05cb1c Merge pull request #672 from delroth/vertex-loader
Vertex loader: reduce dependency on global state
2014-07-26 02:03:03 +02:00
Pierre Bourdon 73f9a22e2e VertexLoader: Remove global state dependency on g_nativeVertexFmt 2014-07-26 01:35:09 +02:00
Lioncash 5767691f4e Get rid of a few C-style struct declarations 2014-07-23 20:36:45 -04:00
Jules Blok 4b3d579573 Renderer: Only notify the host when exiting fullscreen 2014-07-21 20:50:50 +02:00
Jules Blok 009b4dd376 Exit exclusive fullscreen when the stop confirmation is shown.
Also have the renderer remember its own fullscreen state. This is done to prevent a case where we exit exclusive fullscreen through the configuration and a focus shift at the same time. In this case the renderer would fail to detect that the fullscreen state was changed.
2014-07-21 20:50:48 +02:00
Jules Blok 36ea1890c8 Let the Renderer decide when to exit fullscreen.
This ensures the transition from/to exclusive mode happens while the RenderFrame is fullscreen.

This prevents fullscreen loops and relieves us of having to restore the window size after we exit fullscreen.
2014-07-21 17:11:13 +02:00
Jules Blok cd94ff1966 VideoConfig: Add "Borderless Fullscreen" option.
This option will disable exclusive fullscreen for users who prefer the old behaviour.
2014-07-20 22:02:57 +02:00
Jules Blok 3400871992 Renderer: Don't attempt to switch to exclusive fullscreen if "render to main" is enabled. 2014-07-19 21:14:49 +02:00
Jules Blok 9064bf147d D3D: Don't set the windowed mode size when we initialize in fullscreen. 2014-07-19 21:14:48 +02:00
Jules Blok d00e76b3ef Cosmetic changes based on feedback on PR #506. 2014-07-19 21:14:47 +02:00
Jules Blok 5837b35add Renderer: Restore exclusive mode after focus has been regained. 2014-07-19 21:14:47 +02:00
Jules Blok 5f04e9c526 D3D: Make the swapchain available outside of the namespace.
This commit reverts a part of pull request #579.
2014-07-19 21:14:46 +02:00
Jules Blok 643c9ff173 D3D: Initialize the renderer in exclusive fullscreen mode if it is enabled. 2014-07-19 21:14:46 +02:00
Jules Blok 961076a3d5 D3D: Return to windowed mode before destroying the swapchain. 2014-07-19 21:14:45 +02:00
Jules Blok 77bc879384 D3D: Add exclusive fullscreen support. 2014-07-19 21:14:44 +02:00
Jules Blok d72375fdfa D3D: Request desktop resolution before overriding the buffer size.
This fixes issues where the wrong refresh rate is selected for some monitors.
2014-07-19 21:14:44 +02:00
Jules Blok c323b386ae Prevent DXGI from making changes to the window.
Prevents DXGI from responding to Alt+Enter and messing up our fullscreen handling.
2014-07-19 21:14:43 +02:00
Dolphin Bot b9dc69105d Merge pull request #595 from Armada651/pref_log
FPSCounter: Flush the logs every second and close them when the renderer is shut down.
2014-07-18 12:59:04 +02:00
Jules Blok 3b978f7c27 Turn the FPSCounter namespace into a class. 2014-07-16 20:40:40 +02:00
degasus 7e79806efc remove unused globals
Also change globals into statics which are only used in one file
2014-07-11 16:10:20 +02:00
degasus 81ed17be53 avoid the extern keyword in .cpp files 2014-07-11 16:10:20 +02:00
Jules Blok 1754cbda9d Move FPSCounter calls to RenderBase. 2014-07-10 23:11:09 +02:00
Lioncash a523a6d1bf D3D: Use std::strings for Compile[x]Shader and CompileAndCreate[x]Shader
With strings, we don't need to care about passing in a length, since it internally stores it. So now, we don't even need a length parameter for these functions anymore as well.
This also kills off some sprintf_s calls.
2014-07-07 19:32:03 -04:00
Lioncash 00efaedb02 FPS counter cleanup
- Isolate it into it's own namespace
- Shorten function names, the namespace self-documents.
- Just use the std I/O, we can just write directly to the stream for
  logging.
2014-07-02 20:23:09 -04:00
degasus f1ddd3c66a VideoCommon: remove unused stats 2014-06-27 09:35:26 +02:00
Lioncash ca5340ebde Centralize the logging code into its own folder in Common. 2014-06-25 22:11:42 -04:00
Lioncash 8b13afbb8e Remove the 32-bit config platform from the VS solution and projects 2014-06-24 22:07:26 -04:00
Tony Wasserka fbca397c92 Merge pull request #439 from degasus/lighting-fix
Lighting cleanup
2014-06-21 12:17:26 +02:00
Paul Olszewski c5ef249c4b Make the common "Failed to enumerate outputs" message much more useful.
Now it includes its most common cause, a simply-worded solution, and an exclamation point.
2014-06-20 15:51:54 -05:00
degasus 924ad1ee9f LightingShader: hard code const variable 2014-06-19 16:46:53 +02:00
degasus d93f2973f7 PixelShader: use the vertex const buffer for ppl 2014-06-19 16:33:33 +02:00
Tony Wasserka e642c8d0c1 Merge pull request #497 from Armada651/osd-scaling
D3D: Reset viewport before drawing the OSD.
2014-06-19 15:26:10 +02:00
Lioncash ce54c1e571 Kill off replaceable usages of s[n]printf. 2014-06-18 19:53:38 -04:00
Jules Blok 6c52ec93b7 D3D: Reset viewport before drawing the OSD. 2014-06-16 23:34:54 +02:00
Armada f2759ffe65 Remove EmuWindow.
All it did was raise complexity.
2014-06-15 00:49:49 +02:00
Lioncash 49b0eef393 Remove the min/max functions in CommonFuncs.
The algorithm header has the same functions.
2014-05-29 21:44:41 -04:00
shuffle2 329fcad04f Merge pull request #421 from CarlKenner/MissingSpace
Fix error message when D3D11 HResults fail.
2014-05-29 14:06:18 -07:00
CarlKenner 361d53fdc7 Fix error message when D3D11 HResults fail.
Prevents showing the wrong function name by putting a space between the function name and "Failed".
Also fixes the capitalization.
2014-05-27 00:45:26 +09:30
Lioncash 1583ce9363 Use strings instead of arbitrary buffers for video statistics 2014-05-25 21:11:29 -04:00
magumagu 1357277f40 Video backends: mass-replace "xfregs" with "xfmem". 2014-05-16 18:58:07 -07:00
Shawn Hoffman 17577affba D3D: Don't pass D3D10_SHADER_WARNINGS_ARE_ERRORS to the compiler in debug builds.
For quite a while this has been causing integer division to generate a warning as error, blocking shader compiling. This means probably no one has even been running D3D in debug builds...
I tried disabling the warning with a #pragma, but it doesn't seem to apply when this flag is used.
2014-05-10 22:12:54 -07:00
Tony Wasserka a40ea4e26a Merge pull request #236 from magumagu/d3d11-fix-peekz
D3D11: Use appropriate shader for PEEK_Z.
2014-04-27 16:09:02 +02:00
magumagu 648b9865d8 D3D11 backend: fix rounding in texture encoder.
We need to explicitly round when converting colors from float to uint
because multiplying a normalized float by 255 might not result in a whole
number.  (The exact result here may vary depending on your
drivers/hardware.)

Ideally, we shouldn't be using floating point here, but fixing that is a
much more complicated patch.

Fixes gxtest TEV tests using Intel HD 4000.
2014-04-15 23:36:05 -07:00
magumagu fd9c1fa746 VideoBackend: remove unused config vars.
No point to keeping around variables which are always "true".
2014-04-11 14:53:12 -07:00
magumagu 76d7c1eb9c D3DBackend: Don't recompute ID3D11Layout.
CreateInputLayout requires a shader as an input, but it only cares about
the signature; we don't need to recompute it for different shaders with
the same inputs.
2014-04-11 13:13:01 -07:00
magumagu f9d2f7e88c D3D11: Use appropriate shader for PEEK_Z.
Trying to use GetDepthMatrixProgram outside of
TCacheEntry::FromRenderTarget is a bad idea, so don't.  Instead, use a
shader which only copies the input.

Fixes lens flare depth test in Twilight Princess. See
http://code.google.com/p/dolphin-emu/issues/detail?id=5999 .
2014-03-30 19:50:53 -07:00
Tony Wasserka 16105db709 BPMemory: Make use of BitField in a number of structures. 2014-03-25 23:57:58 +01:00
Tony Wasserka 8941f19cdb BPMemory: Expose the pixel_format and zformat fields in PE_CONTROL as enumerations. 2014-03-25 23:57:58 +01:00
Tillmann Karras 7e39cf3b0d .gitignore: fix the build directory pattern 2014-03-17 02:55:56 +01:00
Tillmann Karras 2fcaca0603 More range-based loops and overrides 2014-03-17 02:55:55 +01:00
Lioncash a82675b7d5 Kill off some usages of c_str.
Also changes some function params, but this is ok.
Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
2014-03-14 13:51:23 -04:00
Matthew Parlane 31cfc73a09 Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
Tillmann Karras 7c93f2dc23 Fix the Windows build (broken in 315a8ba) 2014-03-01 01:33:19 +01:00
Tillmann Karras 315a8ba1c0 Various changes suggested by cppcheck
- remove unused variables
- reduce the scope where it makes sense
- correct limits (did you know that strcat()'s last parameter does not
  include the \0 that is always added?)
- set some free()'d pointers to NULL
2014-02-28 12:43:20 +01:00
Pierre Bourdon 425f9dcd51 Fix more header sorting issues in VideoBackends/ (now check-includes clean). 2014-02-20 01:01:11 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
Lioncash 3fd87a7636 Second and final pass of clearing out tabs. 2014-02-17 02:19:41 -05:00
Ryan Houdek 6b5f6ddaa1 Merge pull request #82 from lioncash/vertical-alignment
Fix some vertical alignments
2014-02-16 19:12:42 -06:00
Lioncash 6c4ee1753a Fix some vertical alignments
ie. uses spaces for alignment.
2014-02-16 20:12:05 -05:00
Tony Wasserka de5bfd0bce Merge pull request #37 from degasus/VideoCommonApiFixes
VideoCommon API cleanups
2014-02-16 22:08:28 +01:00
Pierre Bourdon 92f8d93e96 Remove the old MMIO access "interface". 2014-02-16 19:22:40 +01:00
degasus 647aad0a19 inline SetViewport into VertexShaderManager 2014-02-15 21:09:42 +01:00
degasus d5f1f0d4a9 merge some common parts of Swap() into VideoCommon 2014-02-15 11:33:43 +01:00
degasus 3551259c7a use EFBRectangle for scissor rect
This one is backend independed. The backend should recalc such things on their own.
2014-02-15 11:33:43 +01:00
degasus 1f4219b5b4 move perfquery enable checks into videocommon (caller side) 2014-02-15 11:33:43 +01:00
degasus 5a660c27bc rename UpdateViewport to SetViewport like all others setters in RenderBase.h 2014-02-15 11:33:43 +01:00
degasus e5318d2624 move shared parts from VertexManager::vFlush into VideoCommon 2014-02-15 11:33:43 +01:00
Lioncash 655d22512b Kill off some usages of the ArraySize macro.
This required the use of std::array in some cases.
2014-02-15 02:43:54 -05:00
Tillmann Karras 404624bf0b Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
2014-02-13 09:05:50 +01:00
lioncash d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Tony Wasserka 3dd31fe22b Merge pull request #11 from degasus/VertexLoaderCleanup
Vertex loader cleanup.
2014-01-31 06:13:26 -08:00
degasus 010a0d481a VideoCommon: remove Cache Displaylist
This option was known to break every second game and only boost a bit.
It also seems to be broken because of streaming into pinned memory and buffer storage buffers.

v2: also remove dlc_desc
2014-01-31 07:30:55 +01:00
degasus a65162f1cd PortableVertexFormat: use AttributeFormat for posmtx attribute format 2014-01-31 07:19:34 +01:00
degasus 6c59b691b0 PortableVertexFormat: use AttributeFormat for texcoord attribute format 2014-01-31 07:19:34 +01:00
degasus ef2d6e7d53 PortableVertexFormat: use AttributeFormat for color attribute format 2014-01-31 07:19:34 +01:00
degasus b38ef39ab7 PortableVertexFormat: use AttributeFormat for normal attribute format 2014-01-31 07:19:34 +01:00
degasus 210f4f3e55 PortableVertexFormat: add a struct which hold all needed information for every vertex and use this for position
atm, position attribute is hardcoded both in VertexLoader and in backends.

v2: fix coding style + cleanup lookup table
2014-01-31 07:19:25 +01:00
degasus 02d1d8e6a0 NativeVertexFormat: swap unsigned / signed formats to match GX order 2014-01-30 11:12:10 +01:00
crudelios 9b6c6fa9e4 BBox: Changed the rounding again, the old one fixed Paper Mario but had bugs in Mickey's Magical Mirror. This change fixes the glitches in both games.
Also fixed some compiler warnings.
2014-01-26 13:21:22 +00:00
degasus 1ff681a412 D3D: move streaming buffer fallback into D3D backend
Neith OGL nor VideoCommon doen't use it, so there is no need to have it in VideoCommon.
2014-01-23 15:27:18 +01:00
degasus ebbf1d392b VideoCommon: merge trivial parts of VertexManager::Flush 2014-01-21 10:47:00 +01:00
degasus 6b01839525 VideoCommon: merge triangle+list+point index buffers
We are used to render them out of order as long as everything else matches, but rendering order does matter, so we have to flush on primitive switch. This commit implements this flush.
Also as we flush on primitive switch, we don't have to create three different index buffers. All indices are now stored in one buffer.

This will slow down games which switch often primitive types (eg ztp), but it should be more accurate.
2014-01-17 16:34:53 +01:00
degasus 5e5db9fbc6 VideoCommon: cleanup of "components" usage
This "u32 components" is a list of flags which attributes of the vertex loader are present.
We are used to append this variable to lots of vertex generation functions, but some of them don't need it at all.
2014-01-15 16:58:36 +01:00
degasus eb310cbd1d VideoCommon: disable efb access + perf querys on cph thread
The usual way to handle this kind of request is to rise a flag which the gpu thread polls.
The gpu thread itself either generates the result or just write zeros if disabled.
After this, it rise another flag which says that this work is done.

So if disabled, we still have the cpu-gpu round trip time. This commit just returns 0 on the cpu thread
instead of playing ping pong...
2014-01-09 18:37:59 +01:00
NeoBrainX 55717ed216 D3D: Verbosify an error message. 2014-01-06 10:31:09 +00:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00
Jasper St. Pierre 43e618682e Convert all vcxproj files to UNIX line endings 2013-12-31 14:03:18 -05:00
Tony Wasserka de16b7207c D3D/OGL: Add a TODO noting that we don't support GX_CULL_ALL, most notably required for accurate zfreeze emulation. 2013-12-30 20:37:59 +01:00
degasus 09f4439d0c VideoCommon: reorder cbufid in orderer. We've used once two times 2013-11-24 04:43:54 +01:00
degasus 7d58278b67 Merge branch 'efb2tex_alpha' 2013-11-24 04:02:38 +01:00
degasus 2bf7379a7f D3D: also fix MAX_COPY_BUFFERS
the D3D backend caches the colmat buffers. As we've created more different colmats, the maximum of this matrices must also be updated.
2013-11-24 04:00:12 +01:00
Matthew Parlane 0a31255943 Unused arguments removed from XFBSource::Draw
Thanks neo.
2013-11-24 11:33:43 +13:00
Matthew Parlane 33d8166620 Use IOFile for TextureToPng to support non-ascii
Changed save texture/screenshot uses to std::string
Removed unneeded new/delete calls when dealing with temp data.
2013-11-17 11:14:38 +13:00
Matthew Parlane 71d70d896f Api was too confusing for people. 2013-11-17 10:34:34 +13:00
Matthew Parlane 033ed9477e Reworked Screenshot saving.
Now OGL doesn't rely on WX for PNG saving.
FlipImageData supports (pixel data len > 3) now.
TextureToPng is now in ImageWrite.cpp/h
Video Common depends on zlib and png.
D3D no longer depends on zlib and png.
2013-11-15 13:00:38 +13:00
Matthew Parlane 7e9b970240 Use libpng for saving images.
TODO: Needs threading done similiar to OGL backend.
Fixes issue 6779.
2013-11-14 21:02:49 +13:00
Matthew Parlane ca5b3b4773 atlbase not needed. Interim fix until I get png done. 2013-11-14 18:10:39 +13:00
Matthew Parlane 7b53574b68 Support texture and screenshot dumping using WIC, no XP support. 2013-11-14 00:48:02 +13:00
Matthew Parlane abc3bddb54 Revert "D3D: Reintroduce depencency on D3DX11 because it's the most straightforward way to bring back some broken features."
This reverts commit a83c239765.
2013-11-14 00:34:09 +13:00
Jordan Cristiano f96e9e1ae4 warnings and code formatting 2013-11-13 04:03:46 -05:00
Tillmann Karras 268bdf19ce Fix format string warnings 2013-11-13 04:01:16 +01:00
Tony Wasserka 22f727cc69 D3D: Use D3DX11 for taking screenshots. 2013-11-10 00:22:35 +01:00
Tony Wasserka 0b02880b76 Revert "Be less dumb."
Revert "Actually, filename really does need to be a parameter because of some random debug thing."
Revert "fix non-HAVE_WX case"
Revert "Handle screenshot saving in RenderBase.  Removes dependency on D3DX11 for screenshots (texture dumping is still broken)."

This reverts commits 00fe5057f1, 74b5fb3ab4, cd46138d29 and 5f72542e06 because taking screenshots in D3D still crashed for me so there was no point in the code changes (which I found ugly anyway).
2013-11-10 00:22:33 +01:00
Tony Wasserka 3de2ee5d46 D3D: Use D3DX for texture dumping. 2013-11-10 00:22:31 +01:00
Tony Wasserka a83c239765 D3D: Reintroduce depencency on D3DX11 because it's the most straightforward way to bring back some broken features.
The Dolphin development team is incapable of providing sufficient replacement for its previous usage in Dolphin and the advantages of dropping the dependency do not justify the removal of screenshots and texture dumping.

From now on, d3dx11.h, d3dx11async.h, d3dx11core.h and d3dx11tex.h are required to be stored somewhere in the header include path. I don't know if this is the case for anyone else than me, but I can't really say that I care after having people randomly merge unfinished branches into master.
2013-11-10 00:18:03 +01:00
comex c579637eaf Run code through the advanced tool 'sed' to remove trailing whitespace. 2013-11-03 20:54:05 -05:00
comex 74b5fb3ab4 Actually, filename really does need to be a parameter because of some random debug thing. 2013-11-02 22:44:27 -04:00
comex 5f72542e06 Handle screenshot saving in RenderBase. Removes dependency on D3DX11 for screenshots (texture dumping is still broken). 2013-11-02 22:19:21 -04:00
comex 82729fcc8f Merge remote-tracking branch 'shuffle2/vc12'
Conflicts:
	Source/Core/Common/Common.vcxproj
	Source/Core/Common/Common.vcxproj.filters
2013-10-31 16:51:56 -04:00
degasus 8e0f91f70e d3d: use backend based UpdateViewport instead of VideoCommon one 2013-10-29 18:55:50 +01:00
degasus 3151d8709c VideoCommon: move ViewportCorrection into VideoCommon
D3D doesn't allow bigger viewports than rendertargets. But flipper does, so the viewport will be clipped and the transformation matrix will be changed.
This was done in the D3D backend itself. This is now moved into VideoCommon. This don't reduce code, but in this way, VideoCommon doesn't depend on the backends.
2013-10-29 18:55:50 +01:00
Shawn Hoffman ccd30024b3 Update to VS2013 and a slew of build-related updates. Notes:
* Currently there is no DEBUGFAST configuration. Defining DEBUGFAST as a preprocessor definition in Base.props (or a global header) enables it for now, pending a better method. This was done to make managing the build harder to screw up. However it may not even be an issue anymore with the new .props usage.
* D3DX11SaveTextureToFile usage is dropped and not replaced.
* If you have $(DXSDK_DIR) in your global property sheets (Microsoft.Cpp.$(PlatformName).user), you need to remove it. The build will error out with a message if it's configured incorrectly.
* If you are on Windows 8 or above, you no longer need the June 2010 DirectX SDK installed to build dolphin. If you are in this situation, it is still required if you want your built binaries to be able to use XAudio2 and XInput on previous Windows versions.
* GLew updated to 1.10.0
* compiler switches added: /volatile:iso, /d2Zi+
* LTCG available via msbuild property: DolphinRelease
* SDL updated to 2.0.0
* All Externals (excl. OpenAL and SDL) are built from source.
* Now uses STL version of std::{mutex,condition_variable,thread}
* Now uses Build as root directory for *all* intermediate files
* Binary directory is populated as post-build msbuild action
* .gitignore is simplified
* UnitTests project is no longer compiled
2013-10-26 17:55:38 -07:00
Tony Wasserka f82e1b9dc7 D3D: Use floating points for viewport parameters.
OpenGL 4.1 allows for a similar change thanks to ARB_viewport_array, but we don't make use of this, yet.
2013-10-26 12:40:37 +02:00
degasus 6e2fe72b8f D3D: also uses VideoCommon constant buffer handling
As now both backends uses the VideoCommon one, the old setting API was removed.
2013-10-12 20:29:56 +02:00
degasus 4377618438 VideoCommon: keep a copy of the const buffer in VideoCommon
The upload in the backend isn't done, it's just pushed by the mostly removed SetMulti*SConstant4fv.
Also no optimizations was done on VideoCommon side, but I can start now :-)

Sorry for the hacky way, but I think this is a nice (working) snapshot for a much bigger change.
2013-10-12 20:29:56 +02:00
Matthew Parlane 414ed6ef63 C.K. should fix his website before throwing stones at obsolete xml. 2013-10-09 23:56:16 +13:00
Matthew Parlane fbcc41c18e Fix references for OGL, SW and D3D. 2013-10-09 23:49:00 +13:00
Matthew Parlane eb480a406c Fix Windows vcxproj files. 2013-10-08 17:52:18 +13:00
Jasper St. Pierre 9920362581 Fix MSVC project files
yay relative paths
2013-10-07 18:50:21 -04:00
Jasper St. Pierre a7c7208103 Put Plugins/ in Core/, rename to VideoBackends 2013-10-07 10:37:01 -04:00