1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 19:24:11 +01:00
Commit Graph

329 Commits

Author SHA1 Message Date
Philip Rebohle
6c2f16fce8
[dxgi] Add methods to retrieve original format mappings 2019-03-26 17:54:14 +01:00
Philip Rebohle
be1832a348
[d3d11] Don't sample gamma texture if the gamma curve is identity
Saves some GPU time in games that don't use DXGI gamma control at all.
2019-03-24 18:07:21 +01:00
Philip Rebohle
1656860486
[dxgi] Remove obsolete global monitor helper functions 2019-03-14 18:26:39 +01:00
Philip Rebohle
5b72e84726
[dxgi] Use IDXGIVkMonitorInfo in DxgiSwapChain 2019-03-14 18:26:39 +01:00
Philip Rebohle
50347e1256
[dxgi] Use IDXGIVkMonitorInfo in DxgiOutput 2019-03-14 18:26:39 +01:00
Philip Rebohle
7d5b5f288c
[dxgi] Implement IDXGIVkMonitorInfo for DxgiFactory 2019-03-14 18:26:39 +01:00
Philip Rebohle
cfdac13ea5
[dxgi] Add new COM interface for per-monitor data 2019-03-14 18:26:37 +01:00
Joshua Ashton
62a833b528 [dxgi] Correct return values for CreateDXGIFactory[1/2] 2019-02-27 22:01:04 +01:00
Philip Rebohle
746562de5a
[dxgi,d3d11] Remove IDXGIVkPresentDevice 2019-02-11 20:06:12 +01:00
Philip Rebohle
9f8c1d08a6
[dxgi,d3d11] Move swap chain creation to D3D11 module 2019-02-11 20:06:12 +01:00
Philip Rebohle
7ed91872b6
[dxgi] Use IWineDXGISwapChainFactory to create DXGI swap chains 2019-02-11 20:06:11 +01:00
Joshua Ashton
5ea8648cd9 [d3d11, d3d10, dxgi] Handle null ppvObject in QueryInterface. (#909)
When a null ppvObject is passed into a QueryInterface on any IUnknown, a E_POINTER should be returned as the result (and it should not crash.)

This matches native d3d11/d3d10/dxgi behaviour and the documentation found here https://docs.microsoft.com/en-us/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q_) for IUnknown.
2019-02-10 08:01:01 +01:00
Philip Rebohle
2bae3a5c8b
[d3d11] Reintroduce support for dxgi.maxFrameLatency
This option was previously ignored for some reason.
2019-01-14 18:29:25 +01:00
Philip Rebohle
cf9de54a12
[dxgi] Add dxgi.nvapiHack option to disable NVAPI workaround 2019-01-10 11:58:16 +01:00
Philip Rebohle
4e22e4bc3a [dxgi] Refactor swap chain creation
Cleans up constructor and moves a bunch of common code
to the new CreateDxvkSwapChainForHwnd function, which
can be called from both d3d11 and dxgi.

Also fixes potential issues with the current implementation
of the IWineDXGISwapChainFactory interface.
2018-12-21 15:53:29 +01:00
Philip Rebohle
15078357dc [dxgi] Implement and use GetWindowClientSize fuction
This new function provides a cleaner way to retrieve a
window's client size and can be used outside the swap
chain functions.
2018-12-21 15:14:07 +01:00
Philip Rebohle
1e393bf24d [d3d11] Implement IWineDXGISwapChainFactory
See #822.
2018-12-21 14:03:28 +01:00
Philip Rebohle
64aefcc2a1
[dxgi] Catch exception when instance creation fails
Fixes #810.
2018-12-12 18:36:37 +01:00
Philip Rebohle
d16323f56b
[dxgi] Clean up DxgiAdapter 2018-12-11 16:03:37 +01:00
Philip Rebohle
a29b9f6779
[dxgi] Use new mode switch API for DxgiOutput
Also removes the old functions which are no longer needed.
2018-12-11 16:02:46 +01:00
Philip Rebohle
d9cf8fdc58
[dxgi] Use new mode switch API for DxgiSwapChain 2018-12-11 16:02:46 +01:00
Philip Rebohle
1594a20b94
[dxgi] Add new functions to change the display mode of a monitor 2018-12-11 16:02:35 +01:00
Philip Rebohle
1db3c6d883
[dxgi] Remove SetOutputData and GetOutputData methods 2018-12-11 15:33:54 +01:00
Philip Rebohle
aa2ec3f998
[dxgi] Port DxgiOutput and DxgiSwapChain to new monitor data API
This allows us to remove the dependency between DxgiSwapChain
and DxgiVkAdapter without losing gamma control emulation.
2018-12-11 15:32:54 +01:00
Philip Rebohle
e30bb498b6
[dxgi] Add functions to share per-monitor data between DXGI objects 2018-12-11 15:32:00 +01:00
Philip Rebohle
57e814717e
[dxgi] Move GetOutputFromMonitor to swap chain class
Not a great solution, but we only need it for the swap chain anyway.
2018-12-10 12:38:33 +01:00
Philip Rebohle
9e9e17348f
[dxgi] DxgiSwapchain: Remove SetGammaControl methods
These were only used internally to forward stuff to the presenter
anyway, so we might as well call that method directly.
2018-12-10 12:34:57 +01:00
Philip Rebohle
7eb60daf63
[dxgi] DxgiSwapchain: Take factory as IDXGIFactory
No need to be specific about the exact type of factory.
2018-12-10 12:10:15 +01:00
Philip Rebohle
86d4d31b7c
[dxgi] Ignore scaling and scanline order during fullscreen transitions
Games usually don't use these correctly anyway, so we might as well
ignore them, since DXVK's DXGI does not report scanline modes other
than UNSPECIFIED. Fixes #291.
2018-12-06 16:38:45 +01:00
Philip Rebohle
df667b7b0e
[dxgi] Report Adapter LUID if available 2018-12-04 19:39:09 +01:00
Philip Rebohle
1cc0455c8a
[dxgi] Remove old DXGIDevice implementation and IDXGIVkDevice
Both have been moved to the D3D11 module and are no longer needed.
2018-12-04 19:38:52 +01:00
Philip Rebohle
d1f179c5af
[util] Add likely/unlikely macros 2018-11-29 22:53:04 +01:00
Philip Rebohle
af2f5cc77f
[dxgi] Remove format lookup methods from IDXGIVkAdapter interface 2018-11-28 19:06:34 +01:00
Philip Rebohle
193d24a3e2
[dxgi] Remove IDXGIVkBackBuffer 2018-11-28 18:15:27 +01:00
Philip Rebohle
80b9f1d03b
[dxvk] Remove DxvkSurface 2018-11-28 12:44:18 +01:00
Philip Rebohle
9b923bb386
[dxvk] Remove DxvkSwapChain 2018-11-28 12:44:17 +01:00
Philip Rebohle
5d49644cdc
[dxgi] Hack: Report Nvidia cards as AMD cards by default
Prevents UE4 games from repeatedly trying to load nvapi.dll
on a performance-critical code path.
2018-11-20 13:15:39 +01:00
Andrew Eikum
aea4162198 [dxgi] MultiByteToWideChar counts length in characters 2018-11-16 19:53:37 +01:00
Philip Rebohle
e4d3357e55
[dxgi] Query window size before creating presenter
Otherwise we may pass a size of zero to the presenter.
2018-11-16 15:03:09 +01:00
Philip Rebohle
c25483e856
[dxgi] Implement IDXGISwapChain3
- Stub IDXGISwapChain3::ResizeBuffers1
2018-11-15 18:02:27 +01:00
Philip Rebohle
81bb561c75
[dxgi] Implement IDXGIAdapter3 2018-11-15 18:02:21 +01:00
Philip Rebohle
171251bc83
[dxgi] Implement IDXGIFactory4
Do not support WARP adapters for the moment.
2018-11-15 17:08:36 +01:00
Philip Rebohle
0b7e114cb0
[dxgi] Implement IDXGIDevice3 2018-11-15 17:08:36 +01:00
Philip Rebohle
23ac9b5277
[dxgi] Implement IDXGISwapChain2 stubs
Most of the additions are stubs for now, but we should be
able to implement most of the functionality at a later time.

None of the backends implement this yet, but this should be
relatively easy to do.
2018-11-15 17:08:35 +01:00
Philip Rebohle
a849ffc56c
[dxgi] Implement IDXGIOutput3 2018-11-15 17:08:35 +01:00
Philip Rebohle
9af842801c
[dxgi] Implement IDXGIFactory3 2018-11-15 17:08:35 +01:00
Philip Rebohle
f03d87b918
[dxgi] Implement IDXGIOutput1
Required for DXGI 1.2.
2018-11-15 17:08:35 +01:00
Philip Rebohle
f7b2194e0b
[dxgi] Include DXGI 1.4 headers 2018-11-15 17:08:27 +01:00
Philip Rebohle
1724d51079
[dxgi] Refactor presenter creation
This change is needed to support non-D3D11 presenters in our DXGI code.
2018-11-12 11:39:34 +01:00
Philip Rebohle
0cfa5b16d3
[d3d11] Support R11G11B10 format in ClearUnorderedAccessViewUint
Silences an error message in Shadow of the Tomb Raider. Does not have
any consequences for this game because it initializes the view to 0.
2018-11-10 18:48:44 +01:00
dhewg
a05c93dd17 cross build cleanup (#746)
- Don't turn off warnings for winelib builds, fix them. Using __declspec on winelib builds just doesn't make sense.
- Drop the custom cross property 'winelib'. Detect it instead.
- Move the libdl dependency to the build system
- Don't run wine during mingw build process. Same as for wine builds, see 715d2571
2018-11-04 16:18:32 +01:00
Philip Rebohle
851d9fb726
[general] Remove unnecessary include directories from build files
These are no longer needed because dxvk includes consistently
use relative file paths now, instead of global includes.
2018-11-02 14:54:39 +01:00
Philip Rebohle
93d88afab9
[general] Fix some old includes 2018-11-02 14:37:59 +01:00
Philip Rebohle
1cd912556e
[dxvk] Move Vulkan loader to separate directory 2018-11-02 14:23:45 +01:00
Philip Rebohle
589229f4ca
[dxgi] Query device interface from the presenter
Removes the coupling between IDXGISwapChain and IDXGIDevice.
This is necessary because D3D12 devices don't support IDXGIDevice.
2018-10-24 15:54:56 +02:00
Philip Rebohle
7b9726fd93
[d3d11] D3D11Presenter -> D3D11PresentDevice 2018-10-23 15:10:01 +02:00
Philip Rebohle
83b51a66ac
[dxgi] Don't build shaders for presentation
These are now embedded in the D3D11 module.
2018-10-23 14:58:57 +02:00
Philip Rebohle
86e6477e80
[dxgi] Remove unused presenter options 2018-10-23 14:58:57 +02:00
Philip Rebohle
3b5b20ca3f
[dxgi] Remove old DXGI presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
b53f6661f8
[dxgi] Use new presenter for D3D11 2018-10-23 14:58:57 +02:00
Philip Rebohle
967b276acb
[d3d11] Add COM interface for API-agnostic presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
56e9bba279
[dxgi] Fix scaling when swap image extent mismatches window size
In Proton 3.16, the window size is not necessarily equal to the size
of the WSI swap chain and DXVK is responsible for doing the scaling,
so we should compare to the actual swap image size instead.
2018-10-15 18:35:00 +02:00
Philip Rebohle
e5f3019524
[dxgi] *Actually* silence WaitForVBlank warning
Guess who needs more coffee.
2018-10-09 19:17:20 +02:00
Philip Rebohle
6dd5cdbc3e
[dxgi] Silence WaitForVblank warning 2018-10-09 14:48:49 +02:00
Philip Rebohle
87f1cd2385
[dxgi] Fix undefined display mode format for display mode transitions
Fixes resolution change option in Dark Souls 3.
2018-10-06 08:01:48 +02:00
Philip Rebohle
894d9606d5
[dxgi] Add option to force-enable MAILBOX present mode
Provides Enhanced Sync-like functionality (#678).
2018-09-29 08:13:52 +02:00
Philip Rebohle
b73b91a5c9
[dxgi] Implement slightly better QueryResourceResidency stub
This now returns redidency values for all queried resources, but
not the correct ons. May fix issues in Fallout 4?
2018-09-27 07:31:30 +02:00
Philip Rebohle
bd4338be42
[d3d10] Add option to enable or disable D3D10 support 2018-09-24 15:26:33 +02:00
Philip Rebohle
03a760bec6
[meta] Remove redundant linker entries for the utils library
Fixes #651.
2018-09-19 21:00:44 +02:00
Philip Rebohle
fde67b9773
[dxgi] IsCurrent is not actually a stub 2018-09-16 10:20:24 +02:00
Philip Rebohle
2541aeb25c
[dxgi] Add option to override the sync interval 2018-09-09 19:14:30 +02:00
Philip Rebohle
d7b16dd90a
[dxgi] Add option to change the back buffer count 2018-09-09 19:12:07 +02:00
Philip Rebohle
b7d8be25f1
[dxgi] Use DXGI back buffer count for the Vulkan swap chain 2018-09-09 19:07:41 +02:00
Philip Rebohle
5f42950650 [dxgi] Don't use FIFO present mode if IMMEDIATE is not available
Might fix potential performance issues on Nvidia when VSYNC is disabled.
Based on RPCS3/rpcs3@25ec3789fe
2018-08-26 23:39:53 +02:00
Philip Rebohle
0704b044a9 [dxgi] Fix format parameter in CheckImageFormatSupport 2018-08-26 12:37:12 +02:00
Philip Rebohle
2bdd614d07 [dxgi] Log display mode changes 2018-08-26 12:37:12 +02:00
Philip Rebohle
57db0b60fb [dxgi] Add option to limit reported device memory size 2018-08-25 01:22:19 +02:00
Philip Rebohle
7fa6dddc9e
[dxgi] Remove dxgi.fakeDx10Support option
No longer needed because we have actual Dx10 support now.
2018-08-17 12:33:53 +02:00
Philip Rebohle
257ac9ad6c
[dxgi] Report ID3D10Device and ID3D10Device1 as supported 2018-08-13 17:22:03 +02:00
Andrew Eikum
262797f9d5 [dxgi] SetFullscreenState succeeds if not changing state
This fixes an error dialog on exiting Unreal Engine 4 games.
2018-08-13 17:06:55 +02:00
Jacek Caban
a12b3cc5a0 [dxgi] Don't use std::mbstowcs.
This will not work in winelib build.
2018-08-13 15:13:22 +02:00
Philip Rebohle
031964b038
[dxgi] Fix BGRA view format compatibility 2018-08-11 03:23:52 +02:00
Philip Rebohle
50dfab2797
[dxgi] Re-enable SRGB-to-UNORM compatibility
D3D11 is highly inconsistent here and seems to allow UNORM
render target views for SRGB images, but not UAVs.
2018-08-10 19:04:38 +02:00
Philip Rebohle
24dd173d12
[dxgi] Fix resolve image usage flags
When meta-resolve is used for the back buffer, it will
be used as a color attachment, and we need to set up
the usage and stage/access flags accordingly.
2018-08-07 19:26:59 +02:00
Philip Rebohle
f08add9c34
[dxgi] Add custom device/vendor IDs to DxgiOptions 2018-08-07 17:33:19 +02:00
Philip Rebohle
524ff9e233
[dxgi] Use global user config for DXGI options 2018-08-07 14:59:09 +02:00
Philip Rebohle
62e4c867ec
[dxgi] Relax IDXGISwapChain thread safety
Fixes a deadlock in Dragon Age: Inquisition.
2018-08-04 10:16:40 +02:00
Philip Rebohle
0ba00b3f59
[dxvk] Add extended device feature structure
This allows the client API to query and enable extended
features in the future, should it become necessary, much
like the extende feature queries.
2018-07-31 16:58:25 +02:00
Mikhail Paulyshka
f38ee85a39 [build] Fix compilation on MSVC (#505)
* [build] do not use shared_library/objects property with MSVC

* [util] use ./com/com_include.h instead of windef.h

It is required for Windows 10 SDK.

* [util] store thread procedure lambda in std::function

* [dxgi] fix annoying MSVC warning

warning C4099: 'IDXGIVkInteropDevice': type name first seen using 'class' now seen using 'struct'
2018-07-21 12:43:33 +02:00
Philip Rebohle
c5a010a48c
[dxgi] Do not use MUTABLE_FORMAT_BIT for SRGB images
Creation of non-SRGB views for SRGB images fails on Windows.
2018-07-21 11:41:45 +02:00
Philip Rebohle
5fe4c4f610
[dxvk] Use VkImageViewUsageCreateInfoKHR when creating image views
Must be used when view formats are used that do not support all
usage bits of the underlying image. Refs #504.
2018-07-21 10:58:06 +02:00
Philip Rebohle
b601a94750
[dxgi] Make faking Dx10 support a per-app option
Also whitelist World of Warcraft, which requires this hack for now.
2018-07-20 13:49:40 +02:00
Philip Rebohle
adcc7a4573
[dxgi] Synchronize presentation to enforce maximum frame latency
Some games may rely on the maximum number of frames in flight.
Might fix a related issue in Hard Reset (#503) and Okami HD (#283).
2018-07-20 11:40:37 +02:00
Philip Rebohle
fd55520301
[dxgi] Implement IDXGIDevice::SetMaximumFrameLatency
We'll be doing the CPU synchronization with DXVK events during
presentation.
2018-07-20 11:39:51 +02:00
Jacek Caban
06511aa72c [build] Use .spec files instead of .def files in winelib build 2018-07-19 08:55:34 +02:00
Jacek Caban
635a43fefe [build] Explicitly specify .dll and .exe extensions in winelib build
meson can't handle that itself.
2018-07-19 08:55:34 +02:00
Philip Rebohle
6848b45c7a Revert "[dxgi] Support multiple outputs per adapter"
This reverts commit 1c86ed8c93.

Causes build issues on 32-bit platforms.
2018-07-16 19:07:41 +02:00
Philip Rebohle
1c86ed8c93 [dxgi] Support multiple outputs per adapter 2018-07-16 17:03:55 +02:00
Philip Rebohle
a728884742 [dxgi] Fixed nonsense compiler warning with some GCC versions 2018-07-14 12:15:15 +02:00
Philip Rebohle
9de3a619c2
[dxgi] Use back buffer size to determine fullscreen resolution
This is the correct behaviour on Windows and may fix some issues.
2018-07-12 16:00:33 +02:00