Commit Graph

37 Commits

Author SHA1 Message Date
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
Philip Rebohle 3148155c35
[d3d11] Implemented CS chunk submission for deferred contexts
Changes were necessary due to the fact that chunks in deferred
contexts are not directly submitted to the CS thread.
2018-01-23 12:03:26 +01:00
Philip Rebohle 5b1311b71e
[d3d11] Added stubs for deferred contexts and command lists 2018-01-23 09:23:31 +01:00
Philip Rebohle 07f5a7f069
[d3d11] Synchronize with CS thread before present
Fixes flickering by synchronizing with the presenter. This has
to do for now, a more efficient solution can be added later.
2018-01-21 18:04:22 +01:00
Philip Rebohle 70b639784b
Revert "[d3d11] Temporary fix for Presenter <-> CS thread sync issue"
This reverts commit 3118012ada.
2018-01-21 02:57:36 +01:00
Philip Rebohle 3118012ada
[d3d11] Temporary fix for Presenter <-> CS thread sync issue 2018-01-21 02:48:36 +01:00
Philip Rebohle 6ab7897127
[d3d11] Enabled command stream thread 2018-01-20 23:12:03 +01:00
Philip Rebohle 7d7cc1ceda
[d3d11] Record commands into a CS chunk 2018-01-20 22:52:18 +01:00
Philip Rebohle 0b426a0942
[d3d11] Added new D3D11ImmediateContext class
Initial prep work for both CSMT and Deferred Contexts.
2018-01-20 13:22:44 +01:00