Commit Graph

58 Commits

Author SHA1 Message Date
Philip Rebohle 86bdda70b4 [d3d11] Move D3D10Multithread instance to immediate context
Deferred contexts do not support this.
2022-08-24 12:15:35 +02:00
Philip Rebohle 37a2b02558
[d3d11] Fix compiler error on GCC 10.3 2022-08-04 18:42:13 +02:00
Philip Rebohle e49524fcb0
[d3d11] Move GetType and GetContextFlags to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 1d2d712dfb
[d3d11] Move d3d11_context_common.* -> d3d11_context.* 2022-08-04 13:43:36 +02:00
Philip Rebohle 77c032da5c
[d3d11] Move OM* functions to D3D11CommonContext
We can get rid of the immediate context overload as well
since we can just directly call FlushImplicit here.
2022-08-04 13:43:35 +02:00
Philip Rebohle 3ead348b82
[d3d11] Move UpdateSubresource code to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle e4204f76e6
[d3d11] Introduce D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 7e42939a4a
[d3d11] Call endFrame at the end of each frame 2022-06-28 14:35:57 +02:00
Philip Rebohle 17a1b0ad44
[d3d11] Consider empty CS chunks when tracking resources
Avoids deadlocks if we track multiple resources and flush in between.
2022-02-18 14:21:53 +01:00
Philip Rebohle e1b3bc45ce
[d3d11] Add d3d11.maxImplicitDiscardSize option 2022-02-14 04:17:56 +01:00
Philip Rebohle 0364a79eb0
[d3d11] Optimize Unmap on immediate contexts 2022-02-11 18:17:35 +01:00
Philip Rebohle 5a6711ed1d
[d3d11] Synchronize only to given sequence number in WaitForResources
Avoids costly thread synchronization when mapping staging resources
for reading, as well as some other scenarios.
2022-02-11 18:17:35 +01:00
Philip Rebohle d33dac569c
[d3d11] Track last staging resource usage with a sequence number 2022-02-11 18:17:35 +01:00
Philip Rebohle 6c862b63a2
[d3d11] Optimize UpdateSubresource for small buffer updates
Some games use UpdateSubresource to upload constant buffers in
between draws, so this path should be as fast as possible.

Also fixes a potential issue when using D3D11_COPY_NO_OVERWRITE
on deferred contexts, since the Map requirements don't hold here.
2022-02-07 16:14:02 +01:00
Philip Rebohle 4c222ec557
[d3d11] Use callback fence to signal Flush1 event 2021-08-05 22:57:58 +02:00
Philip Rebohle e87aa08fd2
[d3d11] Implement basic video processor blitting 2021-05-30 19:42:43 +02:00
Philip Rebohle 969ac59667
[d3d11] Add ID3D11VideoContext stub 2021-05-30 19:42:43 +02:00
Joshua Ashton 742b52bbb5 [d3d11] Fix device child refs properly 2021-01-15 23:47:48 +01:00
Philip Rebohle a9b6421f60
[d3d11] Support signaling event in Flush1 2020-03-19 23:38:28 +01:00
Joshua Ashton 7e3142b2ed [d3d11] Hook up platform-specific clock
See 89dfa2bc22
2019-11-26 01:52:58 +01:00
Philip Rebohle 77a0cb2b19
[d3d11] Don't synchronize with CS thread on present
Instead, submit from the CS thread in order to prevent out-of-order
submissions. Improves minimum FPS in Final Fantasy XIV by 5-10%.
2019-11-02 17:53:17 +01:00
Philip Rebohle be5dc234c1
[d3d11] Move common Begin/End implementation to immediate context 2019-11-02 13:48:03 +01:00
Philip Rebohle 1282c2b99e
[d3d11] Fix immediate context reference counting
Fixes various wine test failures.
2019-10-14 01:56:34 +02:00
Philip Rebohle e9fcf64a8c
[dxvk] Only wait for writes when mapping with D3D11_MAP_READ 2019-09-20 01:44:02 +02:00
Philip Rebohle f9d9307a28
[d3d11] Implement ID3D11DeviceContext4 2019-09-16 13:41:31 +02:00
Philip Rebohle 0599a82dee
[d3d11] Implement ID3D11DeviceContext3 2019-09-16 13:41:31 +02:00
Philip Rebohle e1610f81dc
Revert "[d3d11] Use STDMETHODCALLTYPE for private virtual method"
For some reason, this produces broken binaries for some Gentoo
users. Fixes #1067.

