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

223 Commits

Author SHA1 Message Date
Philip Rebohle
405bd737e0
[util] Disable nvapi hack for Far Cry 4 / Primal
Dunia engine games don't seem to like this either.
2019-02-04 07:09:37 +01:00
Philip Rebohle
af92bc9d9b
[utils] Disable nvapi hack for Mass Effect Andromeda
Fixes #886.
2019-01-26 18:38:58 +01:00
Philip Rebohle
cfc3f686bb
[util] Update per-app config overrides 2019-01-19 17:45:26 +01:00
Entryhazard
7306c3153c [util] Change getEnvVar to use getenv (#859) 2019-01-13 21:27:59 +01:00
Philip Rebohle
3935d2540e
[util] Get rid of explicit wchar_t parameter
We shouldn't be catering to Windows' weird string encoding mechanisms.
2019-01-11 13:43:15 +01:00
Philip Rebohle
d12b2c6149
[util] Disable NVAPI hack for NFS2015 and CoD:WW2
Fixes #850.
Fixes #832.
2019-01-10 11:59:35 +01:00
Philip Rebohle
6282280f8d
[util] Enable raw SSBOs for FIFA 19
This game incorrectly binds a typed buffer view when the shader
expects a structured buffer. Using raw SSBOs matches Windows
behaviour in this case. Fixes #642.
2019-01-08 23:18:46 +01:00
Philip Rebohle
524227d21c
[util] Add tristate config option type 2019-01-08 20:57:38 +01:00
Philip Rebohle
1e393bf24d [d3d11] Implement IWineDXGISwapChainFactory
See #822.
2018-12-21 14:03:28 +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
556e0d1dba Revert "[util] Report Nvidia GPU for Battlefield 1"
This reverts commit 500d67e002.

This game has some built-in driver detection on Nvidia which makes it
fail to start on non-Nvidia hardware or when nvapi is not present.
Fixes #795.
2018-12-02 20:27:39 +01:00
Philip Rebohle
d1f179c5af
[util] Add likely/unlikely macros 2018-11-29 22:53:04 +01:00
Philip Rebohle
193d24a3e2
[dxgi] Remove IDXGIVkBackBuffer 2018-11-28 18:15:27 +01:00
Philip Rebohle
500d67e002
[util] Report Nvidia GPU for Battlefield 1
Reportedly improves performance for some weird reason.
2018-11-26 08:04:30 +01:00
Philip Rebohle
2d55852777
[dxvk] Disable state cache for Anno 2205
Fixes #686.
2018-11-24 20:04:21 +01:00
Philip Rebohle
8081dc1591
[util] Enable TGSM initialization for Quantum Break
Fixes artifacting on Mesa 18.3.
2018-11-23 16:12:09 +01:00
Philip Rebohle
81765de35b
[util] Remove default options that spoof AMD GPUs
This is no longer necessary due to the nvapi workaround.
2018-11-20 13:17:36 +01:00
Philip Rebohle
bfb7e54218
[d3d11] Rename dcMapSpeedHack to dcSingleUseMode 2018-11-20 11:37:48 +01:00
Derek Lesho
66bcc4b3d8 Use std::string for util::getEnvVar input
This allows cleaner code when implementing DXVK as a native library
2018-11-16 06:43:45 +01:00
Philip Rebohle
305168d2bb
[util] Add method to set thread priority 2018-11-15 12:17:18 +01:00
Philip Rebohle
63d42073b8
[util] Add ticket lock implementation 2018-11-13 17:05:06 +01:00
Philip Rebohle
3d2e5a7cde
[util] Spoof Nvidia card for Elite Dangerous 2018-11-06 17:03:01 +01:00
Philip Rebohle
422cf71c55
[util] Spoof Nvidia GPU for The Vanishing of Ethan Carter Redux
For some reason it crashes with AMD cards, but apparently not in D3D code.
Closes #732.
2018-10-25 18:31:55 +02:00
Philip Rebohle
7eeeeaa625
[util] Provide method to compute SHA-1 hash from multiple data chunks
The underlying implementation supports this trivially, so we should
provide a way to use this feature.
2018-10-25 10:34:38 +02:00
Philip Rebohle
7b9726fd93
[d3d11] D3D11Presenter -> D3D11PresentDevice 2018-10-23 15:10:01 +02:00
Philip Rebohle
967b276acb
[d3d11] Add COM interface for API-agnostic presenter 2018-10-23 14:58:57 +02:00
Andreas Heider
ac0f8d6a64
Spoof AMD GPU for Assetto Corsa Competizione 2018-10-22 10:57:54 +02:00
Błażej Szczygieł
57718dcf84 [util] Spoof AMD GPU for SAO FB
Improves performance by not trying to load nvapi.
2018-10-22 10:51:48 +02:00
Philip Rebohle
8630ee235a
[util] Re-enable D3D10 for Bioshock 2018-10-12 19:06:53 +02:00
Tk-Glitch
502af0f866 [util] Spoof AMD GPU for Dauntless and Redout.
It silences some nvapi related warnings and improves performance on both titles by up to 10%.
Also fixes a random crash on Redout.
2018-10-12 12:43:58 +02:00
Fredrick Lockert
27026f48a2 [util] Spoof AMD card for Star Citizen 2018-10-12 07:10:13 +02:00
Philip Rebohle
08b241b3ea
[d3d11] Add option to disable deferred context mapping speed hack
Fixes a regression in The Evil Within.

We should probably find a proper solution, but for now this is the best
thing we can do for games which reuse command lists.
2018-10-09 17:07:50 +02:00
Philip Rebohle
1e40a14a50
[d3d10] Disable D3D10 support for Bioshock 2018-09-24 15:30:13 +02:00
Philip Rebohle
f3a23ab81f
[util] Add convenience method for SHA1 hash compulation 2018-09-22 12:04:06 +02:00
Jens Peters
d4947261c6
[util] Improve logging of configuration options 2018-09-14 15:34:46 +02:00
Philip Rebohle
2d93452cba
[util] Spoof Nvidia card for Assassin's Creed Syndicate
This one actually doesn't work properly when the AMD AGS library
is not present, but is fine with nvapi not being there.
2018-09-12 14:10:49 +02:00
Philip Rebohle
6532302e34
[util] Implement dxvk:🧵:hardware_concurrency 2018-09-10 17:02:51 +02:00
Jens Peters
e48c27ac30 [util] Spoof AMD card for Batman: Arkham Knight (#627)
This prevents game crashes in "Detective Mode" for NVidia cards.
Fixes https://github.com/doitsujin/dxvk/issues/580
2018-09-08 16:33:44 +02:00
MartinPL
f949240b2f Spoof AMD card for GTA V
GTA V working out of box on Proton for Nvidia users. Tested
#624
https://github.com/ValveSoftware/Proton/issues/37#issuecomment-415833819
2018-09-08 12:51:39 +02:00
Philip Rebohle
60796a8143
[util] Spoof AMD card for Dragon Quest XI
This game for some reason seems to keep searching for NVAPI DLLs
and runs at an extremely low framerate as a result. Fixes #622.
2018-09-07 07:50:08 +02:00
Philip Rebohle
f74661daa4
Revert "[util] Limit device memory size to 4095 MB for Life is Feudal MMO"
This reverts commit 73cbf5b352.

The workaround is no longer necessary due t a game update.
Closes #614.
2018-08-31 22:54:16 +02:00
Jacek Caban
9fd30cf5bf [util] Handle WCHAR strings in str::format. 2018-08-31 05:37:34 +02:00
Philip Rebohle
73cbf5b352 [util] Limit device memory size to 4095 MB for Life is Feudal MMO
Reporting 4GB or more VRAM causes an integer overflow in this game.
Fixes #591.
2018-08-25 01:23:22 +02:00
Philip Rebohle
55632c6b61
[util] Add log message when loading a configuration file 2018-08-17 19:42:32 +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
6e74db4c6f
[util] Update default per-app quirks 2018-08-10 12:50:31 +02:00
Philip Rebohle
fb9b520f60
[util] Move getAppConfig and getUserConfig to Config class
Fixes linker errors with winelib builds.
2018-08-07 16:59:49 +02:00
Philip Rebohle
5e58083c01
[util] Add classes and functions to support configuration files 2018-08-07 14:59:03 +02:00
Philip Rebohle
cdf6ffb9bc
[util] Add private reference count to COM object
This can be used in case DXVK needs to keep a strong reference
to an object but may not expose that reference to the application.
2018-08-05 21:31:09 +02:00
Philip Rebohle
2b8c96fe35
[util] Fix reference counting for thread objects
Fixes a potential race when threads run out of scope
before the thread function has started.
2018-07-22 02:24:04 +02:00
Philip Rebohle
e4c5880ac6
[util] Fix Win32 thread helper
- Implements move semantics for thread objects properly.
  This is necessary in order to avoid closing the thread
  handle multiple times, and to avoid passing invalid
  pointers to the thread function in some cases.
- More closely emulates the behaviour of std::thread.
2018-07-22 01:28:35 +02:00
Philip Rebohle
64ffcbc9ef
[util] Code cleanup for winegcc stuff 2018-07-21 12:51:50 +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
Jacek Caban
6d16bb4c87 Don't use std::thread.
Wine needs to setup each thread that has an access to Windows APIs. It means that in winelib builds, we can't let standard C++ library create threads and need to use Wine for that instead. I wrote a thin wrapper around Windows thread functions so that the rest of code just has to use new dxvk::thread class instead of std::thread.
2018-07-19 08:55:34 +02:00
Jacek Caban
cea1f15eab [util] Don't use std::wstring.
std::wstring is problematic, because wchar_t on other platforms might not be what we need. -fshort-wchar can mitigate that partially, but it's more problematic for stdc++ classes.
2018-07-19 08:55:34 +02:00
Jacek Caban
c2c10cc207 [util] Reimplement fromws using WideCharToMultiByte and system codepage.
Also, using UTF-8 for convertion may not be what's intended, esp. if such strings end up being passed back to system API (eg. open file). The patch uses CP_ACP on mingw build (which is how Windows APIs will interpret it) or CP_UNIXCP on Wine (which is Wine extension to convert to whatever glibc and other host libs expect).

It's also needed for the next patch.
2018-07-19 08:55:34 +02:00
Jacek Caban
02ae42c7de [util] Remove getTempDirectory
It's not used anywhere.
2018-07-19 08:55:34 +02:00
Philip Rebohle
2aa6b04fd9
[dxvk] Fix tzcnt return value when source value is 0 2018-07-09 13:32:43 +02:00
Philip Rebohle
79a1703aea
[util] Set thread names for DXVK's own threads
Makes it easier to identify the command stream thread and the
queue processing thread easier when using a wine build that
supports SetThreadDescription.
2018-06-21 15:12:04 +02:00
Philip Rebohle
518c260ad6
[util] Add == and != operator to Flags 2018-06-06 23:09:23 +02:00
Joshua Ashton
5cc3afcf30 Fix tzcnt intrinsic on MSVC (#381) 2018-05-19 09:26:25 +02:00
Philip Rebohle
ec3b7e39af
[util] Fix includes 2018-05-09 20:37:49 +02:00
Philip Rebohle
c7d2957d8f
[util] Remove duplicate tzcnt function 2018-05-09 20:09:09 +02:00
Philip Rebohle
5465ee8a85
[util] Add tzcnt function 2018-05-09 00:01:00 +02:00
Philip Rebohle
59d4f1a1fb [util] Add method to retrieve SHA1 hashes in 32-bit chunks 2018-05-03 23:47:42 +02:00
Philip Rebohle
c2854e1fb9
[dxgi] Added IDXGIVkInteropSurface interface 2018-04-19 20:13:53 +02:00
Philip Rebohle
478a87f6d2
[dxgi] Added IDXGIVkInteropDevice interface 2018-04-19 15:46:57 +02:00
pchome
62b99c9bd2 [util] Fix compilation with WINE headers (#246)
* [util] Define typeof keyword for WINE guiddef.h

GCC: `-std options disable certain keywords`
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

MinGW: `#define __uuidof(type) __mingw_uuidof<__typeof(type)>()`
WINE: `#define __uuidof(type) __wine_uuidof<typeof(type)>()`

* [util] Fix compilation with WINE headers

Overall definitions are the same but `__wine_` prefix used in .

MinGW: _mingw.h + guiddef.h
WINE: guiddef.h
2018-04-07 14:01:13 +02:00
Philip Rebohle
00a452ed89
[d3d11] Implement DXBC shader module cache
If an application compiles the same shader multiple times, we should reuse
an already existing DxvkShaderModule instead of creating a new one. This
helps keep the number of DxvkGraphicsPipeline objects low in games such
as Rise of the Tomb Raider.
2018-04-06 17:54:02 +02:00
Philip Rebohle
fc3f45c082 [hud] Added stat counters to the HUD 2018-04-03 14:49:13 +02:00
Philip Rebohle
c9465b39d1 [util] Implement spin lock 2018-04-03 11:56:02 +02:00
Philip Rebohle
267daeccad [util] Add generic Logger::log method 2018-04-02 19:05:20 +02:00
Philip Rebohle
2973c18055 [dxgi/d3d11] Remove COM_QUERY_INTERFACE macro, reset pointers
May fix some crashes in applications that rely on the returned
pointer being set to nullptr before returning.
2018-04-02 12:52:02 +02:00
Philip Rebohle
77010d96e4 [dxgi/d3d11] Set returned pointers to nullptr before returning
May solve issues with applications which check whether the returned
pointer is null rather than checking a function's return value.
2018-04-02 12:04:20 +02:00
notaz
5eefb8530d [general] More wine test suite fixes (#220)
* [dxgi] Implement freeing private data

Done by passing null as data.
Fixes wine private data test crash and passes them.

* [dxgi] Improve private data argument handling

Fixes 7 more wine tests.
2018-03-29 07:11:21 +02:00
Philip Rebohle
8d3dcba8d5
[dxgi] Renamed private DXGI interfaces 2018-03-28 19:06:00 +02:00
Philip Rebohle
6f6e12a329
[util] Fix possible crash with null interfaces in private storage 2018-03-21 15:09:08 +01:00
Sebastian Wick
4518b1b76e Shader cache (#188)
* [util] Adds getTempDirectory() function

Will be used by on-disk pipeline caching

* [dxvk] Implement on-disk shader caching

Saving the pipeline cache to disk when the application exits
should be sufficient but the DxvkPipelineCache destructor isn't
reliably called on exit (ref-counting issue?).
As a workaround every frame we check and save the cache if the
size increased by some amount or after one minute elapsed.

* [dxvk] Periodically update shader cache file in separate thread
2018-03-21 02:45:11 +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
Clément Guérin
858107278f [util] fix GUID printing 2018-02-24 22:48:40 -08:00
Philip Rebohle
54cfdbdc51
[dxvk] Implemented more query and query pool methods 2018-02-13 13:43:27 +01:00
Philip Rebohle
ad6c45d6b1
[dxvk] Improve debuggability of shader compiler issues
When using DXVK_LOG_LEVEL=debug, the graphics pipeline manager now
prints the names of the shaders used by the pipeline. This shall
help debug driver crashes in vkCreate*Pipelines.
2018-02-07 16:44:30 +01:00
Philip Rebohle
9fbddf57df
[dxvk] Emit dynamic state after binding a graphics pipeline
Fixes issues with stencil references becoming undefined under
certain circumstances. This issue was encountered in Heroes
of the Storm.
2018-01-29 20:01:49 +01:00
Philip Rebohle
ca53eaf878
[general] Minor COM pointer improvements 2018-01-29 16:31:25 +01:00
Philip Rebohle
e198bd2d55
[d3d11] Sub-allocate from larger update buffers for UpdateSubresources
Reduces the allocation overhead when applications frequently
call UpdateSubresources to update small buffers and textures.
2018-01-23 16:43:55 +01:00
Raffarti
feae2988d6 Improvements for log files (#22)
* Improvements for log files
 - Added exec name to log files
 - Added DXVK_LOG_PATH environment variable to specify the log folder
* Remove .exe from log name
* log: add log level none
* log: corrected type for string position
2018-01-23 13:36:31 +01:00
Philip Rebohle
27573e9b25
[dxvk] Added app and device specific options 2018-01-16 13:58:57 +01:00
Philip Rebohle
8805958736
[util] Fixed message logging to file 2018-01-16 12:32:09 +01:00
Philip Rebohle
18835c324e
[util] Added getExeName() function
This will allow DXVK to apply game-specific
features or workarounds in the future.
2018-01-16 11:33:34 +01:00
Philip Rebohle
1a40a272bd
[util] Fixed compiler issue with older GCC versions 2018-01-15 13:08:23 +01:00
Philip Rebohle
a0fafe3043 [util] Log level can now be controlled manually 2018-01-12 00:05:09 +01:00
Philip Rebohle
2c5b1c151f [d3d11] Refactored texture creation 2017-12-19 16:01:50 +01:00
Philip Rebohle
2b6cb25675 [d3d11] Implemented D3D11_APPEND_ALIGNED_ELEMENT 2017-12-18 23:24:10 +01:00
Philip Rebohle
9827ace3b0 [d3d11] Fixed buffer bindings with non-zero offsets 2017-12-14 19:07:08 +01:00
Philip Rebohle
2a266eaad4 [general] Added 32-bit support 2017-12-12 12:50:52 +01:00
Philip Rebohle
9a86178604 [d3d11] Fixed severe reference-counting issue in state objects 2017-12-10 00:55:30 +01:00
Philip Rebohle
3d6e88428a [com] ... yeah, almost. 2017-12-09 23:20:31 +01:00
Philip Rebohle
fa1ef8248e [com] Fixed crashes caused by reentrant Release() 2017-12-09 22:20:40 +01:00
Philip Rebohle
4a4f5bea29 [util] Added missing files 2017-12-08 11:18:23 +01:00
Philip Rebohle
9e1cf8396b [dxvk] Added environment variable to toggle debug layers 2017-12-08 01:32:02 +01:00
Philip Rebohle
69b938118d [general] Fixed write conflicts in logger 2017-12-06 23:36:11 +01:00
Philip Rebohle
5944410d2c [tests] Removed dxvk dependency for d3d11 and dxgi tests 2017-12-06 19:06:23 +01:00
Philip Rebohle
9017af51ec [utils] Added SHA-1 implementation for shader code hashing 2017-12-06 18:13:51 +01:00
Philip Rebohle
c7e1131864 [d3d11] Implemented rasterizer state creation 2017-12-06 13:16:54 +01:00
Philip Rebohle
cf33315c0c [d3d11] Some cleanup work 2017-12-04 13:39:37 +01:00
Philip Rebohle
b389c9ea1f [d3d11] Experimental implementation of OMSetRenderTargets and ClearRenderTargetView 2017-11-29 20:19:40 +01:00
Philip Rebohle
b35f0c64b4 [dxgi] Refactored swap chain <-> device communication 2017-11-29 16:23:33 +01:00
Philip Rebohle
a956c1b8ac [dxgi] Added DxgiResource for image and buffer creation 2017-11-29 15:16:07 +01:00
Philip Rebohle
ad9f71fa02 [dxgi] Implemented DxgiSwapChain::GetBuffer and more of Present 2017-11-29 07:55:44 +01:00
Philip Rebohle
0cdc13d785 [dxgi] Renamed private DXGI interfaces 2017-11-27 15:51:53 +01:00
Philip Rebohle
4052951542 [dxbc] Removed most of the DXBC compiler again 2017-11-07 15:10:38 +01:00
Philip Rebohle
bc8cc76888 [dxbc] Added operand index decoder, entry point declaration 2017-10-29 02:35:16 +02:00
Philip Rebohle
6954cfd84c [dxbc] Added helper classes for DXBC decoding 2017-10-21 17:58:58 +02:00
Philip Rebohle
bb5b588d23 [dxbc] Added DXBC to SPIR-V compiler stub 2017-10-16 17:50:09 +02:00
Philip Rebohle
56ed80621d [util] Flag class 2017-10-11 21:44:02 +02:00
Philip Rebohle
5d99a37d69 [dxgi] Implemented DxgiDevice 2017-10-11 15:31:36 +02:00
Philip Rebohle
7e4e7dd395 [dxgi] Moved private storage out of DXGI library 2017-10-11 09:41:19 +02:00
Philip Rebohle
9b8fda512a [dxvk] Added COM helpers 2017-10-11 00:41:56 +02:00
Philip Rebohle
2ee51ea4b2 [dxvk] Added debug tracing 2017-10-11 00:27:33 +02:00
Philip Rebohle
46845e60be [dxvk] Re-implemented logger 2017-10-10 23:44:06 +02:00
Philip Rebohle
00e63d71a9 Initial commit 2017-10-10 23:32:13 +02:00