summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/D3DBase.cpp
AgeCommit message (Collapse)Author
2025-11-22AudioCommon / VideoBackends / WinUpdater - cleanup WRL codeoltolm
2023-06-19Video: implement color correction to match the NTSC and PAL color spaces ↵Filoppi
(and gamma) that GC and Wii targeted. To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and do them in linear space instead of gamma space (which is very important when playing at low resolutions). For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted. Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly) as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used by video standards dating to the pre HDR era (roughly gamma 2.35). Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games with strongly different and simpler lighting. HDR should also be supported in Linux. Development of my own AutoHDR shader is almost complete and will come next. This has been carefully tested and there should be no regression in any of the different features that Dolphin offers, like multisampling, stereo rendering, other post processes, etc etc. Fixes: https://bugs.dolphin-emu.org/issues/8941 Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com> Co-authored-by: Dogway <lin_ares@hotmail.com>
2022-01-09VideoBackends/D3D11: Include HRESULT in error messagesPokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-01-27rename D3DCommon/Common to D3DCommon/D3DCommonShawn Hoffman
2020-12-02General: Convert PanicAlerts over to fmt equivalentLioncash
Converts lingering panic alert calls over to the fmt-capable ones.
2020-11-09D3D: Migrate logging over to fmtLioncash
Migrates the logging over to the fmt-capable logger.
2019-07-29D3D11: Query for output merger logic op support and use logic op code only ↵Silent
if supported Previously code assumed that if DX11.1 runtime is supported, logic ops will, but Windows 7 SP1 with a Platform Update supports DX11.1 runtime without logic ops. This created pretty jarring visual artifacts, which now should be gone OR replaced with much less jarring errors.
2019-07-29D3D11: Correctly poll ALL possible AA levels.Silent
2019-07-26Fixes for WRL usage - QueryInterface is explicitly mentioned as not to be ↵Silent
used with WRL ComPtr
2019-06-08D3DCommon: Fallback to base CreateSwapChain on failureStenzek
It appears that some older drivers do not support CreateSwapChainForHwnd, resulting in DXGI_ERROR_INVALID_CALL. For these cases, fall back to the base CreateSwapChain() from DXGI 1.0. In theory this should also let us run on Win7 without the platform update, but in reality we require the newer shader compiler so this probably won't work regardless. Also any hardware of this vintage is unlikely to run Dolphin well.
2019-06-01Common/CommonFuncs: Remove now-unneccessary ArraySize functionLioncash
Since C++17, non-member std::size() is present in the standard library which also operates on regular C arrays. Given that, we can just replace usages of ArraySize with that where applicable. In many cases, we can just change the actual C array ArraySize() was called on into a std::array and just use its .size() member function instead. In some other cases, we can collapse the loops they were used in, into a ranged-for loop, eliminating the need for en explicit bounds query.
2019-05-26Also free when initialization fails, and move to endPokechu22
2019-05-26DX11: Fix access violation on closing dolphinPokechu22
2019-04-28D3D: Set optional features after creating the deviceStenzek
Fixes feature level 10.0 devices crashing during runtime.
2019-03-29D3D11: Make stateman a unique_ptrStenzek
2019-03-29D3D11: Use D3DCommon where appropriateStenzek
2019-02-19Move most backend functionality to VideoCommonStenzek
2019-01-27Renderer: Fix throttle-disable (TAB) hotkey when vsync is enabledStenzek
2018-10-20VideoBackends: Pass window system info from host on creationStenzek
2018-05-26VideoConfig: Add a field for indicating logic op support in the backendStenzek
2018-02-22D3D: Support compiling compute shadersStenzek
2018-02-20Renderer: Handle resize events on-demand instead of pollingStenzek
We now differentiate between a resize event and surface change/destroyed event, reducing the overhead for resizes in the Vulkan backend. It is also now now safe to change the surface multiple times if the video thread is lagging behind.
2017-11-30D3DBase: Mark file-scope variables as internally linked where applicableLioncash
2017-11-22D3D: Remove BeginFrame/EndFrameStenzek
These functions did not do anything anyway. There is also no need to present the backbuffer when shutting down.
2017-11-18VideoConfig: Make StereoMode an enum classLioncash
Makes for more strongly-typed identifiers (and doesn't pollute surrounding namespaces)
2017-09-04D3DBase: Support the "allow tearing" DXGI flags.Jules Blok
This makes sure our framerate is unlocked when we disable V-Sync.
2017-09-03Merge pull request #6013 from stenzek/d3d-logic-opAnthony
D3D: Implement logic op support
2017-09-03Merge pull request #5337 from stenzek/d3d-common-blending-stateAnthony
D3D: Use blending state from VideoCommon
2017-09-03D3DBase: Use the correct version of CreateDXGIFactory.Jules Blok
2017-09-03Merge pull request #5948 from Armada651/d3d-explicit-stereoStenzek
D3DBase: Only use a stereo swapchain if quad-buffering is enabled.
2017-09-03D3D: Use Direct3D 11.1 where supportedStenzek
2017-09-03D3D11: Create debug device when validation layer is enabled in optionsStenzek
2017-09-02D3D: Eliminate redundant ID3D11DeviceChild* castsLioncash
2017-08-20D3DBase: Only use a stereo swapchain if quad-buffering is enabled.Jules Blok
2017-08-02D3DBase: Raise error if d3dcompiler_47.dll cannot be loadedStenzek
Previously we were falling back to an earlier version of the compiler. The older version cannot compile our ubershaders without various graphical issues.
2017-08-01HiresTextures: Support loading BC7 (BPTC) from DDS filesStenzek
2017-07-30D3D: Uber shader supportStenzek
2017-07-10D3DBase: Use the swapchain discard mode when possible.Jules Blok
2017-07-10D3D: Resize the swapchain when the fullscreen state is changedJules Blok
2017-07-10D3DBase: Set the fullscreen state in Create()Jules Blok
2017-07-10D3DBase: Only create a stereo swapchain when needed.Jules Blok
2017-07-10D3DBase: Implement Windows 7 swapchain fallback.Jules Blok
2017-07-10D3DBase: Only use temporary mono when supported by the swapchain.Jules Blok
2017-07-05D3DBase: Set the monoscopic flag when we don't use stereoscopy.Jules Blok
2017-07-05D3DBase: Always create a stereo swapchain.Jules Blok
2017-07-05D3D: Add quad-buffer stereoscopy support.Jules Blok
2017-07-05D3DBase: Switch to a flip-model swap chain.Jules Blok
2017-07-05D3DBase: Upgrade to DXGI 1.2.Jules Blok
This effectively drops for Vista and Windows 7 without the Platform Update in this backend.
2017-06-07video: change multisample/AA setting to u32Shawn Hoffman