Commit Graph

746 Commits

Author SHA1 Message Date
Silent 77425ef83b
D3D11: Ownership fixes for objects in D3DState 2019-07-29 16:39:21 +02:00
Silent 88db577c17
D3D11: Correctly poll ALL possible AA levels. 2019-07-29 16:39:06 +02:00
Silent 799c52463e
Fixes for WRL usage - QueryInterface is explicitly mentioned as not to be used with WRL ComPtr 2019-07-26 19:38:58 +02:00
Lioncash 2b9389202e VideoCommon: Remove unused MathUtil.h include from VideoCommon.h
This header doesn't actually make use of MathUtil.h within itself, so
this can be removed. Many other source files used VideoCommon.h as an
indirect include to include MathUtil.h, so these includes can also be
adjusted.

While we're at it, we can also migrate valid inclusions of VideoCommon.h
into cpp files where it can feasibly be done to minimize propagating it
via other headers.
2019-07-16 20:54:34 -04:00
Lioncash d4337eebde VideoCommon/Statistics: Rename stats global to g_stats
Makes the global variable follow our convention of prefixing g_ on
global variables to make it obvious in surrounding code that it's not a
local variable.
2019-07-10 23:34:54 -04:00
Lioncash a99c7d01e1 VideoCommon/Statistics: Normalize statistic variable names
Normalizes all variables related to statistics so that they follow our
coding style.

