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

1899 Commits

Author SHA1 Message Date
Philip Rebohle
1594a20b94
[dxgi] Add new functions to change the display mode of a monitor 2018-12-11 16:02:35 +01:00
Philip Rebohle
1db3c6d883
[dxgi] Remove SetOutputData and GetOutputData methods 2018-12-11 15:33:54 +01:00
Philip Rebohle
aa2ec3f998
[dxgi] Port DxgiOutput and DxgiSwapChain to new monitor data API
This allows us to remove the dependency between DxgiSwapChain
and DxgiVkAdapter without losing gamma control emulation.
2018-12-11 15:32:54 +01:00
Philip Rebohle
e30bb498b6
[dxgi] Add functions to share per-monitor data between DXGI objects 2018-12-11 15:32:00 +01:00
Philip Rebohle
57e814717e
[dxgi] Move GetOutputFromMonitor to swap chain class
Not a great solution, but we only need it for the swap chain anyway.
2018-12-10 12:38:33 +01:00
Philip Rebohle
9e9e17348f
[dxgi] DxgiSwapchain: Remove SetGammaControl methods
These were only used internally to forward stuff to the presenter
anyway, so we might as well call that method directly.
2018-12-10 12:34:57 +01:00
Philip Rebohle
7eb60daf63
[dxgi] DxgiSwapchain: Take factory as IDXGIFactory
No need to be specific about the exact type of factory.
2018-12-10 12:10:15 +01:00
Philip Rebohle
9572425912
[dxvk] Clear color write mask if fragment shader output is undefined
Fallout 76 writes undefined data to one specific render target
otherwise. Refs #779.
2018-12-07 13:43:27 +01:00
Philip Rebohle
ef63328eb8
[d3d10] Initialize DSV pointer in OMGetRenderTargets
Completely redundant, but apparently MSVC refuses to compile the
code otherwise. Refs #801.
2018-12-07 13:43:14 +01:00
Philip Rebohle
86d4d31b7c
[dxgi] Ignore scaling and scanline order during fullscreen transitions
Games usually don't use these correctly anyway, so we might as well
ignore them, since DXVK's DXGI does not report scanline modes other
than UNSPECIFIED. Fixes #291.
2018-12-06 16:38:45 +01:00
Philip Rebohle
171cf53bc0 [dxvk] Don't re-initialize 3D images when clearing render targets
Layout transitions apply to the full subresource, even if we only
render to one slice. Fixes #775 on Nvidia Kepler and Maxwell cards.
2018-12-04 23:25:50 +01:00
Philip Rebohle
df667b7b0e
[dxgi] Report Adapter LUID if available 2018-12-04 19:39:09 +01:00
Philip Rebohle
033ea0c31b
[d3d11] Find Vulkan device if DXGI adapter was not created by DXVK
Tests the LUID, then the PCI device IDs, and finally falls back
to the first Vulkan device available on the system. This allows
DXVK's d3d11.dll to be used without its own dxgi.dll, as long
as presentation support is implemented in some way.

With the previous changes, based on zzhiyi/dxvk@0fc3a24d96

Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
2018-12-04 19:38:52 +01:00
Philip Rebohle
f7b3b9ca5c
[dxvk] Add new methods to find adapters by LUID or device ID
Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
2018-12-04 19:38:52 +01:00
Philip Rebohle
bb1f431e44
[dxvk] Query device ID information if available
Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
2018-12-04 19:38:52 +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
c5deedef2d
[d3d11] Move IDXGIDevice implementation to D3D11 module
Helps decouple the D3D11 module from the DXGI implementation. This
also allows us to clean up D3D11 device creation, which is much needed.

Based on zzhiyi/dxvk@fa441937f1

Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
2018-12-04 19:38:38 +01:00
Philip Rebohle
de29174d42
Revert "[vr] Cosmetic code cleanup"
This reverts commit a3bf90f5a3.

