Philip Rebohle
d13fdf8884
[d3d10] Implement IA(Set|Get)(Vertex|Index)Buffers
2018-08-13 17:22:41 +02:00
Philip Rebohle
553c90307a
[d3d10] Implement D3D10Buffer
2018-08-13 17:22:41 +02:00
Philip Rebohle
7754cb1115
[d3d10] Implement RS(Set|Get)(Viewports|ScissprRects)
2018-08-13 17:22:41 +02:00
Philip Rebohle
c80156ebce
[d3d10] Implement IASet|GetPrimitiveTopology
2018-08-13 17:22:41 +02:00
Philip Rebohle
b97f9a702a
[d3d10] Implement D3D10 texture interfaces
2018-08-13 17:22:36 +02:00
Philip Rebohle
257ac9ad6c
[dxgi] Report ID3D10Device and ID3D10Device1 as supported
2018-08-13 17:22:03 +02:00
Philip Rebohle
1e857f6342
[d3d10] Add D3D10Device stub
2018-08-13 17:22:03 +02:00
Philip Rebohle
8c1063b512
[d3d10] Add build files and implement D3D10CreateDevice functions
2018-08-13 17:22:00 +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
18b39d8239
[dxvk] Fix base pipeline assignment when compipling new pipelines
...
We might otherwise end up destroying our base pipeline.
2018-08-10 23:29:45 +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
6e74db4c6f
[util] Update default per-app quirks
2018-08-10 12:50:31 +02:00
Philip Rebohle
7a28f01eca
[d3d11] Enable drawIndirectFirstInstance for FL11_0 and higher
2018-08-10 04:34:54 +02:00
Philip Rebohle
e1479f41c1
[dxbc] Fix case labels when case blocks are terminated with ret
...
Fixes incorrect shader in Monster Hunter World, which caused
RADV to crash.
2018-08-10 03:31:35 +02:00
Philip Rebohle
82c891b1fb
[d3d11] Fix structured buffer view validation
2018-08-10 02:39:35 +02:00
Philip Rebohle
40050e4e3f
[d3d11] Report bind flags instead of usage when view creation fails
2018-08-10 02:39:14 +02:00
Philip Rebohle
cc5219f8c0
[d3d11] Add meaningful error messages when view creation fails
2018-08-10 02:15:51 +02:00
Philip Rebohle
5276a90195
[d3d11] Add format and resource type to D3D11_COMMON_RESOURCE_DESC
2018-08-10 02:15:30 +02:00
Philip Rebohle
f9e096e954
[d3d11] Validate buffer view format compatibility
...
Prevents the app from creating illegal buffer views.
2018-08-09 23:37:41 +02:00
Philip Rebohle
9373bab3e3
[d3d11] Validate image view format compatibility correctly
...
Prevents the application from creating illegal image views.
2018-08-09 23:34:03 +02:00
Philip Rebohle
7e0a2a9165
[d3d11] Added GetBufferFormatFeatures and GetImageFormatFeatures helpers
2018-08-09 23:33:36 +02:00
Philip Rebohle
f586970c59
[d3d11] Validate buffer view bind flags
2018-08-09 22:04:03 +02:00
Philip Rebohle
b06eb4fe2a
[d3d11] Validate image view bind flags
...
Since the bind flags of the texture may not always match the
image usage flags of the underlying Vulkan image, we should
use the latter to check whether a view can be created.
2018-08-09 21:58:58 +02:00
Philip Rebohle
cdc85a1238
[d3d11] Add GetImageUsageFlags and GetBufferUsageFlags helpers
2018-08-09 21:49:31 +02:00
Philip Rebohle
1a4b17d607
[d3d11] Use user config to determine the maximum feature level
2018-08-09 21:08:03 +02:00
Philip Rebohle
73c91138db
[d3d11] Allow creation of SRGB textures with D3D11_BIND_UNORDERED_ACCESS
...
Should fix a crash in Call of Duty: Advanced Warfare.
2018-08-09 17:13:35 +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
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
b2c4855490
[dxvk] Use global user config for backend options
2018-08-07 16:59:49 +02:00
Philip Rebohle
dc31be7118
[d3d11] Use global user config for D3D11 options
2018-08-07 14:59:09 +02:00
Philip Rebohle
524ff9e233
[dxgi] Use global user config for DXGI options
2018-08-07 14:59:09 +02:00
Philip Rebohle
c0398caa2b
[dxvk] Load user config as well as per-app options in DxvkInstance
2018-08-07 14:59:09 +02:00
Philip Rebohle
5e58083c01
[util] Add classes and functions to support configuration files
2018-08-07 14:59:03 +02:00
Philip Rebohle
3359b89166
[d3d11] Do not hold strong references to the ID3D11Resource in views
...
Emulates Windows behaviour more closely. Fixes refcount-related
error messages in Unreal Engine 4 (see #302 ), as well as a crash
in Yakuza 0 (see #533 ).
2018-08-05 21:31:13 +02:00
Philip Rebohle
ffc87faed0
[d3d11] Add private ref count helpers for ID3D11Resource
2018-08-05 21:31:13 +02:00
Philip Rebohle
c223e35608
[d3d11] Do not keep a strong reference to the swap chain back buffer
...
Fixes crash in Yakuza 0 with fullscreen mode enabled. SEGA, please,
stop being lazy and learn to use reference counting correctly.
2018-08-05 21:31:13 +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
871c96b130
[d3d11] Refactor Unordered Access View Creation
...
Part 4 / 4 of the refactor.
2018-08-05 19:28:39 +02:00
Philip Rebohle
55203eb458
[d3d11] Refactor Shader Resource View Creation
...
Part 3 / 4 of the refactor.
2018-08-05 19:20:12 +02:00
Philip Rebohle
1038bf2ef5
[d3d11] Refactor Render Target View Creation
...
Part 2 / 4 of the refactor.
2018-08-05 19:07:53 +02:00
Philip Rebohle
0598982f35
[d3d11] Refactor Depth-Stencil View Creation
...
Part 1 of 4 of a much needed refactor. Instead of translating
the structures in the D3D11Device class, we'll move the code
to the respective view classes in order to clean up.
2018-08-05 19:02:45 +02:00
Philip Rebohle
16315a39a0
[d3d11] Use new resource helper functions during view creation
...
This simplifies things when both buffers and textures are allowed.
2018-08-05 18:56:42 +02:00
Philip Rebohle
b87f3f5155
[d3d11] Add common resource helper functions
2018-08-05 18:45:24 +02:00
Philip Rebohle
66e178756e
[d3d11] Introduce GetCommonBuffer helper
...
Also update GetCommonTexture documentation.
2018-08-05 18:29:29 +02:00
Philip Rebohle
ace8e42213
[d3d11] Move BufferInfo struct into D3D11Buffer
2018-08-05 18:24:01 +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
9293acfeb5
[dxbc] Work around OpControlBarrier issue on radv 18.2-git
2018-08-03 15:15:18 +02:00
Philip Rebohle
fe66e668e5
[dxvk] Implement native discardBuffer function in the backend
...
This may be more efficient because it avoids renaming the buffer
in case it can be used without inserting additional barriers.
2018-08-03 11:28:00 +02:00
Philip Rebohle
fb88070888
[d3d11] Implement copy flags for CopySubresourceRegion1 / UpdateSubresource1
2018-08-03 11:22:26 +02:00
Philip Rebohle
3fee20dfec
[d3d11] Implement DiscardResource for buffers
...
We don't suppor this for images, and we don't support DiscardView yet.
Buffers can be invalidated, which may in some cases be beneficial in
order to avoid synchronization on the GPU.
2018-08-03 11:10:40 +02:00
Philip Rebohle
8044ce6c7e
[d3d11] Refactor UAV counter buffer allocator
...
- Fixes violation of the minStorageBufferOffsetAlignment limit
- Allows allocation of multiple counter buffers if necessary
2018-08-03 10:17:02 +02:00
Philip Rebohle
212bd56b93
[d3d11] Fix border color mapping for opaque white
2018-08-02 17:04:09 +02:00
Philip Rebohle
1da6617a73
[dxbc] Fix sample location order for 2xMSAA case
...
The sample locations were apparently incorrectly documented
in the Vulkan spec and have changed with the 1.1.82 update.
2018-08-01 11:38:59 +02:00
Philip Rebohle
ffede83d9e
[dxvk] Remove unnecessary barrier recording before compute dispatch
...
This call is not needed any longer because we have compute init barriers.
Might allow for parallel compute shader dispatch in some situations.
2018-08-01 09:14:39 +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
Philip Rebohle
ebb7902b2c
[dxvk] Add extended device info structure
...
This uses VK_KHR_get_physical_device_properties2
to query extension-specific device properties.
Queries info for VK_EXT_vertex_attribute_divisor.
2018-07-31 16:03:44 +02:00
Philip Rebohle
91407098d5
[dxbc] Actually set "icb" as the debug name of the ICB
2018-07-30 22:08:01 +02:00
Philip Rebohle
f8392b4f83
[dxbc] Fix incorrect pointer type when loading from baked ICBs
2018-07-30 21:08:52 +02:00
Philip Rebohle
2166769096
[dxbc] Map large ICBs to a constant buffer
...
Should fix an issue with compiling a specific compute shader in
the game Dragon Ball Xenoverse 2 (#523 ).
2018-07-30 20:52:42 +02:00
Philip Rebohle
bf06654a83
[d3d11] Remove DXVK_SHADER_READ_PATH
...
Broken, and won't work with ICB UBOs.
2018-07-30 20:29:05 +02:00
Philip Rebohle
bf912d0a5f
[d3d11] Create shader constant buffer if necessary
2018-07-30 20:29:05 +02:00
Philip Rebohle
c31e646921
[dxvk] Introduce concept of shader constants
...
Large constant arrays should be moved to a uniform buffer instead
of being baked directly into the shader code.
2018-07-30 20:29:05 +02:00
Philip Rebohle
a8eb7d343a
[dxvk] Reconfigure bindings
...
In order to map ICBs to uniform buffers, we need one spare constant
buffer slot per shader stage.
2018-07-30 20:29:05 +02:00
Philip Rebohle
af5de8a8ef
[d3d11] Fix compiler warning
2018-07-30 20:27:18 +02:00
Philip Rebohle
7f0f7ac048
[d3d11] Refactor shader binding
...
This way we can get rid of an unnecessary template and make future
extensions possible.
2018-07-30 19:37:19 +02:00
Jacek Caban
b7bdd9de38
[dxvk] Include vector inheaders that use it.
...
Fixes winelib compilation after recent changes.
2018-07-28 15:09:31 +02:00
Philip Rebohle
656cb2e4aa
[dxvk] Refactor Vulkan extension management
...
Adding an extension will now require an additional step, but
this evolved version of the extension list code is more sane
and the structures can be more easily copied around.
2018-07-23 20:07:21 +02:00
Philip Rebohle
6d24f767c6
[dxvk] Load function pointers for VK_KHR_get_physical_device_properties2
2018-07-23 18:09:50 +02:00
Philip Rebohle
adadf362a3
[d3d11] Optimize WaitForResource behaviour when resource is already idle
...
We don't have to flush everything in this case, just flushing the current
CS chunk is enough to determine if the resource is in use by the GPU.
2018-07-23 16:08:01 +02:00
Philip Rebohle
662b6429a8
[d3d11] Refactor resource initialization
...
In addition to moving the code to a separate class, this also
improves flushing behaviour by limiting the amount of memory
being initialized rather than the number of commands executed.
2018-07-23 15:21:17 +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
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
8ffe545b38
Revert "[dxvk] Bump maximum number of command buffers in flight to 16"
...
This reverts commit d744a3cd69
.
Reportely has an unexpected negative impact on frame times in
The Witcher 3 and potentially other games on some setups.
2018-07-20 15:56:07 +02:00
Philip Rebohle
de920458d7
[dxvk] Make DxvkEvent lock-free
...
Reduces locking overhead and potential stuttering
issues when an app is spinning on the event.
2018-07-20 15:48:09 +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
d744a3cd69
[dxvk] Bump maximum number of command buffers in flight to 16
2018-07-20 11:42:42 +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
Philip Rebohle
0fd8019a70
[dxvk] Add DxvkEvent::wait method
2018-07-20 11:39:24 +02:00
Philip Rebohle
336b3858c9
[dxvk] Relax VK_EXT_vertex_attribute_divisor requirement
...
Nvidia 396.45 still does not support this. Nvidia, please, we need it.
2018-07-19 23:10:12 +02:00
Philip Rebohle
19f74a89cd
[dxvk] Optimize buffer renaming
...
Small reduction in CPU overhead by using spinlocks instead of
a full mutex for the two buffer free lists.
2018-07-19 09:44:58 +02:00
Jacek Caban
88cda20746
[d3d11] Import dxgi by -l instead of directly specifying library name.
2018-07-19 08:55:34 +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
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
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