Commit Graph

32 Commits

Author SHA1 Message Date
Philip Rebohle 53d557c2db
[d3d11] Implement D3D11_MAP_FLAG_DO_NOT_WAIT
Improves framerate in Dishonored 2 by up to 50%.
2018-03-22 11:02:14 +01:00
Philip Rebohle 493ad66d91
[d3d11] Remove obsolete acquire/release pair
This is no longer needed with the universally
thread-safe slice allocator.
2018-03-19 17:56:26 +01:00
Philip Rebohle f1c3b59e87
[d3d11] Implemented buffer mapping on deferred contexts
Allows the MultiThreadedRendering demo from the Microsoft SDK to run.
2018-03-19 03:19:13 +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 3b20c71894
[d3d11] Re-implement direct image mapping (disabled by default)
We cannot enable this by default yet because it may break some games.
2018-03-14 16:40:28 +01:00
Philip Rebohle 0ba3337289
[d3d11] Refactored Map/Unmap methods 2018-03-14 14:40:09 +01:00
Philip Rebohle 56df0bcccb
[d3d11] Refactoring texture classes: Remove D3D11TextureInfo 2018-03-14 00:45:07 +01:00
Philip Rebohle 06cff50453
[d3d11] Flush CS chunks when executing/finalizing command lists
Fixes rendering issues and validation errors in Kingdom Come: Deliverance.
2018-03-12 23:36:55 +01:00
Mikhail Paulyshka f94ff7db4f [d3d11] add check for pResource against nullptr in D3D11ImmediateContext::Map() 2018-03-12 03:18:44 +03:00
Philip Rebohle 4eacff21e9
[dxvk] Flush initialization context unconditionally
An application might need to wait for a resource to become available
just after it has been created, in which case  its initialization
commands might not have been dispatched yet. If no rendering commands
were issued on the immediate context prior to the wait operation,
WaitForResource would stall indefinitely.
2018-03-11 20:25: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
Philip Rebohle b494bb2ac1
[d3d11] Fixed potential sync issue in Map() 2018-03-07 10:37:27 +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 13331a463f
[d3d11] Re-implement check for mapping device-local images 2018-03-06 11:35:12 +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 b469cfac0b
[d3d11] Implemented FinishCommandList/ExecuteCommandList 2018-03-03 20:59:17 +01:00
Philip Rebohle e89c7e9276 [d3d11] Added test case for occlusion queries and small improvements 2018-02-19 11:27:14 +01:00
Philip Rebohle 78c46f444a
[d3d11] Added missing CS thread sync for non-discard Map() 2018-01-31 16:39:47 +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 7c3a9beb22
[dxvk] Recycle CS chunks 2018-01-21 12:59:43 +01:00
Philip Rebohle 51e89f00be
[d3d11] Fixed flush order 2018-01-21 02:21:38 +01:00
Philip Rebohle b7a00e32ec
[dxvk] Limit size of the CS command queue
Prevents memory leaks and fixes stuttering in Heaven.
2018-01-21 00:49:07 +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 aaf7b05625
[d3d11] Use EmitCs for buffer mapping 2018-01-20 22:28:15 +01:00
Philip Rebohle f25b3c8b32
[d3d11] Use EmitCs for resource updates 2018-01-20 21:42:11 +01:00
Philip Rebohle 4d17b1752f
[d3d11] Use EmitCs for general setup and synchronization methods 2018-01-20 18:01:43 +01:00
Philip Rebohle 62a43cbdbe
[d3d11] Add EmitCs method to D3D11DeviceContext
Subsequently, all calls into the DXVK context will be
replaced by calls to the EmitCs method with a lambda.
2018-01-20 15:29:10 +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