Crashes SuperHot VR for some reason.
2018-12-04 18:50:11 +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
835d92b802 [d3d10] D3D10CreateDeviceAndSwapChain: Ignore swap chain if null
Like e4b91057ac, this might fix some
issues with ReShade in D3D10 games.
2018-12-02 15:52:17 +01:00
Philip Rebohle
e4b91057ac [d3d11] D3D11CreateDeviceAndSwapChain: Ignore swap chain if null
Fixes some issue with ReShade.
2018-12-02 13:43:55 +01:00
Philip Rebohle
cf21111401
[d3d11] Implement ID3D11Multithread for D3D11 contexts 2018-11-30 11:38:00 +01:00
Philip Rebohle
28216909bd
[d3d10] Implement D3D10Multithread 2018-11-30 11:37:57 +01:00
Philip Rebohle
d1f179c5af
[util] Add likely/unlikely macros 2018-11-29 22:53:04 +01:00
Philip Rebohle
af2f5cc77f
[dxgi] Remove format lookup methods from IDXGIVkAdapter interface 2018-11-28 19:06:34 +01:00
Philip Rebohle
cc7f5c4bb1
[d3d11] Duplicate format table into D3D11 device
Removes the direct D3D11Device->DXGIAdapter dependency.
2018-11-28 18:34:05 +01:00
Philip Rebohle
193d24a3e2
[dxgi] Remove IDXGIVkBackBuffer 2018-11-28 18:15:27 +01:00
Philip Rebohle
092cad0e76
[dxvk] Remove DxvkSemaphore 2018-11-28 12:44:18 +01:00
Philip Rebohle
80b9f1d03b
[dxvk] Remove DxvkSurface 2018-11-28 12:44:18 +01:00
Philip Rebohle
9b923bb386
[dxvk] Remove DxvkSwapChain 2018-11-28 12:44:17 +01:00
Philip Rebohle
9139fbf95d
[d3d11] Use new Vulkan presenter 2018-11-28 12:44:17 +01:00
Philip Rebohle
81306cdc11
[dxvk] Support new Vulkan presenter in DxvkDevice 2018-11-28 12:44:17 +01:00
Philip Rebohle
746529b71b
[dxvk] Pass raw semaphore handles to submitCommandList 2018-11-28 12:44:17 +01:00
Philip Rebohle
a5c17f2753
[d3d11] Use flushCommandList method to flush initializer context 2018-11-28 12:44:17 +01:00
Philip Rebohle
979ccf23e3
[vulkan] Implement new Vulkan presenter / swap chain 2018-11-28 12:44:11 +01:00
Philip Rebohle
7096937c11
[dxbc] Use ballot to determine early-discard condition in fragment shaders 2018-11-27 11:50:01 +01:00
Philip Rebohle
0113e8f360
[spirv] Add subgroup ballot instructions 2018-11-27 11:50:01 +01:00
Philip Rebohle
4057937d2d
[dxvk] Refactor descriptor set allocation
With this new approach, descriptor pools are decoupled from the
command list they are used with. Instead, the DXVK context takes
ownership of a single descriptor pool until it runs out of memory.

This reduces the amount of memory wasted for under-utilized pools
and should this reduce an application's memory footprint.
2018-11-27 11:42:13 +01:00
Philip Rebohle
eb7a5da975
[dxvk] Rebalance descriptor set allocation
This should more closely reflect what applications actually use.
The basic idea here is that it is better for apps to run out of
descriptors before running out of sets and thus reduce the
overall memory footprint of the application.
2018-11-27 10:04:16 +01:00
Philip Rebohle
08b403f655
[d3d11] Fix potential UAV binding issue
When rebinding an already active UAV, we still need to
update the counter unless the app passed a value of -1.

