Philip Rebohle
3f5f731c42
[d3d11] Move D3D11UserDefinedAnnotation member to D3D11CommonContext
...
This needs to be temlpated because we'll be moving EmitCs to the
common implementation as well, and make EmitCsChunk non-virtual.
2022-08-04 13:43:35 +02:00
Philip Rebohle
10345d0063
[d3d11] Move QueryInterface to D3D11CommonContext
2022-08-04 13:43:35 +02:00
Philip Rebohle
4af974768a
[d3d11] Refactor D3D11UserDefinedAnnotation
2022-08-04 13:43:35 +02:00
Philip Rebohle
3ead348b82
[d3d11] Move UpdateSubresource code to D3D11CommonContext
2022-08-04 13:43:35 +02:00
Philip Rebohle
e4204f76e6
[d3d11] Introduce D3D11CommonContext
2022-08-04 13:43:35 +02:00
Philip Rebohle
727fd7ac33
[d3d11] Add option to control sampler LOD bias
2022-08-01 13:15:09 +02:00
Derek Lesho
8fefb099d7
[d3d11] Add support for shared ID3D11Fence resources
2022-07-21 23:39:31 +02:00
Philip Rebohle
dcd2c4847b
[d3d11] Implement ID3D11Fence
...
No interop support just yet.
Co-authored-by: Derek Lesho <dlesho@codeweavers.com>
2022-07-21 02:15:16 +02:00
Philip Rebohle
cdf22a4086
[dxvk] Rename imageFormatInfo -> lookupFormatInfo
2022-07-15 17:25:13 +02:00
Philip Rebohle
f60bdcbcbf
[dxvk] Replace VK_EXT_shader_demote_to_helper_invocation with core feature
2022-07-14 21:21:34 +02:00
Philip Rebohle
d657a526ae
[dxvk] Replace VK_EXT_shader_viewport_index_layer with core features
...
And enable them optionally in the backend, since we use this for meta
operations.
2022-07-14 21:21:34 +02:00
Philip Rebohle
afdaba6caf
[dxvk] Replace VK_KHR_buffer_device_address with core feature
2022-07-14 21:21:34 +02:00
Philip Rebohle
0b47297b7d
[dxvk] Replace VK_EXT_host_query_reset with core feature
...
And make it a hard requirement in the backend. We no longer support
the old fallback path for queries anyway.
2022-07-14 21:21:34 +02:00
Philip Rebohle
f07ba07ad8
[dxvk] Replace VK_KHR_draw_indirect_count with core feature
...
And enable it optionally in the backend, since we provide the functionality.
2022-07-14 21:21:34 +02:00
Philip Rebohle
eee4ac1e91
[dxvk] Replace VK_KHR_sampler_mirror_clamp_to_edge with core features
...
And make it a hard requirement. We're not checking for feature support
anyway and all relevant drivers support this feature anyway.
2022-07-14 21:21:34 +02:00
Philip Rebohle
2774a04195
[dxvk] Use VkPhysicalDeviceVulkan11{Features,Properties} where appropriate
2022-07-14 21:21:34 +02:00
Joshua Ashton
e884413c49
[dxvk] Don't synchronize device if going for DLL shutdown
...
All our other threads have been destroyed and we can no longer synchronize with them properly.
Co-authored-by: Paul Gofman <pgofman@codeweavers.com>
2022-07-14 17:04:52 +02:00
Philip Rebohle
bcd2be0698
[d3d11] Fix subtle bug in constant buffer rebinding
...
Previously, if the app called SetConstantBuffers1 with a non-zero
offset and a full UBO range, and then SetConstantBuffers with the
same buffer, we would not rebind that buffer at offset zero.
2022-07-14 15:14:25 +02:00
Philip Rebohle
aef2eb14df
[dxvk] Use BindConstantBufferRange for SetConstantBuffers1 if possible
...
Reduces ref counting overhead in the few games that use this.
2022-07-14 15:14:21 +02:00
Philip Rebohle
57445227ac
[d3d11] Fix render target validation (again)
...
This behaviour is rather obscure and undocumented, but testing shows
that DSV <-> RTV mismatches are allowed under some circumstances.
Fixes #2555 .
2022-07-14 12:39:14 +02:00
Philip Rebohle
77891d71db
[d3d11] Fix unused variable warning
2022-07-12 11:39:56 +02:00
Philip Rebohle
f99a833f51
[d3d11] Remove d3d11.constantBufferRangeCheck option
2022-07-12 02:11:39 +02:00
Philip Rebohle
e8f48c71ab
[dxvk] Always enable robustBufferAccess2 feature
...
And respect the required alignments when creating buffers.
2022-07-12 02:11:32 +02:00
Philip Rebohle
00cfee9d17
[d3d11] Ignore OMSetRenderTargets calls with incompatible view sizes
...
Fixes #2701 .
2022-07-10 15:17:00 +02:00
Georg Lehmann
f2b1805d7e
[dxvk] Allow non seamless samplers.
2022-07-07 14:18:49 +01:00
Philip Rebohle
a637134c56
[d3d11,dxbc] Use push constant instead of spec constant for rasterizer sample count
2022-07-03 13:41:06 +02:00
Philip Rebohle
185331df9c
[d3d11] Don't use spec constants for video blitter
...
Store required info in the UBO instead.
2022-07-03 13:41:06 +02:00
Philip Rebohle
2e7e9eac7a
[dxvk] Require EXT_robustness2 and the null descriptor feature
2022-07-03 13:41:03 +02:00
Philip Rebohle
db07861518
[dxvk] Remove old pipeline layout implementation
2022-06-28 14:35:58 +02:00
Philip Rebohle
7e42939a4a
[d3d11] Call endFrame at the end of each frame
2022-06-28 14:35:57 +02:00
Philip Rebohle
ab0c15ea54
[dxvk] Introduce DxvkContextType
2022-06-28 14:35:57 +02:00
Philip Rebohle
cb57c2f7fb
[d3d11] Pass new binding info struct to video processor shader
2022-06-28 14:32:31 +02:00
Philip Rebohle
d05864cbcb
[d3d11] Pass shader stage for binding video processor resources
2022-06-28 14:32:30 +02:00
Philip Rebohle
a1bbc77c04
[d3d11] Pass shader stage for binding resources in context methods
2022-06-28 14:32:30 +02:00
Philip Rebohle
6ddd0cfe0a
[d3d11] Do not add UINT formats to all UAV format lists
...
Analogous to vkd3d-proton changes. Allows drivers to use compression more
frequently.
2022-04-25 17:37:10 +02:00
Philip Rebohle
a85f7c48a5
[d3d11] Make ClearUnorderedAccessViewUINT fallback more generic
2022-04-25 17:34:45 +02:00
Philip Rebohle
a731f5daae
[d3d11] Use new DxvkShader constructor for video shaders
2022-04-18 13:20:16 +02:00
Philip Rebohle
69817a84dc
[d3d11] Use new DxvkShaderCreateInfo struct to retrieve shader info
2022-04-18 13:20:16 +02:00
Philip Rebohle
e07157fe72
[d3d11] Only apply anisotropy override to linear samplers
...
Mirrors D3D9, more or less.
2022-03-30 14:37:33 +02:00
Philip Rebohle
e7e7fa231c
[dxvk] GPU query reset path
...
Require VK_EXT_host_query_reset instead. This fallback path is
untested nowadays and too slow to be useful.
2022-03-30 13:32:18 +02:00
Derek Lesho
d11f0ac77b
[d3d11] Always export correct shared handle type from ::GetSharedHandle and ::CreateSharedHandle
...
Before we just assumed that the calls here would match the corresponding flag value (D3D11_RESOURCE_MISC_SHARED -> ::GetSharedHandle, D3D11_RESOURCE_MISC_SHARED_NTHANDLE -> ::CreateSharedHandle), but it turns out that its possible to set both flags and use both methods. Now we always tell Vulkan to export a KMT handle if D3D11_RESOURCE_MISC_SHARED is present, and use openKmtHandle to get an NT handle when needed.
2022-03-28 21:38:42 +02:00
Philip Rebohle
586948df1e
[d3d11] Get strong reference to swap chain in swap chain back buffers
2022-03-22 19:48:13 +01:00
Philip Rebohle
42edb62df8
[d3d11] Use smart pointer for swap chain back buffer
2022-03-22 19:28:49 +01:00
Joshua Ashton
cf1cee04b8
[d3d11] Register annotation interfaces with D3D9
...
Some apps try use the D3DPERF_ functions for debug markers/annotations.
This utilizes the DXVK_RegisterAnnotation hidden functions to share the interfaces.
Co-authored-by: Oleg Kuznetsov <okouznetsov@nvidia.com>
2022-03-17 11:35:19 +01:00
Joshua Ashton
5d54d79865
[d3d11] Use IDXVKUserDefinedAnnotation
2022-03-17 11:35:19 +01:00
Joshua Ashton
0bc972697b
[d3d11] Fix D3D11UserDefinedAnnotation declaration
...
Mark it as final too.
2022-03-17 11:35:19 +01:00
Georg Lehmann
2550cff149
[build] Cleanup build system.
...
No changes except dropping support for msvc before 15.3.
2022-03-17 01:38:58 +00:00
Philip Rebohle
c87660480d
[d3d11] Reimplement R11G11B10 UAV clears without R32 views
2022-03-12 16:23:42 +01:00
Philip Rebohle
ee28f145dc
[d3d11] Explicitly handle R32-compatible UAV formats
2022-03-12 16:23:39 +01:00
Derek Lesho
48046e009c
[d3d11] Add support for shared ID3D11Texture2D resources.
2022-03-12 16:23:06 +01:00
Derek Lesho
02d3e0d31f
[dxvk] Add shared handle access to DxvkImage memory.
...
Based off preliminary work from Josh.
2022-03-12 16:23:06 +01:00
Joshua Ashton
63bd41f785
[d3d11] Add fallthrough comment to PickFormats
...
Silences a warning
2022-03-10 00:47:38 +01:00
Philip Rebohle
2bceeff5f2
[d3d11] Replace apitrace mode option with something more granular
...
And enable it only for vertex and index buffers in Nier Replicant.
2022-02-28 22:44:10 +01:00
Philip Rebohle
dbd4dad095
[d3d11] Introduce d3d11.maxDynamicImageBufferSize option
2022-02-22 05:31:27 +01:00
Philip Rebohle
33cf522647
[d3d11] Use appropriate memory types for directly mapped images
2022-02-22 05:31:20 +01:00
Philip Rebohle
177e70949c
[d3d11] Apply apitrace mode to image upload buffers
2022-02-22 01:30:43 +01:00
Philip Rebohle
8e11630370
[d3d11] Set zero stride when binding null vertex buffer
2022-02-19 13:20:36 +01:00
Philip Rebohle
17a1b0ad44
[d3d11] Consider empty CS chunks when tracking resources
...
Avoids deadlocks if we track multiple resources and flush in between.
2022-02-18 14:21:53 +01:00
Philip Rebohle
18a960a1e1
[d3d11] Use initBuffer method
2022-02-17 20:58:31 +01:00
Philip Rebohle
6d0e5dfd21
[d3d11] Use initImage to clear uninitialized image resources
2022-02-17 20:58:31 +01:00
Philip Rebohle
34fd16b8f2
[d3d11] Add implicit flush after tracking sequence numbers
...
Flushing early when using a tracked resource may reduce stalls.
2022-02-16 20:49:00 +01:00
Philip Rebohle
2dfdc5ac3b
[d3d11] Enable stall tracking for timestamp queries
...
Because games are dumb and don't understand that the GPU doesn't
work synchronously with the render thread.
2022-02-16 19:59:11 +01:00
Philip Rebohle
d45f5a8d79
[d3d11] Handle subresource field in copy/move operations
...
Derp.
2022-02-15 13:00:10 +01:00
Philip Rebohle
e1b3bc45ce
[d3d11] Add d3d11.maxImplicitDiscardSize option
2022-02-14 04:17:56 +01:00
Philip Rebohle
2f80f8847e
[d3d11] Use new waitForResource method
2022-02-14 03:15:47 +01:00
Philip Rebohle
80c5b61e26
[d3d11] Use DxvkStagingBuffer in D3D11DeviceContext
2022-02-13 02:08:19 +01:00
Philip Rebohle
26381fd5df
[d3d11] Only use updateBuffer for very small buffer updates
...
Otherwise we may end up with significant copy overhead on the CS thread.
2022-02-13 02:08:19 +01:00
Philip Rebohle
d96c5a1076
[dxvk] Store DXVK device inside DxvkCsThread object
2022-02-13 02:07:48 +01:00
Philip Rebohle
b6121c84aa
[d3d11] Avoid GPU synchronization on mapping images when possible
2022-02-11 18:17:35 +01:00
Philip Rebohle
3f16de157b
[d3d11] Avoid GPU synchronization on mapping buffers when possible
2022-02-11 18:17:35 +01:00
Philip Rebohle
c82b504e52
[d3d11] Further simplify D3D11DeferredContextMapEntry
...
And no longer create a strong reference to the given resource.
2022-02-11 18:17:35 +01:00
Philip Rebohle
2dcdd20517
[d3d11] Change D3D11ResourceRef constructor to be more useful
2022-02-11 18:17:35 +01:00
Philip Rebohle
0364a79eb0
[d3d11] Optimize Unmap on immediate contexts
2022-02-11 18:17:35 +01:00
Philip Rebohle
5a6711ed1d
[d3d11] Synchronize only to given sequence number in WaitForResources
...
Avoids costly thread synchronization when mapping staging resources
for reading, as well as some other scenarios.
2022-02-11 18:17:35 +01:00
Philip Rebohle
afe1840c74
[d3d11] Track resources when dispatching Cubin shaders as well
2022-02-11 18:17:35 +01:00
Philip Rebohle
bb16734a43
[d3d11] Implement sequence number tracking on deferred contexts
2022-02-11 18:17:35 +01:00
Philip Rebohle
2eeb7295c8
[d3d11] Increment sequence number when submitting command lists
...
This does not do any tracking on deferred contexts just yet.
2022-02-11 18:17:35 +01:00
Philip Rebohle
d33dac569c
[d3d11] Track last staging resource usage with a sequence number
2022-02-11 18:17:35 +01:00
Philip Rebohle
55a6b80919
[d3d11] Add method to query D3D11 resource dimension from texture
2022-02-11 18:17:35 +01:00
Philip Rebohle
d870b6ff38
[d3d11] Store ID3D11Resource interface in D3D11CommonTexture
...
Going full circle here, but it's actually useful now.
2022-02-11 18:17:35 +01:00
Philip Rebohle
9c32beccdc
[d3d11] Store buffer map mode in D3D11Buffer
...
Matches what we do for textures, and makes it so that we don't
have to dereference the resource pointer to figure this out.
2022-02-11 18:17:35 +01:00
Philip Rebohle
2db56fa160
[d3d11] Add D3D11ResourceRef
...
Implements private ref counting for arbitrary resource types.
2022-02-11 18:17:35 +01:00
Philip Rebohle
391c9e13ca
[d3d11] Add ResourceAddRef/ReleasePrivate with known resource type
2022-02-11 18:17:35 +01:00
Philip Rebohle
37f3d9208b
[dxvk] Introduce sequence numbers for CS submissions
2022-02-11 18:17:34 +01:00
Philip Rebohle
6c862b63a2
[d3d11] Optimize UpdateSubresource for small buffer updates
...
Some games use UpdateSubresource to upload constant buffers in
between draws, so this path should be as fast as possible.
Also fixes a potential issue when using D3D11_COPY_NO_OVERWRITE
on deferred contexts, since the Map requirements don't hold here.
2022-02-07 16:14:02 +01:00
Philip Rebohle
b746e1352b
[d3d11] Implement suballocation from staging buffer for small updates
2022-02-07 16:14:01 +01:00
Philip Rebohle
7cf78a2c75
[d3d11] Fix confusing code in deferred context Map
...
This did work, but we shouldn't use an object that was already moved.
2022-02-07 16:14:01 +01:00
Philip Rebohle
e4dbd1e337
[d3d11] Remove unused parameters from deferred context Map functions
2022-02-07 16:13:58 +01:00
Krzysztof Bogacki
b5d7b42e65
[d3d11] Add D3D11On12CreateDevice stub
2022-02-07 03:21:43 +01:00
Robin Kertels
5b39f0307e
[d3d11] Add FL12+ enum names
2022-01-27 19:42:14 +01:00
Joshua Ashton
ecd7b67069
[d3d11] Lock context before EmitCs for annotations
2021-12-21 03:09:08 +01:00
Philip Rebohle
1abd205216
[d3d11] Compute image data layout for unmapped textures
...
We sometimes need this information when uploading image data. Fixes #2380 .
2021-11-29 16:55:35 +01:00
Joshua Ashton
409a6f5c3f
[d3d11] Use atomics for NVX handles
...
Primarily to make DXVK native happy, but also much cleaner.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-22 03:15:03 +02:00
Philip Rebohle
b36fa75d1d
[dxvk] Disable CUDA interop extensions on 32-bit builds
2021-10-01 15:32:40 +02:00
Philip Rebohle
7193962381
[d3d11] Enable VK_KHR_buffer_device_address if necessary
...
Just enabling the extension doesn't necessarily do anything.
2021-10-01 14:12:17 +02:00
Robin Kertels
2735988fa2
[d3d11] Only use cube arrays for regular cubemap views when enabled
2021-09-26 23:17:16 +02:00
Adam Moss
86148ec070
[d3d11,dxvk] Implement DXVK pieces required for DX11 DLSS support
...
Notably, fairly generic functions to create/launch/destroy Cuda kernels,
and methods to fetch GPU virtual addresses and handles for DX11 resources.
Note: Requires some corresponding dxvk-nvapi changes for DLSS to
be initialized successfully.
2021-09-24 15:10:07 +02:00
Philip Rebohle
dd7ffbc803
[d3d11] Also validate draw buffer for DispatchIndirect
...
Oversight.
2021-09-12 16:18:25 +02:00
Philip Rebohle
de7fb51e64
[d3d11] Validate indirect draw buffer size
...
Otherwise, if the draw parameter offset is out of bounds, we
may hang the GPU.
Fixes #2286 .
2021-09-12 01:23:04 +02:00
Philip Rebohle
67391a7bb0
[d3d11] Introduce d3d11.ignoreGraphicsBarriers option
2021-09-09 14:28:25 +02:00