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

670 Commits

Author SHA1 Message Date
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
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
b884c56631
[dxvk] Enable VK_EXT_memory_priority and features if available 2019-01-30 13:52:43 +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
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
Andrew Eikum
9ad24a2216 [d3d11] In D3D11CreateDevice, create DXGI factory with IDXGIFactory1 support (#878) 2019-01-22 10:57:05 +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
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
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
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
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
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
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
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
214891ffc6
[d3d11] Improve error logging when texture creation fails 2019-01-08 10:34:48 +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
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
1e393bf24d [d3d11] Implement IWineDXGISwapChainFactory
See #822.
2018-12-21 14:03:28 +01:00
Philip Rebohle
f638689b2a
[d3d11] Remove some unnecessary type casts in interop code 2018-12-19 22:34:47 +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
328871de7e
[d3d11] Re-introduce support for dxgi.numBackBuffers option 2018-12-14 14:58:36 +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
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
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
cc7f5c4bb1
[d3d11] Duplicate format table into D3D11 device
Removes the direct D3D11Device->DXGIAdapter dependency.
2018-11-28 18:34:05 +01:00
Philip Rebohle
9139fbf95d
[d3d11] Use new Vulkan presenter 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
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
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
a75c596132
[d3d11] Add config option to enable TGSM initialization 2018-11-23 16:12:02 +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
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
0b7e114cb0
[dxgi] Implement IDXGIDevice3 2018-11-15 17:08:36 +01:00