These are relatively low traffic areas, so this modification isn't too
noisy.
2019-07-10 23:19:10 -04:00
Connor McLaughlin 951b66e4ac
Merge pull request #8049 from stenzek/crop
Renderer: Adjust source rectangle when crop would draw off screen
2019-06-08 20:57:52 +10:00
Stenzek 9316e25652 D3DCommon: Fallback to base CreateSwapChain on failure
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-08 20:11:49 +10:00
Lioncash a9663669dc Common/CommonFuncs: Remove now-unneccessary ArraySize function
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-06-01 10:07:57 -04:00
Lioncash e60268bd42 VideoCommon/RenderBase: Use a std::string_view with CreateShaderFromSource()
Greatly simplifies the overall interface when it comes to compiling
shaders. Also allows getting rid of a std::string overload of the same
name. Now std::string and const char* both go through the same function.
2019-05-30 03:29:35 -04:00
Pokechu22 69d9d9f87a Also free when initialization fails, and move to end 2019-05-26 19:59:29 -07:00
Pokechu22 19fb3bb4fe DX11: Fix access violation on closing dolphin 2019-05-26 15:01:05 -07:00
spycrab 6cef70c182 VideoBackends/D3D: Fix CMakeLists.txt 2019-05-12 00:05:09 +02:00
Techjar ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Léo Lam ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
Stenzek 32359bf2bb Renderer: Adjust target rectangle in the base class 2019-04-28 23:33:24 +10:00
Stenzek 3c64f0c616 Renderer: Adjust source rectangle when crop would draw off screen
This prevents us from requiring an oversized and/or negative viewport by
shrinking the source rectangle instead.
2019-04-28 23:31:57 +10:00
Stenzek 025767c929 D3D: Set optional features after creating the device
Fixes feature level 10.0 devices crashing during runtime.
2019-04-28 15:26:49 +10:00
Stenzek f8c1ba409c Replace EFBRectangle/TargetRectangle with MathUtil::Rectangle 2019-04-21 14:28:14 +10:00
Stenzek 61a656570e AbstractPipeline: Support returning "cache data"
"Cache data" can be used to assist a driver with creating pipelines by
using previously-compiled shader ISA.
2019-04-16 00:09:47 +10:00
Connor McLaughlin f3fadd7302
Merge pull request #7869 from stenzek/d3dcommon
D3D: Move sharable D3D11/D3D12 code to common library
2019-03-29 20:40:06 +10:00
Stenzek d0d010f854 D3D11: Make stateman a unique_ptr 2019-03-29 19:55:00 +10:00
Stenzek 1151a1238f D3D11: Use ComPtr smart pointer where possible 2019-03-29 19:52:38 +10:00
Stenzek 3d8014beb5 D3D11: Use D3DCommon where appropriate 2019-03-29 19:52:38 +10:00
Stenzek 16294acd2a VideoBackends: Scale bounding box rectangle in the pixel shader 2019-03-25 18:47:58 +10:00
Stenzek 65216c9e87 VideoConfig: Add SupportsPartialDepthCopies to backend info
D3D11 doesn't support partial copies of depth buffers via
CopySubResource(), so we need to use a different path for the EFB cache.
2019-03-09 12:19:53 +10:00
Stenzek 21d81f99ff VideoBackends: Fix GPU decoding of XFB buffers
Was using UNORM instead of UINT, resulting in invalid values.
2019-02-28 20:35:22 +10:00
Stenzek f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Stenzek b01df8670f Renderer: Fix throttle-disable (TAB) hotkey when vsync is enabled 2019-01-27 12:31:12 +10:00
Stenzek e4b205c769 Decouple XFB scanout from presentation 2019-01-25 11:15:57 +10:00
Stenzek c9c0b85056 VideoBackends: Store a backbuffer 'scale'
This is a scaling factor, used for hi-dpi configurations.
2019-01-25 11:15:57 +10:00
Stenzek 63dd91628d Remove old RasterFont classes 2019-01-25 11:15:57 +10:00
Stenzek 600d1fc0bc Renderer: Use imgui for drawing debug text and OSD 2019-01-25 11:15:57 +10:00
Stenzek d1868d9475 RenderBase: Implement imgui rendering 2019-01-25 11:10:49 +10:00
Stenzek 7afd5cc2fb Use main buffers for utility draws 2018-12-04 17:37:25 +10:00
Stenzek b409a87d1a D3D: Clamp viewport to current framebuffer dimensions, not target 2018-12-04 17:36:08 +10:00
Stenzek 2644e920cc Renderer: Add backbuffer format to base class 2018-12-04 17:36:08 +10:00
Stenzek 1adcd47dcb Renderer: Add a base Initialize() method to match Shutdown() 2018-12-04 17:36:08 +10:00
Stenzek 8e2c063d62 TextureCache: Implement deferred/batched EFB copies 2018-11-07 16:25:01 +10:00
Stenzek eb284b5d66 VideoBackends: Pass window system info from host on creation 2018-10-20 21:11:34 +10:00
Stenzek 1d827a5223 Renderer: Pull dimensions from GLInterface/Swapchain 2018-10-20 21:11:34 +10:00
Stenzek a3961750a7 Drop Host_GetRenderSurface and pass display to backend 2018-10-20 21:11:34 +10:00
Tillmann Karras 97cc9894e4 Update to Visual Studio's default Windows SDK 2018-10-20 00:53:08 +01:00
Stenzek eb33d7af64 Core: Call InitBackendInfo before loading config 2018-09-28 21:44:41 +10:00
Stenzek b30342d38f VideoBackends: Support D24S8 abstract texture format 2018-07-19 21:47:42 +10:00
Techjar dc2f22516c Mark all video backend names for translation 2018-06-30 06:30:19 -04:00
Stenzek 640bfb8135 VideoConfig: Add a field for indicating logic op support in the backend 2018-05-26 00:07:20 +10:00
Stenzek f74dbc794c EFB2RAM: Apply copy filter as a float coefficient after sampling
Using 8-bit integer math here lead to precision loss for depth copies,
which broke various effects in games, e.g. lens flare in MK:DD.

It's unlikely the console implements this as a floating-point multiply
(fixed-point perhaps), but since we have the float round trip in our
EFB2RAM shaders anyway, it's not going to make things any worse. If we
do rewrite our shaders to use integer math completely, then it might be
worth switching this conversion back to integers.

However, the range of the values (format) should be known, or we should
expand all values out to 24-bits first.
2018-05-22 12:24:08 +10:00
Emmanuel Gil Peyrot c51ae9c62a Remove SOIL altogether from the project. 2018-05-20 13:44:42 +02:00
Markus Wick c485efdfe1
Merge pull request #6743 from stenzek/faster-disabled-copy-filter
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-17 10:45:50 +02:00