This reverts commit e5fa55cbb5.
2019-05-19 13:22:04 +02:00
Philip Rebohle e5fa55cbb5
[d3d11] Use STDMETHODCALLTYPE for private virtual method
Improves code generation on some compilers.
2019-05-15 22:01:19 +02:00
Philip Rebohle 45be1dfb53
[d3d11] Flush more aggressively on stalling Event queries
Increases GPU utilization in Quake Champions.
2019-05-09 18:04:36 +02:00
Philip Rebohle af45f810b2
[dxvk] Change flushing behaviour of immediate context methods
Should fix some inappropriate flushing, while flushing more
aggressively on render target changes.

We still keep the flush on UpdateSubresource since some games
use it to update large quantities of data.
2019-05-09 18:04:36 +02:00
Philip Rebohle f733d082f4
[d3d11] Implement D3D11DeviceContext::SwapDeviceContextState 2019-05-04 15:57:57 +02:00
Philip Rebohle 5a30110d0f
Revert "[d3d11] Remove some flush points"
This reverts commit 5ab6f691ae.

Apparently this leads to extremely bad frame times on some Nvidia setups.
2018-10-25 20:55:37 +02:00
Philip Rebohle 5124fd87d5
[d3d11] Implicitly flush when queueing an event query
Significantly improves GPU utilization in Quake Champions.
2018-10-17 17:28:47 +02:00
Philip Rebohle 5ab6f691ae
[d3d11] Remove some flush points
These aren't as useful as they may look like since they occur
at render pass boundaries anyway.
2018-10-17 17:28:47 +02:00
Philip Rebohle f14d17b743
[d3d11] Don't mark context methods as 'final' 2018-10-17 17:28:47 +02:00
Philip Rebohle f1b075c0f3 [dxvk] Add CS chunk pool
Reduces the number of dynamic memory allocations for CS chunks by
recycling them once they are no longer needed. Also fixes a potential
issue with chunks that are dispatched multiple times.
2018-08-27 16:07:38 +02:00
Jacek Caban c934d85b85 [d3d11] Move D3D11ImmediateContext constexpr values to .cpp file
In my winelib builds, I get unresolved dxvk::D3D11ImmediateContext::MinFlushIntervalUs symbol. I'm not sure why it doesn't inline this constexpr, but it doesn't seem useful to expose that in header anyway.
2018-07-19 08:55:34 +02:00
Philip Rebohle 42a676bbdb
[d3d11] Tweak implicit flush limits
We're going to flush more often in CPU-limited scenarios, but these
new values are reasonable especially in games which submit large
amounts of GPU work at once, and should help reduce rendering latency.
Improves GPU utilization and frame rates in Hellblade by up to 10%.
2018-06-27 20:25:33 +02:00
Philip Rebohle 9fee253d09
[d3d11] Add more implicit flush points
All these methods will implicitly spill the active render pass and
are typically not called very often, so we can try to keep the GPU
busy.
2018-06-27 18:34:17 +02:00
Philip Rebohle c716372941
[d3d11] Move GetData implementation to D3D11ImmediateContext
It is illegal to call this method on a deferred context, so we should
filter out those calls. This allows the implementation to make use of
features specific to the immediate context.
2018-06-08 12:29:24 +02:00
Philip Rebohle 4a0c81276f
[d3d11] Implement new auto-flush heuristic 2018-06-04 23:31:49 +02:00
Philip Rebohle 99813a7778 [d3d11] Use const ref pointer for device parameter
Closes #323.
2018-04-28 14:17:52 +02:00
Philip Rebohle 7de27d4fd8 [d3d11] Flush immediate context on command list execution
This optimization may help keep the GPU busy in case there's
a large number of draw calls pending at the time a command
list from a deferred context is submitted for execution.
2018-04-03 19:53:37 +02:00
Philip Rebohle 7f6c8dff95
[d3d11] Fix flush condition and CS thread synchronization
If chunks have been sent to the CS thread, we need to
flush even if the current chunk is empty.
2018-03-22 12:58:26 +01:00
Philip Rebohle 1af52abb67
[d3d11] Move OMSetRenderTargets optimization to D3D11ImmediateContext
We cannot call Flush() on deferred contexts anyway, so the command
submission optimization should only be applied to immediate contexts.
2018-03-17 14:09:16 +01:00
Philip Rebohle 0ba3337289
[d3d11] Refactored Map/Unmap methods 2018-03-14 14:40:09 +01:00
Philip Rebohle d3e89b20dd
[d3d11] Allocate host-readable images on host-visible memory
Not having to wait for an image->buffer copy to finish on the
GPU allows for more efficient synchronization. Significantly
improves performance in The Witcher 3.
2018-03-10 23:32:15 +01:00
Mikhail Paulyshka 9deb73a2a7 Add support for MSVC, attempt 3 (#130)
* [dxvk] fixes for MSVC

* nullptr -> int is illegal conversion for MSVC. nullptr was replaced with VK_NULL_HANDLE
* MSVC does not support source code strings longer than 65535 chars. String was replaced with array of chars.

* [utils] fixes for MSVC

* __mingw_uuidof() does not exists in MSVC
* apply GCC pragma only for GCC
* added missing header

* [dxbc] fixes for MSVC

*added missing header

* [dxgi] fixes for MSVC

* user __declspec(uuid()) instead of _mingw_uuidof()
* do not use DLLEXPORT macro for MSVC

* [d3d11] fixes for MSVC

* replace WINBOOL with BOOL
* do not declare D3D11 structs for MSVC
* do not use DLLEXPORT macro for MSVC

* [meson] fix build scripts for MSVC

* change cpp version from c++1z to c++latest for MSVC
* set -DOMINMAX definition for MSVC
* disable test and wine_utils for MSVC
* use .def files instead of __declspec(dllexport) for MSVC (bypass 'C2375: redefinition; different linkage' error)
* fix .def files for MinGW
* add --enable-stdcall-fixup linker flag for MinGW
2018-03-06 18:34:34 +01:00
Philip Rebohle 1cbe6829eb
Revert "Add MSVC support (#123)"
This reverts commit c63d4361a0.
2018-03-05 14:32:28 +01:00
Mikhail Paulyshka c63d4361a0 Add MSVC support (#123)
* [utils] fixes for MSVC

* __mingw_uuidof() does not exists in MSVC
* apply GCC pragma only for GCC
* added missing header

* [dxvk] fixes for MSVC

* nullptr -> int is illegal conversion for MSVC. nullptr was replaced with VK_NULL_HANDLE
* MSVC does not support source code strings longer than 65535 chars. String was replaced with array of chars.

* [dxbc] fixes for MSVC

*added missing header

* [dxgi] fixes for MSVC

* user __declspec(uuid()) instead of _mingw_uuidof()

* [d3d11] fixes for MSVC

* replace WINBOOL with BOOL
* do not declare D3D11 structs

* [meson] fix build scripts for MSVC

* change cpp version from 1z to 17 for MSVC
* set -DOMINMAX definition for MSVC
* disable test and wine_utils for MSVC
* use .def files instead of __declspec(dllexport) (bypass 'C2375: redefinition; different linkage' error)
2018-03-05 14:28:51 +01:00