Philip Rebohle
87dc472a8d
[dxvk] Set empty scissor rect when the app requests empty viewport
...
Since we cannot set the viewport size to zero, we should set an
empty scissor rect so that rasterization is still effectively
disabled for the given viewport index.
Fixes #813 , #957 .
2019-04-01 15:45:41 +02:00
Philip Rebohle
8702374bf7
[dxvk] Do not invalidate iterator before disabling queries
...
Reported-by: Joshua Ashton <joshua@froggi.es>
2019-04-01 02:58:02 +02:00
Philip Rebohle
70510bab9a
[dxvk] Introduce extra pipeline state
...
Provides extra state that will be passed in via spec constants.
Whether or not this state is used is determined by the shaders.
2019-04-01 02:31:32 +02:00
Philip Rebohle
18d2905bf7
[dxvk] Remove unused alphaToOne state
...
Nothing supports this anyway, so no reason to carry it around.
2019-04-01 02:31:22 +02:00
Marin Baron
1c434d86cb
[util] Enable deferred surface creation for "Dissidia Final Fantasy NT Free Edition".
...
Avoid white screen, "D3D11Device: No such vertex shader semantic: COLOR0"...
https://www.reddit.com/r/archlinux/comments/b7e38x/protondxvk_dissidia_nt/
2019-03-31 03:27:05 +02:00
Philip Rebohle
a646f8cf2c
[util] Enable deferred surface creation for Nioh
...
See discussion in #284 .
2019-03-29 08:49:37 +01:00
Chip Davis
d741bc47ef
[dxgi] Use a recursive mutex.
...
Some games, like Final Fantasy XIV, call `SetFullscreenState()` again
after the window is resized. When the resize itself was triggered by a
`SetFullscreenState()` call, this will cause us to re-enter the mutex.
2019-03-29 08:26:19 +01:00
Philip Rebohle
61adaa941d
[d3d11] Implement fast path for binding full constant buffers
...
Saves a few CPU cycles in the most common case where
we don't have to perform any sort of range check.
2019-03-28 14:09:08 +01:00
Philip Rebohle
8f580efa25
[d3d11] Correctly handle out-of-bounds constant buffer ranges
...
Otherwise we pass an invalid offset and length to the backend,
which leads to invalid descriptor set updates in Vulkan.
The D3D11 runtime does not report corrected constant offset
and count parameters to the applicaion in *GetConstantBuffers1.
Reported-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2019-03-28 13:45:41 +01:00
Philip Rebohle
09d60f42bc
[d3d11] Work around predicate buffer sync issue on RADV
...
If the predicate buffer is device-local memory, conditional
rendering commands don't seem to see any updates values even
though there is a barrier. When allocating on host-visible
device memory or system memory, it works as expected.
2019-03-28 10:02:11 +01:00
Philip Rebohle
3a3d7fb378
[d3d11] Properly implement SetPredication
2019-03-28 10:02:11 +01:00
Philip Rebohle
d81146e3d2
[d3d11] Allocate predicate buffer for predicates
2019-03-28 10:02:11 +01:00
Philip Rebohle
7e16c4cda1
[d3d11] Remove unused revision field from D3D11Query
2019-03-28 10:02:11 +01:00
Philip Rebohle
acdb989cfa
[dxvk] Implement conditional rendering
2019-03-28 10:02:11 +01:00
Philip Rebohle
03f00453ef
[dxvk] Add command list functions for conditional rendering
2019-03-28 10:02:11 +01:00
Philip Rebohle
70520e30aa
[dxvk] Enable conditionalRendering feature if present
2019-03-28 10:02:11 +01:00
Philip Rebohle
8f7e606583
[dxvk] Enable VK_EXT_conditional_rendering if available
2019-03-28 10:02:11 +01:00
Philip Rebohle
7f211545ee
[vulkan] Load functions for VK_EXT_conditional_rendering
2019-03-28 10:02:11 +01:00
Chip Davis
13a6ecadcd
[dxvk] Remove needless lambda capture of 'this'.
2019-03-27 21:59:15 +01:00
Chip Davis
7a37d88067
[dxvk] Log vertex attributes and buffers when logging pipeline state.
...
This was invaluable in diagnosing a missing feature from MoltenVK.
2019-03-27 21:59:03 +01:00
Philip Rebohle
edd63d3972
[dxvk] Fix buffer offset in copyDepthStencilImageToPackedBuffer
2019-03-27 14:23:58 +01:00
Philip Rebohle
03881dde72
[dxvk] Implement blitImage function
2019-03-27 02:31:04 +01:00
Philip Rebohle
6c8042033e
[d3d11] Select memory type based on CPU access flags
2019-03-26 21:17:52 +01:00
Philip Rebohle
302c6b5e6c
[d3d11] Implement depth-stencil uploads in resource initializer
2019-03-26 18:11:42 +01:00
Philip Rebohle
fc3515c16f
[d3d11] Implement depth-stencil uploads in UpdateSubresource1
2019-03-26 18:11:42 +01:00
Philip Rebohle
eec1cde1b3
[d3d11] Implement depth-stencil mapping on deferred contexts
2019-03-26 18:05:02 +01:00
Philip Rebohle
97d77fa508
[d3d11] Implement depth-stencil mapping on the immediate context
2019-03-26 18:04:56 +01:00
Philip Rebohle
c38b1802a2
[d3d11] Enable shaderStorageImageExtendedFormats device feature
2019-03-26 17:56:57 +01:00
Philip Rebohle
8194bec1bf
[d3d11] Fix image format mapping when creating mapped buffer
2019-03-26 17:54:43 +01:00
Philip Rebohle
7cd3e9a0d4
[d3d11] Add method to look up packed format
2019-03-26 17:54:14 +01:00
Philip Rebohle
6c2f16fce8
[dxgi] Add methods to retrieve original format mappings
2019-03-26 17:54:14 +01:00
Philip Rebohle
b3ea1b02eb
[dxvk] Implement depth-stencil upload via temporary buffer
2019-03-26 17:54:14 +01:00
Philip Rebohle
0d889e0dcd
[dxvk] Implement depth-stencil unpacking
2019-03-26 17:54:10 +01:00
Philip Rebohle
de45ffd749
[dxvk] Create depth-stencil unpacking pipelines
2019-03-26 16:05:27 +01:00
Philip Rebohle
7124c3f449
[dxvk] Add depth-stencil unpacking shaders
2019-03-26 16:05:27 +01:00
Philip Rebohle
90c7878a53
[dxvk] Rename dxvk_resolve_{vert|geom} -> dxvk_copy_{vert|geom}
2019-03-25 18:22:56 +01:00
Philip Rebohle
7627f6e3ed
[dxvk] Optimize meta copy barriers
2019-03-25 17:58:31 +01:00
Philip Rebohle
fd0daa5ec7
[dxvk] Optimize meta geometry shaders
2019-03-25 17:58:25 +01:00
Philip Rebohle
be1832a348
[d3d11] Don't sample gamma texture if the gamma curve is identity
...
Saves some GPU time in games that don't use DXGI gamma control at all.
2019-03-24 18:07:21 +01:00
Philip Rebohle
73bb0d8ae2
[dxvk] Remove shader-based resolve
...
No longer necessary since we're using render pass resolve now.
2019-03-24 16:36:35 +01:00
Philip Rebohle
75ee1f42c2
[dxvk] Use resolve attachment for meta-resolve ops
...
Faster than the naive fragment shader-based solution.
2019-03-19 11:45:56 +01:00
Philip Rebohle
209248e26d
[dxvk] Use vkResetQueryPoolEXT to reset individual queries
...
This is much faster than the fallback path which uses GPU functions.
2019-03-17 16:25:00 +01:00
Philip Rebohle
3d53f318fd
[dxvk] Enable hostQueryReset device feature if available
2019-03-17 16:24:59 +01:00
Philip Rebohle
9dd9f0ab22
[dxvk] Enable VK_EXT_host_query_reset if available
2019-03-17 16:24:59 +01:00
Philip Rebohle
412d79c8c1
[d3d11] Use new query implementation
2019-03-14 21:16:41 +01:00
Philip Rebohle
e5441e841f
[dxvk] Support new query implementation
2019-03-14 21:16:41 +01:00
Philip Rebohle
a8144370c8
[dxvk] Create new query pool and forward it to the context
2019-03-14 21:16:41 +01:00
Philip Rebohle
772fa3074f
[dxvk] Add new query implementation
2019-03-14 21:16:41 +01:00
Philip Rebohle
8c3900c533
[d3d11] Use new GPU events for D3D11 Event queries
2019-03-14 21:16:41 +01:00
Philip Rebohle
3dbd755075
[dxvk] Implement method to signal GPU events
2019-03-14 21:16:41 +01:00
Philip Rebohle
6b9653d261
[dxvk] Create GPU event pool and forward it to the context
2019-03-14 21:16:41 +01:00
Philip Rebohle
4da89ccc48
[dxvk] Add GPU event class
...
GPU events allow for finer-grained CPU<>GPU synchronization than
the current approach, so we should change our implementation.
2019-03-14 21:16:38 +01:00
Philip Rebohle
7fa2fb5188
[meta] Release 1.0.1
2019-03-14 19:07:18 +01:00
Philip Rebohle
19f82826bb
[d3d11] Don't use presentation fence on ANV
...
Should hopefully fix stuttering issues introduced with 1.0.
2019-03-14 18:50:33 +01:00
Philip Rebohle
1656860486
[dxgi] Remove obsolete global monitor helper functions
2019-03-14 18:26:39 +01:00
Philip Rebohle
5b72e84726
[dxgi] Use IDXGIVkMonitorInfo in DxgiSwapChain
2019-03-14 18:26:39 +01:00
Philip Rebohle
50347e1256
[dxgi] Use IDXGIVkMonitorInfo in DxgiOutput
2019-03-14 18:26:39 +01:00
Philip Rebohle
7d5b5f288c
[dxgi] Implement IDXGIVkMonitorInfo for DxgiFactory
2019-03-14 18:26:39 +01:00
Philip Rebohle
cfdac13ea5
[dxgi] Add new COM interface for per-monitor data
2019-03-14 18:26:37 +01:00
Philip Rebohle
f272071d8d
[dxvk] Don't enforce HOST_CACHED flag when allocating memory
...
The better fix would be to support non-coherent memory properly,
but this will have to do for now. Fixes #947 .
2019-03-14 16:47:17 +01:00
Philip Rebohle
c35af973bb
[util] Disable NvAPI hack for Star Wars Battlefront 2015
...
Fixes #968 .
2019-03-14 16:33:35 +01:00
Philip Rebohle
2d39be4e72
[d3d11] Check image block alignment in UpdateSubresource1
...
Fixes validation errors in World of Warcraft, which for some reason
tries to update individual pixels of block-compressed textures.
See #964 .
2019-03-14 01:11:39 +01:00
Philip Rebohle
833c433556
[util] Enable relaxed barriers for Devil May Cry 5
...
Same engine as RE2, same ~10% performance improvement.
2019-03-11 18:36:09 +01:00
Philip Rebohle
0326258829
[dxbc] Use SDiv instead of ShiftRightLogical for index calc on Nvidia
...
Reportedly fixes Resident Evil 2 and Devil May Cry 5 on Nvidia.
2019-03-09 19:59:56 +01:00
Philip Rebohle
a40d8d49ea
[dxvk] Only enable xfb subpass barrier if feature is enabled
...
Silences validation errors when running FL9_x applications, or
a driver which does not support VK_EXT_transform_feedback.
2019-03-02 19:56:01 +01:00
Philip Rebohle
4fc96e60c5
[d3d11] Reimplment GetEnabledShaderStages using getShaderPipelineStages
...
They do the same thing anyway.
2019-03-02 19:56:01 +01:00
Philip Rebohle
d9edb16b75
[dxvk] Use getShaderPipelineStages for dummy resource creation
...
Fixes some validation errors for FL10_x and FL9_x applications.
2019-03-02 19:56:01 +01:00
Philip Rebohle
2a6d4fa2ba
[dxvk] Implement DxvkDevice::getShaderPipelineStages
2019-03-02 19:56:00 +01:00
Joshua Ashton
d01110259c
[d3d11, d3d10] Init returnptrs for CreateDevice funcs.
2019-02-27 23:17:08 +01:00
Joshua Ashton
995949a9f9
[d3d10] Fix and cleanup S_FALSE handling
2019-02-27 22:01:04 +01:00
Joshua Ashton
62a833b528
[dxgi] Correct return values for CreateDXGIFactory[1/2]
2019-02-27 22:01:04 +01:00
Joshua Ashton
ccf24db428
[d3d10] Fix null pBlendStateDesc being dereferenced on def. desc
2019-02-27 22:01:04 +01:00
Joshua Ashton
2454041903
[d3d10] nullptr checks for resource creation
2019-02-27 22:01:04 +01:00
Joshua Ashton
28df1e0825
[d3d11] nullptr check descs & fix return values
2019-02-27 22:01:04 +01:00
Philip Rebohle
10140f40ca
[dxvk] Release 1.0
2019-02-25 20:26:50 +01:00
Philip Rebohle
e03b574cc1
[d3d11] Block on image acquisition fence before presenting
...
May potentially improve frame timing on drivers where image
acquisition does not block.
2019-02-25 13:34:49 +01:00
Philip Rebohle
b6804a95b7
[vulkan] Create per-swap image fences for presenter
2019-02-25 13:34:49 +01:00
Philip Rebohle
a6d1fe07f2
[vulkan] Add helper method to wait for presenter fence
2019-02-25 13:34:49 +01:00
Philip Rebohle
2231caaa9e
[vulkan] Add optional fence paratemer to acquireNextImage
...
We'll reset the fence prior to acquisition, so that the user of
this API won't have to do it.
2019-02-25 13:34:46 +01:00
Philip Rebohle
6d814b24da
[dxbc] Fix invalid SPIR-V for FirstBitHi / FirstBitShi on vectors
...
Refs #930 .
2019-02-23 21:27:40 +01:00
Philip Rebohle
d12a8e09a8
[dxbc] Decorate integer fragment shader builtins as flat
...
Fixes yellow tint in Unreal Engine 4 games on RADV and AMDGPU-PRO.
2019-02-23 14:33:59 +01:00
Philip Rebohle
b65520d627
[dxvk] Fix feature query for vertex attribute divisor
2019-02-20 11:47:15 +01:00
Philip Rebohle
38c6eeed26
[dxbc] Only emit depth clamp in fragment shader if necessary
...
We don't need this if the depth clip extension is supported
by the driver.
2019-02-19 14:27:21 +01:00
Philip Rebohle
9159401b14
[dxvk] Use depthClipEnable during graphics pipeline creation
...
Fall back to previous behaviour if the feature is not available.
2019-02-19 14:22:36 +01:00
Philip Rebohle
49965fd79e
[dxvk] Enable depthClipEnable feature if available
2019-02-19 13:57:34 +01:00
Philip Rebohle
cc5ac885f5
[dxvk] Enable VK_EXT_depth_clip_enable if available
2019-02-19 13:53:56 +01:00
Philip Rebohle
20ea74fa99
[d3d11] Do not enable shaderStorageImageMultisample device feature
...
See https://github.com/KhronosGroup/MoltenVK/issues/502
2019-02-19 11:32:32 +01:00
Philip Rebohle
2d81decb91
[dxbc] Fix SPIR-V caps for SRV and UAV resources
2019-02-19 11:31:12 +01:00
Philip Rebohle
d9931e3621
[utils] Report Nvidia GPUs for Far Cry 3 and Far Cry 4
...
Both games make assumptions about the exact clear value for UNORM
render targets, which is incorrect on most Vulkan drivers.
2019-02-18 18:04:36 +01:00
Andrew Sheldon
be22756d2a
Update DXVK_FILTER_DEVICE_NAME to support matching substrings
...
Why? RADV device names include the LLVM version, which means that on every LLVM
upgrade, the device name needs to be changed to match. This change allows setting
something like "AMD RADV VEGA10" which should remain persistent over time.
2019-02-17 08:32:03 +01:00
Philip Rebohle
fe781df591
[util] Enable relaxed barriers for Resident Evil 7
...
Same engine as Resident Evil 2, although the impact will be lower.
2019-02-15 20:59:33 +01:00
Philip Rebohle
11d2082fd2
[hud] Add 'api' option to show the client API
2019-02-15 18:05:44 +01:00
Philip Rebohle
10123ce9ab
[dxvk] Pass description of the client API to the DXVK device
2019-02-15 17:38:52 +01:00
Philip Rebohle
cbaeca8f43
[d3d11] Move sType/pNext initialization for dev.features to backend
...
There's no good reason to have this code in the D3D11 module.
2019-02-15 10:20:03 +01:00
Philip Rebohle
f7ed7b7118
[d3d11] Fix device feature enablement in some situations
...
- Geometry shaders are required by the backend
- FL9 already supports BC texture formats
2019-02-15 10:05:17 +01:00
Philip Rebohle
7056425bbd
[dxvk] Create state cache directory if it does not yet exist
...
We only create it if the parent directory already exists. Resolves #907 .
2019-02-11 22:24:19 +01:00
Philip Rebohle
9bfa470581
[util] Implement createDirectory function
2019-02-11 21:59:46 +01:00
Philip Rebohle
629238ac36
[util] Implement tows method to convert strings to wide strings
2019-02-11 21:35:32 +01:00
Philip Rebohle
746562de5a
[dxgi,d3d11] Remove IDXGIVkPresentDevice
2019-02-11 20:06:12 +01:00
Philip Rebohle
fd445f7b4d
[d3d11] Move D3D11 presenter creation to WineDXGISwapChainFactory
2019-02-11 20:06:12 +01:00
Philip Rebohle
9f8c1d08a6
[dxgi,d3d11] Move swap chain creation to D3D11 module
2019-02-11 20:06:12 +01:00
Philip Rebohle
7ed91872b6
[dxgi] Use IWineDXGISwapChainFactory to create DXGI swap chains
2019-02-11 20:06:11 +01:00
Joshua Ashton
5ea8648cd9
[d3d11, d3d10, dxgi] Handle null ppvObject in QueryInterface. ( #909 )
...
When a null ppvObject is passed into a QueryInterface on any IUnknown, a E_POINTER should be returned as the result (and it should not crash.)
This matches native d3d11/d3d10/dxgi behaviour and the documentation found here https://docs.microsoft.com/en-us/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q_) for IUnknown.
2019-02-10 08:01:01 +01:00
Philip Rebohle
311661e404
[dxvk] Use vkCmdUpdateBuffer to clear tiny buffers
...
While this might consume a few more CPU cycles, UpdateBuffer may
be cheaper on the GPU for very small buffers, so we should use
it instead.
Also seems to fix rendering issues in Far Cry Primal for unknown reasons.
2019-02-09 22:21:57 +01:00
Philip Rebohle
8543f96413
[dxvk] Don't create flat 2D views for cube maps
...
Fixes a rendering issue in Heroes of the Storm, where the game
binds a cube map array to a resource slot which expects a 2D
view.
Refs #777 .
2019-02-09 01:01:43 +01:00
Philip Rebohle
f6380fa152
[util] Enable relaxed barriers for Resident Evil 2
...
Improves performance by up to 10% when GPU-bound.
2019-02-08 01:38:03 +01:00
Philip Rebohle
e56710e64f
[d3d11] Add option to disable write-after-write barriers
2019-02-07 19:39:05 +01:00
Philip Rebohle
023cf01c3c
[dxvk] Implemet IgnoreWriteAfterWrite for compute shaders
...
When enabled, potential write-after-write hazards will be ignored and
no barrier will be inserted. Can improve performance in some cases.
2019-02-07 19:39:05 +01:00
Philip Rebohle
24dca37fce
[dxvk] Add methods to query source access type for an accessed resource
2019-02-07 19:39:05 +01:00
Philip Rebohle
9165f8c072
[dxvk] Add type and context method to set barrier control flags
2019-02-07 19:39:05 +01:00
Philip Rebohle
915091b76b
[dxbc] OpSDiv by 4 -> OpShiftRightLogical by 2
2019-02-07 19:32:07 +01:00
Philip Rebohle
8b80db7839
[dxbc] Fix storage class for UBO loads
...
UniformConstant is used for other things, UBOs are Uniform.
2019-02-05 21:28:50 +01:00
Philip Rebohle
9c4a6ee950
[utils] Enable strict division for Final Fantasy XIV
...
Fixes #904 .
2019-02-05 21:28:27 +01:00
Philip Rebohle
c0b325b483
[dxbc] Add option to enable strict sm4-compliat division
...
SM4 is defined to return the first source operand if the divisor is zero.
Windows drivers don't do this by default, so we shouldn't do it either.
2019-02-05 21:08:13 +01:00
Philip Rebohle
a4378996d9
[dxbc] Reduce length of temporary shader input array to a minimum
...
Fixes severe performance regression with the AMD proprietary driver.
2019-02-04 13:30:08 +01:00
Philip Rebohle
6c17fa075b
[d3d11] Minor map optimization on deferred contexts
2019-02-04 10:26:04 +01:00
Philip Rebohle
8d493d9445
[d3d11] Minor map optimization on immediate contexts
...
We should make the fast path as fast as possible.
2019-02-04 10:24:30 +01:00
Philip Rebohle
01a7e06ad7
[dxvk] Inline DxvkBuffer::allocSlice and DxvkBuffer::freeSlice
...
Seems to take some load off both the main rendering thread and the
cleanup thread in SotTR.
2019-02-04 10:01:29 +01:00
Philip Rebohle
c451c9a95e
[dxvk] Only merge clears when framebuffer size matches view size
...
Otherwise, we'll only clear a smaller portion of the view, which is
incorrect. Fixes a rendering issue in Fallout New Vegas with DXUP.
2019-02-04 07:31:17 +01:00
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
e5a06d3f4a
[dxbc] Only load requested components from constant buffers
...
Results in better performance compared to loading the entire vector
on RADV. Suggested by Samuel Pitoiset.
2019-01-30 16:32:25 +01:00
Philip Rebohle
c360a196fb
[dxvk] Restore dedicated allocation behaviour
...
Whoops.
2019-01-30 15:49:06 +01:00
Philip Rebohle
412fb9ac57
[dxvk] Use VK_EXT_memory_budget to report memory usage
2019-01-30 15:45:57 +01:00
Philip Rebohle
b76f470c5f
[dxvk] Remove dxvk.allowMemoryOvercommit option
...
The default behaviour is now to allow overallocation by default,
which makes sense especially when VK_EXT_memory_priority is used.
Does not seem to affect Nvidia drivers.
2019-01-30 13:52:43 +01:00
Philip Rebohle
dfa8524e73
[dxvk] Wire up memory priority to device memory allocations
2019-01-30 13:52:43 +01:00
Philip Rebohle
03b488772d
[dxvk] Store device instead of adapter in memory allocator
2019-01-30 13:52:43 +01:00
Philip Rebohle
b884c56631
[dxvk] Enable VK_EXT_memory_priority and features if available
2019-01-30 13:52:43 +01:00
Philip Rebohle
e7bf1647dd
[dxvk] Use high memory priority for GPU-writable resources
2019-01-30 13:52:43 +01:00
Philip Rebohle
134613375d
[dxvk] Introduce concept of priorities to device-local memory allocations
...
The priority defines the importance of any given allocation being
resident in device-local memory rather than system memory, with
values between 0 (low) and 1 (high).
Suballocations will only work on chunks with the requested priority.
This ensures that high-priority allocations are reserved solely for
high-priority resources, and that high-priority resources will be
allocated from a high-priority memory chunk.
2019-01-30 13:52:43 +01:00
Philip Rebohle
35c7d687ff
[meta] Release 0.96
2019-01-26 18:41:48 +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
1cc24c223b
[dxbc] Reduce length of tessellation i/o arrays to minimum
...
This allows us to fix a violation of the Vulkan specification
where using the same location range for per-vertex and per-patch
i/o is illegal.
May also help certain drivers figure out what's actually needed.
2019-01-26 17:12:23 +01:00
Philip Rebohle
b0b7960548
[dxbc] Add method to count required registers for signatures
2019-01-26 17:11:49 +01:00
Philip Rebohle
0b5cffb0bb
[dxbc] Parse patch constant signature
2019-01-26 14:52:29 +01:00
Philip Rebohle
3960355d47
[d3d11] Avoid redundant viewport updates in RSSetState
...
Rise of the Tomb Raider changes its rasterizer state very frequently
(once every handful of draws), and the viewport package is very large,
so we should avoid sending it to the CS thread redundantly.
We only need to update when the scissor test state has changed.
2019-01-23 05:36:49 +01:00
Philip Rebohle
df7573f332
[dxvk] Implement separate code path for clear-only render passes
...
Allows more clears to overlap with non-rendering commands
in case the app calls OMSetRenderTargets prior to the clear.
Also fixes a bug where we might accidentally use the wrong
set of color attachments to set up render pass operations.
2019-01-23 01:12:03 +01:00
Philip Rebohle
8cfb7936ed
[dxvk] Use explicit barriers after framebuffer clears
...
This may allow clears to overlap with subsequent commands unless a
barrier is actually required.
2019-01-23 01:12:03 +01:00
Philip Rebohle
2aeef063c1
[dxvk] Properly support TOP_OF_PIPE and BOTTOM_OF_PIPE for barriers
2019-01-23 01:12:03 +01:00
Philip Rebohle
1631243c64
[dxvk] Don't flush barriers in renderPassBindFramebuffer
...
Instead, any pending barriers must be flushed manually if necessary.
2019-01-23 01:11:55 +01:00
Philip Rebohle
5b90b6a7ce
[dxvk] Make external subpass dependencies part of DxvkRenderPassOps
...
This will allow us to use finer-grained synchronization around certain
meta operations involving render targets, such as clears.
2019-01-22 20:13:43 +01:00
Philip Rebohle
a79409ad02
Revert "[dxvk] Don't put rendering stage/access masks into image info"
...
This reverts commit ce3642edd0
.
We're actually going to need these when optimizing render pass barriers.
2019-01-22 14:52:35 +01:00
Philip Rebohle
3109ab476a
[dxvk] Add support for general memory barriers
...
Affects all resources with compatible stage and access flags.
2019-01-22 14:31:10 +01:00
Philip Rebohle
b1540a16e8
[dxvk] Fix render pass ops in clearImageViewFb
2019-01-22 13:41:10 +01:00
Andrew Eikum
9ad24a2216
[d3d11] In D3D11CreateDevice, create DXGI factory with IDXGIFactory1 support ( #878 )
2019-01-22 10:57:05 +01:00
Philip Rebohle
cfc3f686bb
[util] Update per-app config overrides
2019-01-19 17:45:26 +01:00
Philip Rebohle
c3ae180c1a
[d3d11] Remove d3d11.fakeStreamOutput option
...
Only relevant on old drivers which do not support the extension.
Assumed to be enabled by default if Transform Feedback is not supported.
2019-01-19 17:39:59 +01:00
Philip Rebohle
4d4bd182c1
[d3d11] Allow arbitrary back buffer formats for swap chains
...
Doesn't match D3D11 behaviour, but shouldn't really break anything
since D3D11 has a fixed set of swap chain-compatible formats.
Might help DXUP in avoiding unnecessary framebuffer blits.
2019-01-19 02:28:25 +01:00
Philip Rebohle
4dac8e7233
[dxvk] Update buffer view in clearBufferView
...
Otherwise we might accidentally clear the wrong buffer region.
2019-01-18 21:29:05 +01:00
Philip Rebohle
9dbe352c51
[dxvk] Fix incorrect buffer view range for views with non-zero offset
2019-01-18 21:26:48 +01:00
Philip Rebohle
7e975bbdfc
[dxvk] Move blend constants and stencil ref state to DxvkDynamicState
...
For consistency with how depth bias is being stored.
2019-01-17 22:26:27 +01:00
Philip Rebohle
95815a075b
[dxvk] Move depth bias out of rasterizer state
...
While the previous model corresponded to D3D11, it does
not reflect that the backend treats it the same way as
e.g. blend constants.
2019-01-17 22:25:21 +01:00
Philip Rebohle
8cc4497f11
[dxvk] Only update index buffer for indexed draws
...
This is somewhat uncommon, but we sometimes bind an index
buffer in a render pass that doesn't get used at all.
2019-01-17 03:15:21 +01:00
Philip Rebohle
321feed728
[dxvk] Bump state cache version to v3
...
We're still going to try and fix up v2 entries. This may
cause unnecessary pipelines to be created for games that
actually use depth bias.
2019-01-17 02:32:09 +01:00
Philip Rebohle
0d84ebd4c9
[dxvk] DepthClampEnable -> DepthClipEnable
...
There are subtle differences between the two that we
should deal with in the backend at some point.
2019-01-17 01:59:10 +01:00
Philip Rebohle
4819287029
[d3d11] Do not enable depth bias if the parameters are zero
2019-01-17 00:53:54 +01:00
Philip Rebohle
422198952a
[dxvk] Use minimal set of dynamic state
...
We don't need to enable blend constants for pipelines that don't
have blending enabled, etc. This helps reduce the number of API
calls slightly and may help the driver work more efficiently.
2019-01-16 20:55:41 +01:00
Philip Rebohle
190f114449
[dxvk] Add methods to check which dynamic states a pipeline uses
2019-01-16 20:01:20 +01:00
Philip Rebohle
59462f3231
[dxvk] Don't re-emit dynamic state every time we bind a pipeline
...
This used to be necessary on some drivers that would lose dynamic
state upon pipeline bindings, but that no longer seems to be the
case.
2019-01-16 17:47:31 +01:00
Michal Srb
cc38412d04
[d3d11] Fix bad check in DrawInstancedIndirect ( #863 )
2019-01-15 11:12:03 +01:00
Philip Rebohle
109300d541
[d3d11] Remove unused syncMode option
2019-01-14 19:21:10 +01:00
Philip Rebohle
2bae3a5c8b
[d3d11] Reintroduce support for dxgi.maxFrameLatency
...
This option was previously ignored for some reason.
2019-01-14 18:29:25 +01:00
Entryhazard
7306c3153c
[util] Change getEnvVar to use getenv ( #859 )
2019-01-13 21:27:59 +01:00
Philip Rebohle
ddce33692c
[meta] Release v0.95
2019-01-12 21:42:49 +01:00
Philip Rebohle
79eded9ae2
[d3d11] Only apply viewport and scissor rect if they have changed
...
Resident Evil 2 calls these functions before every single draw
call, so we should avoid emitting redundant viewport updates.
2019-01-12 20:22:08 +01:00
Philip Rebohle
c804d99db7
[d3d11] Fix log spam in SetEvictionPriority stubs
2019-01-12 15:22:34 +01:00
Philip Rebohle
bee21e7539
[dxbc] Support parsing the ISG1 and OSG1 signature chunks
...
Required to get the Resident Evil 2 demo to work.
2019-01-12 15:17:51 +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
4f0da40afa
[d3d11] Add some documentation to d3d11_cmd.h
2019-01-11 12:05:25 +01:00
Philip Rebohle
e665d896e3
[d3d11] Fix build errors on MSVC
2019-01-10 18:26:52 +01:00
Philip Rebohle
bbc3b3fb2b
[d3d11] Use multiDrawIndirect for subsequent indirect draw calls
...
Significantly improves performance in AC:Odyssey when CPU bound.
Only has an effect when no state changes between draw calls, and
when the draw parameter buffer is tightly packed.
2019-01-10 17:14:12 +01:00
Philip Rebohle
ad6233f74c
[d3d11] Enable multiDrawIndirect device feature if available
2019-01-10 16:59:53 +01:00
Philip Rebohle
f7dbcbe882
[dxvk] Introduce command type with extra data
...
The additional data is stored as a struct which can be
modified after submitting the command to the CS chunk.
2019-01-10 16:59:53 +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
cf9de54a12
[dxgi] Add dxgi.nvapiHack option to disable NVAPI workaround
2019-01-10 11:58:16 +01:00
Philip Rebohle
9faf841f32
[dxvk] Remove DxvkPhysicalBuffer and friends
2019-01-09 18:05:01 +01:00
Philip Rebohle
8b5db80fbd
[dxvk] Reimplement DxvkBuffer
...
Avoids the DxvkPhysicalBuffer indirection and keeps all buffer
objects alive until the DxvkBuffer itself gets destroyed.
2019-01-09 18:04:46 +01:00
Philip Rebohle
cc61e38b9c
[dxvk] Reimplement DxvkBufferView
...
Instead of recreating the buffer view every single time the
underlying buffer gets invalidated, this keeps all buffer
views around until the object itself gets destroyed.
2019-01-09 18:02:00 +01:00
Philip Rebohle
61fdf4ef64
[dxvk] Use DxvkBufferSliceHandle for dummy resources
2019-01-09 18:02:00 +01:00
Philip Rebohle
c8e1813b07
[dxvk] Use DxvkBufferSliceHandle for staging buffers
2019-01-09 18:02:00 +01:00
Philip Rebohle
004db3677b
[dxvk] Use DxvkBufferSliceHandle for transform feedback
2019-01-09 15:13:04 +01:00
Philip Rebohle
17398e47bd
[dxvk] Use DxvkBufferSliceHandle for buffer memory barriers
2019-01-09 15:03:17 +01:00
Philip Rebohle
bbb7728b58
[dxvk] Introduce DxvkBufferSliceHandle
...
This struct is meant to replace DxvkPhysicalBufferSlice in the long
run, in a way that doesn't require extra reference counting.
2019-01-09 14:56:02 +01:00
Philip Rebohle
2f1f8ba0a4
[d3d11] Fix CheckMultisampleQualityLevels behaviour
...
- Querying DXGI_FORMAT_UNKNOWN should not return an error,
and should advertize support for a sample count of 1
- Querying non-power of two sample counts should not fail
- Invalid arguments should be handled properly
2019-01-09 00:28:25 +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
4fe5929799
[dxbc] Add options to enable/disble early discard and raw ssbo use
2019-01-08 20:58:18 +01:00
Philip Rebohle
524227d21c
[util] Add tristate config option type
2019-01-08 20:57:38 +01:00
Philip Rebohle
214891ffc6
[d3d11] Improve error logging when texture creation fails
2019-01-08 10:34:48 +01:00
Philip Rebohle
9890b87225
[dxbc] Fix incorrect error message
2019-01-08 00:46:24 +01:00
Philip Rebohle
d0ee7f54bf
[hud] Add DXVK_HUD=full option
...
Enables all HUD elements at once. Close #842 .
2019-01-07 19:23:00 +01:00
Chip Davis
6feeb4bbba
Only set 2D_ARRAY_COMPATIBLE on 3D textures that will be rendered to.
...
It is impossible to create a 2D or 2D array SRV or UAV from a 3D
texture. Nor is it possible to create a DSV from a 3D texture.
Therefore, the only time we ever need to create a 2D array view from a
3D texture is when we're going to render to it.
2019-01-02 19:15:23 +01:00
Robin
7a69135ba1
[d3d10] Check if d3d11 pointers are null
2019-01-02 19:13:42 +01:00
Robin
1750b14c2a
[d3d11] Lock in SynchronizeCsThread
...
This prevents fixes threading issues with D3D10 games when
Present() gets called.
Fixes #567 .
2018-12-30 21:08:52 +01:00
Robin
4c9af44356
[d3d10] Use context lock instead of separate device lock
2018-12-30 21:08:52 +01:00
Philip Rebohle
4e22e4bc3a
[dxgi] Refactor swap chain creation
...
Cleans up constructor and moves a bunch of common code
to the new CreateDxvkSwapChainForHwnd function, which
can be called from both d3d11 and dxgi.
Also fixes potential issues with the current implementation
of the IWineDXGISwapChainFactory interface.
2018-12-21 15:53:29 +01:00
Philip Rebohle
15078357dc
[dxgi] Implement and use GetWindowClientSize fuction
...
This new function provides a cleaner way to retrieve a
window's client size and can be used outside the swap
chain functions.
2018-12-21 15:14:07 +01:00
Philip Rebohle
1e393bf24d
[d3d11] Implement IWineDXGISwapChainFactory
...
See #822 .
2018-12-21 14:03:28 +01:00
Andrew Eikum
dc2cde3395
[vr] Cosmetic code cleanup, again
...
This reverts commit 20353f6f62f802bab9618b19940748af19cc1812, but fixes
openvr_api module refcounting.
2018-12-20 01:35:27 +01:00
Philip Rebohle
652525119f
[vr] Query required device extensions during instance creation
...
After the DXGI device refactor in c5deedef2d
,
device extensions required for OpenVR interop would not be enabled correctly
because the VR-related code is now being called from both the D3D11 and DXGI
DLLs rather than just the DXGI DLL, and the D3D11 one is not in the expected
state when querying required device extensions. Querying them during instance
creation fixes that problem as it moves the relevant code back to the same
DLL which creates the Vulkan instance.
2018-12-20 01:32:56 +01:00
Philip Rebohle
f638689b2a
[d3d11] Remove some unnecessary type casts in interop code
2018-12-19 22:34:47 +01:00
Philip Rebohle
92f3648efa
[meta] Release 0.94
2018-12-15 13:54:57 +01:00
Philip Rebohle
e5beab2872
[dxbc] Rename struct_c0 -> c0_t etc.
2018-12-14 23:45:38 +01:00
Philip Rebohle
01b8e74457
[dxbc] Use raw SSBOs for raw and structured buffers if appropriate
2018-12-14 23:45:37 +01:00
Philip Rebohle
48548eb894
[dxbc] Add useRawSsbo option
...
ENabled when we can replace texel buffers for raw and structured
buffers with raw SSBOs.
2018-12-14 23:45:37 +01:00
Philip Rebohle
fd201c4c53
[dxvk] Bind buffer slice when binding buffer view
...
This is going to be necessary when we can bind raw buffer views as SSBOs.
2018-12-14 23:45:37 +01:00
Philip Rebohle
0bc2498570
[dxvk] Relax compute shader barriers for read-only storage buffers
2018-12-14 23:45:37 +01:00
Philip Rebohle
a0de90861c
[dxvk] Store access flags in resource slots
...
Makes distinguishing read-only resources from read-write
resources significantly easier.
2018-12-14 23:45:37 +01:00
Philip Rebohle
3fff5d56b3
[d3d11] Mark raw and structured buffers as potential storage buffers
2018-12-14 23:45:37 +01:00
Philip Rebohle
0d230eb447
[spirv] Add OpArrayLength instruction
2018-12-14 23:45:34 +01:00
Philip Rebohle
328871de7e
[d3d11] Re-introduce support for dxgi.numBackBuffers option
2018-12-14 14:58:36 +01:00
Philip Rebohle
64aefcc2a1
[dxgi] Catch exception when instance creation fails
...
Fixes #810 .
2018-12-12 18:36:37 +01:00
Philip Rebohle
f276bcd0e7
[dxbc] Check for RADV/Nvidia drivers explicitly using the new function
...
This way, only RADV gets locked out of using early discard whereas
AMDVLK and -PRO are able to use it.
2018-12-12 16:27:01 +01:00
Philip Rebohle
598280dc3f
[dxvk] Add function to check for a specific driver / driver version
2018-12-12 15:43:39 +01:00
Philip Rebohle
6c992c7b02
[dxvk] Enable VK_KHR_driver_properties
2018-12-12 15:16:25 +01:00
Philip Rebohle
d16323f56b
[dxgi] Clean up DxgiAdapter
2018-12-11 16:03:37 +01:00
Philip Rebohle
a29b9f6779
[dxgi] Use new mode switch API for DxgiOutput
...
Also removes the old functions which are no longer needed.
2018-12-11 16:02:46 +01:00
Philip Rebohle
d9cf8fdc58
[dxgi] Use new mode switch API for DxgiSwapChain
2018-12-11 16:02:46 +01:00
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