Ref #712.
2018-11-26 17:18:35 +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
10b272b4c9
[meta] Release 0.93 2018-11-24 10:41:41 +01:00
Philip Rebohle
2424cf0289
[dxbc] Disable early discard on AMD cards
Causes GPU hangs.
2018-11-24 10:09:33 +01:00
Philip Rebohle
ce3642edd0
[dxvk] Don't put rendering stage/access masks into image info
Not needed since these stages and access flags are handled by render
pass transitions.
2018-11-24 00:40:59 +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
a75c596132
[d3d11] Add config option to enable TGSM initialization 2018-11-23 16:12:02 +01:00
Philip Rebohle
ea5f11d091
[dxbc] Implement function to clear thread-group shared memory
Can be enabled in case a game reads undefined data from TGSM.
2018-11-23 15:57:54 +01:00
Philip Rebohle
79a6dd111e
[dxbc] Store workgroup size for compute shaders 2018-11-23 14:39:33 +01:00
Philip Rebohle
3e686098cc
[dxbc] Disable subgroup early discard on Nvidia GPUs
People report performance regressions up to 5% with it enabled.
2018-11-23 12:28:48 +01:00
Philip Rebohle
6dd82dfe03
[dxbc] Clamp written depth value to (0.0, 1.0)
Fixes shadow issue in Overwatch (#738).
2018-11-23 12:00:23 +01:00
Philip Rebohle
0418c02ac3
[dxbc] Use clustered subgroup operations on supported hardware 2018-11-21 11:17:09 +01:00
Philip Rebohle
ab17c49c4e
[dxbc] Fix compiler warning about uninitialized values 2018-11-21 11:17:09 +01:00
Philip Rebohle
4f76b89941
[dxbc] Use subgroup operations for early discard
Can improve performance in some complex fragment shaders.
2018-11-21 11:17:09 +01:00
Philip Rebohle
a574829bb6
[dxbc] Remove DeferKill flag
This behaviour is correct, and needs to be enabled by default.
2018-11-21 11:17:09 +01:00
Philip Rebohle
968a085f1e
[dxvk] Query device subgroup properties
Also query the device properites for this extension as well
as support for subgroup operations on this device.
2018-11-21 11:17:09 +01:00
Philip Rebohle
67e10246cb
[dxvk] Request Vulkan 1.1 instance
Falls back to a regular 1.0 instance on old drivers.
We need to do this in order to legally use SPIR-V 1.3.
2018-11-21 11:17:09 +01:00
Philip Rebohle
59d0ad4413
[spirv] Add non-uniform group instructions 2018-11-21 11:17:09 +01:00
Philip Rebohle
dbd7db3328
[dxvk] Fix typo around dual-src blending
Fixes e744117042
2018-11-20 19:55:08 +01:00
Philip Rebohle
bcd5a9235c
[dxvk] Make use of VK_AMD_memory_overallocation_behavior
Currently only supported on AMDVLK. Enforces memory limits on a driver
level unless the corresponding dxvk.allowMemoryOvercommit option is enabled.
2018-11-20 15:50:41 +01:00
Philip Rebohle
99f6953e89
[dxvk] Store DXVK options directly with the instance object 2018-11-20 15:50:01 +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
5d49644cdc
[dxgi] Hack: Report Nvidia cards as AMD cards by default
Prevents UE4 games from repeatedly trying to load nvapi.dll
on a performance-critical code path.
2018-11-20 13:15:39 +01:00
Philip Rebohle
bfb7e54218
[d3d11] Rename dcMapSpeedHack to dcSingleUseMode 2018-11-20 11:37:48 +01:00
Philip Rebohle
ad5688764c
[d3d11] Use single-use submission mode for CS chunks where possible 2018-11-20 10:44:04 +01:00
Philip Rebohle
c61200d35f
[dxvk] Introduce single-use mode for CS chunks
This allows us to reset the CS chunk immediately while executing it,
which can reduce the overhead of the reset operation and may lead to
resources being released earlier.
2018-11-20 10:35:23 +01:00
Philip Rebohle
e744117042
[dxvk] Patch fragment shader for dual-source blending 2018-11-19 17:07:05 +01:00
Philip Rebohle
f69c5e4c4e
[dxbc] Emit Index decoration for pixel shader outputs
Simplifies shader patching when dual-source blending is used.
2018-11-19 16:57:11 +01:00
Philip Rebohle
3e3c31f365
[spirv] Add support for Index decoration
Needed for dual-source blending
2018-11-19 16:57:08 +01:00
Philip Rebohle
5aad615aef
[dxvk] Unbind graphics pipeline when spilling render pass
Otherwise we may in some very rare cases continue using an incorrect
pipeline in subsequent render passes if the same shaders are used for
drawing.
2018-11-19 01:35:41 +01:00
Philip Rebohle
85f0fe729c
[dxvk] Move DxvkEventTracker to dxvk_event.{h,cpp}
The upcoming new event and query classes will follow this design.
Reduces the number of files around these small classes.
2018-11-17 01:17:03 +01:00
Andrew Eikum
aea4162198 [dxgi] MultiByteToWideChar counts length in characters 2018-11-16 19:53:37 +01:00
Philip Rebohle
e4d3357e55
[dxgi] Query window size before creating presenter
Otherwise we may pass a size of zero to the presenter.
2018-11-16 15:03:09 +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
c25483e856
[dxgi] Implement IDXGISwapChain3
- Stub IDXGISwapChain3::ResizeBuffers1
2018-11-15 18:02:27 +01:00
Philip Rebohle
81bb561c75
[dxgi] Implement IDXGIAdapter3 2018-11-15 18:02:21 +01:00
Philip Rebohle
171251bc83
[dxgi] Implement IDXGIFactory4
Do not support WARP adapters for the moment.
2018-11-15 17:08:36 +01:00
Philip Rebohle
0b7e114cb0
[dxgi] Implement IDXGIDevice3 2018-11-15 17:08:36 +01:00
Philip Rebohle
23ac9b5277
[dxgi] Implement IDXGISwapChain2 stubs
Most of the additions are stubs for now, but we should be
able to implement most of the functionality at a later time.

None of the backends implement this yet, but this should be
relatively easy to do.
2018-11-15 17:08:35 +01:00
Philip Rebohle
a849ffc56c
[dxgi] Implement IDXGIOutput3 2018-11-15 17:08:35 +01:00
Philip Rebohle
9af842801c
[dxgi] Implement IDXGIFactory3 2018-11-15 17:08:35 +01:00
Philip Rebohle
f03d87b918
[dxgi] Implement IDXGIOutput1
Required for DXGI 1.2.
2018-11-15 17:08:35 +01:00
Philip Rebohle
f7b2194e0b
[dxgi] Include DXGI 1.4 headers 2018-11-15 17:08:27 +01:00
Philip Rebohle
1af96347e1
[dxvk] Forward memory allocation statistics to the adapter 2018-11-15 17:08:05 +01:00
Philip Rebohle
d49de734b7
[dxvk] Set low thread priority for pipeline compiler threads
This currently does not have any effect when using regular wine, but
if it ever gets supported then these background jobs should have less
of an influence on the game's performance when they kick in.
2018-11-15 12:19:24 +01:00
Philip Rebohle
305168d2bb
[util] Add method to set thread priority 2018-11-15 12:17:18 +01:00
Philip Rebohle
6adf534589
[dxvk] Add option to set number of pipeline compiler threads 2018-11-15 09:24:11 +01:00
Philip Rebohle
4db5c21ec5
[dxvk] Use ticket lock to synchronize access to query objects
Lowers overhead in the uncontested case compared to std::mutex, and
prevents the main rendering thread from blocking updates for too long.
2018-11-13 17:05:37 +01:00
Philip Rebohle
63d42073b8
[util] Add ticket lock implementation 2018-11-13 17:05:06 +01:00
Philip Rebohle
1724d51079
[dxgi] Refactor presenter creation
This change is needed to support non-D3D11 presenters in our DXGI code.
2018-11-12 11:39:34 +01:00
Philip Rebohle
8d2f8fca64
[meta] Release v0.92 2018-11-11 16:16:01 +01:00
Philip Rebohle
6f28ce5809
[dxvk] Do not require GL_EXT_samplerless_texture_functions
Ubuntu ships a version of the GLSL compiler that does not support
this extension yet, so building DXVK fails on those systems.
Closes #760.
2018-11-11 15:48:07 +01:00
Philip Rebohle
a971370524
[dxbc] Implement Dmovc instruction
Fixes some mandelbrot demo mentioned in #216.
2018-11-10 23:27:56 +01:00
Philip Rebohle
0cfa5b16d3
[d3d11] Support R11G11B10 format in ClearUnorderedAccessViewUint
Silences an error message in Shadow of the Tomb Raider. Does not have
any consequences for this game because it initializes the view to 0.
2018-11-10 18:48:44 +01:00
Philip Rebohle
05856e836b
[d3d11] Don't enable StorageImageReadWithoutFormat feature for FL11_0
We don't really need this, although it might be useful in the future.
2018-11-10 11:34:23 +01:00
Philip Rebohle
504de3994b
[dxvk] Inline DxvkBufferView::updateView method
Most of the time the condition is false, so we should help
the compiler where we can to optimize for the common case.
2018-11-09 11:40:44 +01:00
Philip Rebohle
bd03225c14
[dxbc] Refactor DxbcOptions
A bit mask isn't good enough going forward, and we also don't
need application-specific options for now.
2018-11-09 08:41:02 +01:00
Philip Rebohle
ab3ba776e0
[d3d11] Do not re-upload mapped image if it was mapped for reading 2018-11-08 18:51:53 +01:00
Philip Rebohle
4d103aad5d
[d3d11] Allow mapping depth-stencil images for reading
This may be needed for The Surge and Lords of the Fallen.
2018-11-08 18:51:47 +01:00
Philip Rebohle
f483bc9633
[d3d11] Add usage flag for meta-pack operations if necessary
- Fix depth-stencil format list
2018-11-08 18:51:43 +01:00
Philip Rebohle
81a5e2fa0c
[d3d11] Add helper to find exact mapping for depth-stencil formats
This is necessary in situations when we need to get the Vulkan format
that corresponds to the DXGI format rather than the remapped one.
2018-11-08 18:51:43 +01:00
Philip Rebohle
2b02e692c3
[dxvk] Implement DxvkContext::copyDepthStencilImageToPackedBuffer 2018-11-08 18:10:56 +01:00
Philip Rebohle
d7d1db1b8b
[dxvk] Add convenience method to retrieve image descriptor 2018-11-08 18:10:56 +01:00
Philip Rebohle
fc8f49899a
[dxvk] Create instance of depth-stencil packing objects 2018-11-08 18:10:56 +01:00
Philip Rebohle
119c06e453
[dxvk] Add pipelines needed for depth-stencil packing
- Add method to retrieve meta pack pipeline for a given format
- Add descriptor update template
2018-11-08 18:10:49 +01:00
Philip Rebohle
863f2d07fd
[dxvk] Add compute shaders for depth-stencil packing 2018-11-08 18:10:49 +01:00
Philip Rebohle
0dbac29729
[dxvk] Add packed size to depth-stencil formats 2018-11-08 18:10:49 +01:00
Philip Rebohle
70b14f9dbf
[dxvk] Report app name to the Vulkan implementation
Because why not?
2018-11-07 21:54:00 +01:00
Philip Rebohle
f32aff29fa
[d3d11] Clear compressed images if they do not get initialized
This probably makes Quantum Break run even worse, but I don't really
care at this point. Fixes #744.
2018-11-07 18:41:07 +01:00
Philip Rebohle
7ed9f36769
[dxvk] Add clearCompressedColorImage method
Since we can't use regular clears for compressed
formats, we need a new method to zero image memory.
2018-11-07 18:31:01 +01:00
Philip Rebohle
2d8c9c6a26
[vulkan] Add makeSubresourceLayers helper 2018-11-07 18:30:44 +01:00
Philip Rebohle
3d2e5a7cde
[util] Spoof Nvidia card for Elite Dangerous 2018-11-06 17:03:01 +01:00
Philip Rebohle
780780f8d1
[dxbc] Don't enable sample shading for interpolation functions
Actually doesn't resolve #456, and doesn't make any sense either because
interpolation at a given sample index is apparently supposed to work even
without using sample shading.
2018-11-05 18:30:32 +01:00
Philip Rebohle
2ee7ef7689
[dxbc] Enable sample shading when using interpolation functions
Fixes artifacts on RADV when enabling MSAA in World of Warcraft (#456).
2018-11-05 17:07:11 +01:00
Philip Rebohle
5a1b37b770
[build] Don't use empty dependencies
Fixes build error with Meson 0.44.
2018-11-05 07:55:36 +01:00
Philip Rebohle
e0f1510901
[meta] Release 0.91 2018-11-04 17:23:27 +01:00
dhewg
a05c93dd17 cross build cleanup (#746)
- Don't turn off warnings for winelib builds, fix them. Using __declspec on winelib builds just doesn't make sense.
- Drop the custom cross property 'winelib'. Detect it instead.
- Move the libdl dependency to the build system
- Don't run wine during mingw build process. Same as for wine builds, see 715d2571
2018-11-04 16:18:32 +01:00
Philip Rebohle
b6ded02a5d
[dxvk] Pull 'if's into commit{Graphics,Compute}State methods
Improves performance because GCC generates silly code around those
if blocks, most of which have a false condition anyway. Improves
performance of 100k empty draw calls with no state changes by as
much as 25%.
2018-11-03 00:51:02 +01:00
Philip Rebohle
963bd66fb3
[dxvk] Use new vulkan helpers to create VkImageSubresourceRange structs 2018-11-02 19:42:53 +01:00
Philip Rebohle
a97073adb9
[dxvk] Move vulkan helpers to vulkan module 2018-11-02 19:42:29 +01:00
Philip Rebohle
d5481ac013
[d3d11] Remove redundant D3D11Buffer::GetSize method 2018-11-02 15:43:46 +01:00
Philip Rebohle
851d9fb726
[general] Remove unnecessary include directories from build files
These are no longer needed because dxvk includes consistently
use relative file paths now, instead of global includes.
2018-11-02 14:54:39 +01:00
Philip Rebohle
93d88afab9
[general] Fix some old includes 2018-11-02 14:37:59 +01:00
Philip Rebohle
1cd912556e
[dxvk] Move Vulkan loader to separate directory 2018-11-02 14:23:45 +01:00
Philip Rebohle
45a234607a
[dxvk] Track device / instance ownership
This allows us to use the Vulkan function loader for a vkd3d device.
2018-11-02 14:13:07 +01:00
Philip Rebohle
175385481e
[dxvk] Insert barrier before CS image view clear only if needed
Removes one unnecessary sync point in Claybook.
2018-11-01 21:48:22 +01:00
Philip Rebohle
f5b21d42fc
[dxvk] Open state cache file only when necessary
Fixes an issue with Shadow of the Tomb Raider randomly nuking its cache
when it creates not one but *two* D3D11 devices.
2018-11-01 16:35:49 +01:00
Philip Rebohle
8054e4a772
[dxvk] Add DXVK context method to transparently flush the command list
This is identical to what the D3D11 function did, but having it in this
place will allow us to potentially implement better flush heuristics
based on work done on the CS thread.
2018-11-01 13:24:42 +01:00
Philip Rebohle
36ccd46ae7
[dxvk] Move sampler border color handling to the backend 2018-10-31 21:51:23 +01:00
Philip Rebohle
e15e693dc4
[dxvk] Spill render pass for pipelines that use vertex stage UAVs
We cannot use simple pipeline barriers in this case because of the
extremely strict restrictions surrounding self-dependencies.
2018-10-30 14:43:52 +01:00
Philip Rebohle
76b63efedb
[dxvk] Use self-dependency to synchronize SSBO writes
While this doesn't support vertex stages yet, it should be faster
when the pipeline writes to storage resources from the fragment
shader.

We should analyze the vertex stage shaders for SSBO writes in
order to determine whether to spill the render pass.
2018-10-30 14:11:27 +01:00
Philip Rebohle
43ed820be9 [d3d11] Remove state tracking for UAV rendering
This scenario is now properly handled by the DXVK state tracker.
2018-10-29 12:12:34 +01:00
Philip Rebohle
fd52022fff [dxvk] Spill render pass after draws with storage resources 2018-10-29 12:12:34 +01:00
Philip Rebohle
9decfb34b7 [dxvk] Determine whether a graphics pipeline writes to resources
- Fix missing test for storage texel buffers
2018-10-29 12:12:34 +01:00
Philip Rebohle
ec8559f40a [dxvk] Remove unneeded atomic that holds base pipeline handles
No longer needed because the full pipeline object gets locked anyway.
2018-10-29 12:11:33 +01:00
Philip Rebohle
a53e053391
[dxbc] Fix incorrect data type for explicit interpolation instructions 2018-10-25 22:25:13 +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
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
941db96f79
[dxvk] Remove obsolete DxvkShaderKey constructor 2018-10-25 11:30:02 +02:00
Philip Rebohle
c9ce09e098
[d3d11] Respect xfb metadata when computing shader hash
Closes #733.
2018-10-25 11:28:02 +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
589229f4ca
[dxgi] Query device interface from the presenter
Removes the coupling between IDXGISwapChain and IDXGIDevice.
This is necessary because D3D12 devices don't support IDXGIDevice.
2018-10-24 15:54:56 +02:00
Philip Rebohle
7b9726fd93
[d3d11] D3D11Presenter -> D3D11PresentDevice 2018-10-23 15:10:01 +02:00
Philip Rebohle
83b51a66ac
[dxgi] Don't build shaders for presentation
These are now embedded in the D3D11 module.
2018-10-23 14:58:57 +02:00
Philip Rebohle
86e6477e80
[dxgi] Remove unused presenter options 2018-10-23 14:58:57 +02:00
Philip Rebohle
3b5b20ca3f
[dxgi] Remove old DXGI presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
b53f6661f8
[dxgi] Use new presenter for D3D11 2018-10-23 14:58:57 +02:00
Philip Rebohle
967b276acb
[d3d11] Add COM interface for API-agnostic presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
64185d9be4
[d3d11] Move some DXGI presenter options to D3D11 2018-10-23 14:58:57 +02:00
Philip Rebohle
8cb4852a61
[d3d11] Add new D3D11 swap chain code
- Fix deferred surface creation
2018-10-23 14:58:39 +02:00
Philip Rebohle
db2880acfd
[dxvk] Update blend constants only when they have actually changed
Reduces number of redundant state changes in Resonance of Fate.
2018-10-22 15:35:56 +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
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
5ecfbd8425
[d3d11] Do not use QueryInterface to get query pointers
We're not going to implement counters anyway, so this is
unnecessary overhead.
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
11b269efd1
[d3d11] Save a few CPU cycles in Map/MapBuffer 2018-10-16 12:29:04 +02:00
Philip Rebohle
e0e945f724
[d3d11] Show SetPredication message only when the predicate is not NULL
Helps determine which games actually use the feature.
2018-10-15 19:35:50 +02:00
Philip Rebohle
56e9bba279
[dxgi] Fix scaling when swap image extent mismatches window size
In Proton 3.16, the window size is not necessarily equal to the size
of the WSI swap chain and DXVK is responsible for doing the scaling,
so we should compare to the actual swap image size instead.
2018-10-15 18:35:00 +02:00
Philip Rebohle
254cd8bd06
[dxvk] Optimize image descriptor updates
Avoids unnecessary atomic operations when rendering to a framebuffer
with a depth attachment.
2018-10-15 16:35:40 +02:00
Philip Rebohle
890e5f8c9c
[meta] Release v0.90 2018-10-13 16:31:32 +02:00
Philip Rebohle
6b5aa0b928
Merge branch 'vk_transform_feedback' 2018-10-13 08:00:51 +02:00
Philip Rebohle
8172d347be
Revert "[d3d10] Implement ID3D10Multithread"
This reverts commit 55d6eae210.

We probably don't need it, and the current implementation is broken.
2018-10-12 19:29:52 +02:00
Philip Rebohle
8630ee235a
[util] Re-enable D3D10 for Bioshock 2018-10-12 19:06:53 +02:00
Philip Rebohle
55d6eae210
[d3d10] Implement ID3D10Multithread 2018-10-12 19:06:05 +02:00
Philip Rebohle
e549c9303b
[d3d10] Respect D3D10_CREATE_DEVICE_SINGLETHREADED flag
May improve performance in games which do not need the locking behaviour.
2018-10-12 18:36:02 +02:00
Philip Rebohle
6d18efdfc7
[d3d10] Lock device on context operations
May fix thread safety issues in some games. Apparently, the
D3D10Device is supposed to be thread safe by default.
2018-10-12 18:31:55 +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
406816d17c
[d3d10] Support pOffsets parameter in SOGetTargets 2018-10-10 19:55:42 +02:00
Philip Rebohle
93a851a2fc
[d3d11] Implement DrawAuto method 2018-10-10 19:55:42 +02:00
Philip Rebohle
44024e7a7a
[d3d11] Implement Stream Output queries 2018-10-10 19:55:42 +02:00
Philip Rebohle
93753a5ce7
[d3d11] Bind transform feedback buffers in SOSetTargets 2018-10-10 19:55:41 +02:00
Philip Rebohle
97d776cc00
[d3d11] Allocate counter for stream output buffers 2018-10-10 19:55:41 +02:00
Philip Rebohle
0d89dfae95
[d3d11] Report format support for stream output buffers 2018-10-10 19:55:41 +02:00
Philip Rebohle
7369dee9d6
[d3d11] Create passthrough geometry shader if necessary
Fixes stream output in Unity Engine titles.

- Fix compilation with new DxbcProgramInfo struct.
2018-10-10 19:55:41 +02:00
Philip Rebohle
5463dc7e6c
[d3d11] Implement CreateGeometryShaderWithStreamOutput
- Emit error instead of warning when enabling rasterization
2018-10-10 19:55:26 +02:00
Philip Rebohle
f42ea9f1d1
[d3d11] Set transform feedback usage, stage and access flags 2018-10-10 13:05:38 +02:00
Philip Rebohle
3a48092630
[dxvk] Implement transform feedback draw call 2018-10-10 13:05:37 +02:00
Philip Rebohle
929b75a038
[dxvk] Add support for transform feedback queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
4bdf6daa39
[dxvk] Add structure for transform feedback stream queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
3435702719
[dxvk] Add basic support for indexed queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
76d917df20
[dxvk] Add xfb counter write -> xfb counter read barrier
- Update xfb counter barrier
2018-10-10 13:05:37 +02:00
Philip Rebohle
93b1b9bc00
[dxvk] Implement transform feedback
Begins transform feedback when rendering with an xfb-enabled
pipeline bound, and ends transform feedback as needed, while
writing back the counters supplied by the app. This does not
yet support transform feedback queries or the draw command.
2018-10-10 13:05:37 +02:00
Philip Rebohle
a27e440272
[dxvk] Detect Xfb and set rasterized stream index 2018-10-10 13:05:37 +02:00
Philip Rebohle
1f135f59ed
[dxvk] Add Xfb API stubs 2018-10-10 13:05:37 +02:00
Philip Rebohle
52e1671167
[dxvk] Add Xfb context state 2018-10-10 13:05:37 +02:00
Philip Rebohle
989a10ab88
[dxvk] Enable transform feedback device feature if available
- Enable geometryStreams feature
2018-10-10 13:05:37 +02:00
Philip Rebohle
e27083a04f
[dxvk] Query transform feedback device properties if available 2018-10-10 13:05:37 +02:00
Philip Rebohle
13ecbcaaf5
[dxvk] Enable VK_EXT_transform_feedback 2018-10-10 13:05:37 +02:00
Philip Rebohle
61d56a1732
[dxvk] Add definitions for transform feedback entry points 2018-10-10 13:05:37 +02:00
Philip Rebohle
bf906aa226
[dxvk] Add support for transform feedback access flags 2018-10-10 13:05:37 +02:00
Philip Rebohle
d2c62a8645
[dxbc] Implement passthrough geometry shader
This is needed when vertex or domain shader code is
passed to CreateGeometryShaderWithStreamOutput.

- Fix compilation with new DxbcProgramInfo.
2018-10-10 10:28:15 +02:00
Philip Rebohle
017699df15
[dxbc] Implement Xfb output declarations and setup 2018-10-10 10:28:15 +02:00
Philip Rebohle
bb780bbe10
[dxbc] Add Xfb decorations 2018-10-10 10:28:15 +02:00
Philip Rebohle
6a5fe2247a
[dxbc] Add support for multiple streams in geometry shaders 2018-10-10 10:28:15 +02:00
Philip Rebohle
a42f03e32d
[dxbc] Add Xfb structures to DxbcModuleInfo 2018-10-10 10:28:15 +02:00
Philip Rebohle
eff81c7edf
[dxvk] Implement getShader method for graphics pipelines 2018-10-10 10:28:12 +02:00
Philip Rebohle
e5f3019524
[dxgi] *Actually* silence WaitForVBlank warning
Guess who needs more coffee.
2018-10-09 19:17:20 +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
6dd5cdbc3e
[dxgi] Silence WaitForVblank warning 2018-10-09 14:48:49 +02:00
Andre Heider
8fcdf78b51 [dxbc] rename DxbcProgramVersion to DxbcProgramInfo
The version in not part of this class anymore.
2018-10-08 12:32:01 +02:00
Andre Heider
8492f0501e [dxbc] Drop unused major/minor from DxbcProgramVersion 2018-10-08 12:32:01 +02:00
Philip Rebohle
781ee00f5c
[dxvk] Refactor indirect draw/dispatch commands
Introduces an OpenGL-style bind point for the argument buffer, which
means we can avoid a lot of unnecessary reference tracking in games
that do a lot of indirect draw calls.

Reduces CPU overhead in Assassin's Creed Odyssey.
2018-10-08 10:23:18 +02:00
Philip Rebohle
eb55325640
[dxvk] Fix missing buffer tracking for indirect draw calls
This is optimized to allow a large number of indirect draws to be
submitted if they all access the same argument buffer, as is the
case in Assassin's Creed Syndicate and Odyssey.
2018-10-07 17:51:44 +02:00
Philip Rebohle
af16461858
[dxvk] Fix missing indirect dispatch barriers and tracking 2018-10-07 17:33:03 +02:00
Philip Rebohle
417b6cb6dc
[dxvk] Reduce CPU overhead of indirect draw calls 2018-10-07 17:09:46 +02:00
Philip Rebohle
87f1cd2385
[dxgi] Fix undefined display mode format for display mode transitions
Fixes resolution change option in Dark Souls 3.
2018-10-06 08:01:48 +02:00
Philip Rebohle
09bbb68d98
[meta] Release v0.81 2018-10-05 21:14:11 +02:00
Philip Rebohle
a3bf90f5a3
[vr] Cosmetic code cleanup 2018-10-04 12:30:26 +02:00
Andrew Eikum
bc367fd817
[vr] Load native openvr library on winelib builds 2018-10-04 12:08:12 +02:00
Philip Rebohle
0b4f1b6d6f
[d3d11] Implement DiscardView and DiscardResource for images 2018-10-01 16:54:34 +02:00
Philip Rebohle
0d9e714d3e
[dxvk] Add discardImage method 2018-10-01 16:54:34 +02:00
Philip Rebohle
da76d74a2d
[dxvk] Minor internal buffer API cleanup 2018-09-30 11:05:20 +02:00
Philip Rebohle
aaaf2c53e0
[dxvk] Don't reset unused bind points
Saves a few CPU cycles when binding resources.
2018-09-29 20:23:00 +02:00
Philip Rebohle
387f41ede5
[dxvk] Make DxvkBuffer destructor explicit
Prevents compiler from inlining massive amounts of code where it's
not needed. This is more consistent with the other classes as well.
2018-09-29 20:19:07 +02:00
Philip Rebohle
da8274daaf
[d3d11] Don't set meta-resolve usage flags for depth buffers
Depth buffers cannot be resolved in D3D11.
May improve performance on some hardware when MSAA is used.
2018-09-29 14:59:36 +02:00
Philip Rebohle
894d9606d5
[dxgi] Add option to force-enable MAILBOX present mode
Provides Enhanced Sync-like functionality (#678).
2018-09-29 08:13:52 +02:00
Philip Rebohle
de4c88d5aa
[d3d11] Skip CopyResource when src and dst resource are the same 2018-09-28 19:41:27 +02:00
Philip Rebohle
c9d61e16d9
[d3d11] Skip ResolveSubresource when dst and src resource are the same
Fixes black screen issue in Mortal Kombat X (#670).
2018-09-28 19:41:16 +02:00
Philip Rebohle
33408a8a74
[dxvk] Fix stencil state assignment
Not really important since we don't use stencil anyway,
but we should at least populate the struct correctly.
2018-09-27 21:04:49 +02:00
Philip Rebohle
161fb6215a
[d3d11] Optimize UAV binding
- UpdateBuffer is faster than ClearBuffer for small updates.
- We shouldn't dispatch *two* CS commands for each UAV, one is enough.
2018-09-27 16:50:34 +02:00
Philip Rebohle
518ab2ebdd
[dxvk] Refactor resolve ops
Brings this more in line with clear and copy operations, which
both have more than one code path. Also optimizes barriers.
2018-09-27 12:42:20 +02:00
Philip Rebohle
c5f7f9f3b0
[d3d11] Enable usage flags for meta copy formats
This is required in order to make meta copies work between images
that do not have the necessary D3D11 bind flags set, and it may
speed things up because it allows rendering to the destination
image directly rather than requiring a temporary image.
2018-09-27 11:44:09 +02:00
Philip Rebohle
509e6f1abf
[dxvk] Use new meta copy for depth <> color image copies 2018-09-27 11:44:09 +02:00
Philip Rebohle
fad2e13882
[dxvk] Add meta copy code
The current way of copying data between incompatible images is slow
and does not work for multisampled images. This new code implements
a render pass which performs an exact copy of the source data.
2018-09-27 11:44:09 +02:00
Philip Rebohle
c11d492597
[dxvk] Add meta copy shaders
Used to copy between depth and color images.
2018-09-27 11:44:09 +02:00
Philip Rebohle
b73b91a5c9
[dxgi] Implement slightly better QueryResourceResidency stub
This now returns redidency values for all queried resources, but
not the correct ons. May fix issues in Fallout 4?
2018-09-27 07:31:30 +02:00
Philip Rebohle
63d7770870
[dxvk] Flush queued barriers when binding any frame buffer
We need to flush when starting meta render passes as well.
2018-09-25 21:32:21 +02:00
Philip Rebohle
8bcd47d6dc
[dxvk] Simplify pipeline object locking
Any more complex approach is not very useful at the moment
because we have to put a lock around the actual compile
function anyway.
2018-09-25 18:22:58 +02:00
Philip Rebohle
0be291e123
[dxvk] Don't do image-to-buffer copies for multisampled images
Vulkan does not allow this.
2018-09-25 14:37:53 +02:00
Philip Rebohle
305c361c00
[d3d11] Fix incomplete usage mask for buffer UAVs 2018-09-25 10:14:42 +02:00
Philip Rebohle
ddfa7e40b3
[dxvk] Renove redundant vkDestroyPipeline 2018-09-24 22:54:49 +02:00
Philip Rebohle
a950872c7c
[dxvk] Check whether the vertex binding / attribute count is valid 2018-09-24 16:22:12 +02:00
Philip Rebohle
1e40a14a50
[d3d10] Disable D3D10 support for Bioshock 2018-09-24 15:30:13 +02:00
Philip Rebohle
bd4338be42
[d3d10] Add option to enable or disable D3D10 support 2018-09-24 15:26:33 +02:00
Philip Rebohle
04ed4273ba
[dxvk] Avoid buffer slice copy when binding index/vertex buffers
Also redesigns getDescriptor to always return the offset.
2018-09-23 20:09:01 +02:00
Philip Rebohle
1c865328d3
[meta] Release v0.80 2018-09-23 19:01:15 +02:00
Philip Rebohle
b49876528a
[dxvk] Enable state cache for compute pipelines
Also cleans up some code to get the design more in line
with how graphics pipelines are handled.
2018-09-23 14:42:03 +02:00
Philip Rebohle
6c8ac9e5f4
[dxvk] Add compute shader support to pipeline state cache 2018-09-23 14:42:03 +02:00
Philip Rebohle
689602497f
[d3d11] Use state cache 2018-09-23 14:41:49 +02:00
Philip Rebohle
4a72cae1e6
[dxvk] Enable state cache 2018-09-23 14:41:43 +02:00
Philip Rebohle
57dab630b5
[dxvk] Add pipeline state cache
Stores state vectors for graphics pipelines in a file and allows
games to start compiling them in advance on subsequent launches.

Changes:
(1) Add environment variable to select the cache file path
(2) Add magic number and entry size to cache file header
2018-09-22 22:38:35 +02:00
Philip Rebohle
d6742e38c5
[dxvk] Lock pipeline object while compiling one pipeline
This prevents us from compiling the exact same pipeline twice
at the same time, which for some reason crashes RADV.
2018-09-22 12:04:06 +02:00
Philip Rebohle
0e2d63f6d2
[dxvk] Add method to retrieve shader key from shader module 2018-09-22 12:04:06 +02:00
Philip Rebohle
f3a23ab81f
[util] Add convenience method for SHA1 hash compulation 2018-09-22 12:04:06 +02:00
Philip Rebohle
83447975ac
[dxvk] Refactor pipeline stat counters
The stat counter struct no longer has to be passed to
the pipeline compiler function.

The new implementation uses atomic counters of the pipeline manager
rather than per-command list counters, which removes the need to
pass the counter structure to the compiler function.
2018-09-22 12:02:20 +02:00
Philip Rebohle
5410680401
[dxvk] Refactor pipeline object constructors
This way we don't need to pass everything to the pipeline objects.
2018-09-22 11:59:25 +02:00
Philip Rebohle
9284081180
[dxvk] Remove redundant declaration 2018-09-21 19:43:47 +02:00