Commit Graph

1394 Commits

Author SHA1 Message Date
Philip Rebohle a3ed84c0c1
[d3d11] Move remaining D3D11DeviceContext members to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle b20bfe763e
[d3d11] Move D3D10Multithread instance to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 9a2d8878ef
[d3d11] Move Track*SequenceNumber methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 532b3a6add
[d3d11] Move EmitCs and related methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle e0ea272c0d
[d3d11] Move misc methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 9e916edef9
[d3d11] Move Draw* and Dispatch* methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 1d87af062c
[d3d11] Move ResolveSubresource to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 17c318864e
[d3d11] Move Apply* methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 7c82ed35b2
[d3d11] Move internal resource update methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 956bad5e84
[d3d11] Move GenerateMips to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 751d7467df
[d3d11] Move Clear* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 50942cd2d9
[d3d11] Move Copy* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 163af1309d
[d3d11] Move SetPredication to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle b8b5662461
[d3d11] Move Discard* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle efea51c254
[d3d11] Move SO* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 4d498851a8
[d3d11] Move RS* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 1ef9d5389b
[d3d11] Move ClearState and RestoreState to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle f664e87749
[d3d11] Move CSSetUnorderedAccessViews to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 159eed825f
[d3d11] Move *SetSamplers methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 3af5b3ba7b
[d3d11] Move *SetShaderResources methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle bfaa21dccc
[d3d11] Move *SetConstantBuffers methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 26ac57f688
[d3d11] Move *SetShader methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle e0ee06a279
[d3d11] Move IA* functions to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 77c032da5c
[d3d11] Move OM* functions to D3D11CommonContext
We can get rid of the immediate context overload as well
since we can just directly call FlushImplicit here.
2022-08-04 13:43:35 +02:00
Philip Rebohle 5a45677a39
[d3d11] Add hazard tracking methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 43661abbfc
[d3d11] Add binding methods to D3D11CommonContext
Uses mutable lambdas to avoid redundant ref counting on immediate contexts.
2022-08-04 13:43:35 +02:00
Philip Rebohle a7c25a01f2
[d3d11] Move D3D11DeviceContextExt to D3D11CommonContext
Will be needed for both EmitCs and TrackSequenceNumber functions.
2022-08-04 13:43:35 +02:00
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
Georg Lehmann b13260c689 [d3d11] Use BitMask helper 2021-08-16 08:49:46 -07:00
Philip Rebohle 56395c9bc8
[d3d11] Re-implement frame latency events using Win32 semaphore
Matches native DXGI behaviour more accurately, and fixes a hang in
Shin Megami Tensei 3.
2021-08-05 22:57:58 +02:00
Philip Rebohle 4c222ec557
[d3d11] Use callback fence to signal Flush1 event 2021-08-05 22:57:58 +02:00
Philip Rebohle 11bbc07ea1
[dxvk] Support destination pitch in packImageData 2021-07-19 16:54:56 +02:00
Philip Rebohle e23792ef91
[d3d11] Fix handling sRGB UAV images 2021-07-07 16:00:12 +02:00
Connor Abbott aae0e57a46
Don't add def file as an object
This is unnecessary even on mingw, and leads to duplicating the .def
file on the linking command line which winegcc complains about.
2021-07-03 14:28:28 +02:00
Connor Abbott b9135ca0cd
Do not try to load libraries natively under __WINE__
This was only half-implemented (e.g. OpenXR was still calling
GetModuleHandle), broke compilation with Vulkan due to mismatched ABI,
and wouldn't have worked anyways with winelib builds because we still
need access to wine's implementation of the Vulkan win32 winsys
integration. Perhaps this is still useful for dxvk-native but if so it
should be re-added under a DXVK_NATIVE flag.
2021-07-03 14:28:28 +02:00
Philip Rebohle 3b857d93b5
[d3d11] Add d3d11.disableMsaa option to disable multisampling
Aims to be mostly transparent to the application, although breakage
can still happen if shaders query the sample count and do not handle
a sample count of 1.
2021-07-02 05:52:05 +02:00
Paul Gofman 8b6ac527b4 [d3d11] Initialize buffer flags in D3D11UnorderedAccessView::GetDescFromResource(). 2021-07-01 15:20:07 +02:00
Philip Rebohle cd8a2bcfcd [dxvk] Use custom sync primitives 2021-06-29 00:51:20 +02:00
Philip Rebohle 08a6b42458
[d3d11] Fix box validation in CopySubresourceRegion1 2021-06-24 21:07:48 +02:00
Philip Rebohle 9f80d9f8b2
[d3d11] Remove functions to update mapped buffers
No longer relevant since staging images will no longer be backed
by actual Vulkan images and dynamic images are not GPU-writable.
2021-06-24 21:07:48 +02:00
Philip Rebohle 7d76262c52
[d3d11] Use D3D11_COMMON_TEXTURE_MAP_MODE_STAGING if possible 2021-06-24 21:07:48 +02:00
Philip Rebohle 450c42444f
[d3d11] Use UpdateImage in D3D11DeferredContext::MapImage 2021-06-24 21:07:48 +02:00
Philip Rebohle fd66f44561
[d3d11] Use UpdateImage in D3D11ImmediateContext::UnmapImage 2021-06-24 21:07:48 +02:00
Philip Rebohle 6ba1746d46
[d3d11] Introduce UpdateImage 2021-06-24 21:07:48 +02:00
Philip Rebohle 5e4ed2d929
[d3d11] Introduce CopyImage 2021-06-24 21:07:48 +02:00
Philip Rebohle cd17301236
[d3d11] Introduce CopyBuffer
Generalizes some copy code.
2021-06-24 21:07:48 +02:00
Philip Rebohle 1a6f4456d8
[d3d11] Introduce ComputeMappedOffset for image resources
Modifies GetSubresourceLayout slightly in case only a partial aspect
mask is being passed to the function. This way we can conveniently
compute the offset of a given pixel within the mapped buffer of an
image subresource.
2021-06-24 21:07:48 +02:00
Philip Rebohle 7c0ee272c3
[d3d11] Add texel buffer usage to staging buffer
Needed for staging image updates.
2021-06-24 21:07:48 +02:00
Philip Rebohle 7160b85924
[d3d11] Add texel buffer usage flags to mapped subresource buffers 2021-06-24 21:07:48 +02:00
Philip Rebohle 731e88b196
[d3d11] Handle MAP_MODE_STAGING in initializer
Otherwise, we'll crash if no real image is present.
2021-06-24 21:07:48 +02:00
Philip Rebohle 596f65f75f
[d3d11] Handle MAP_MODE_STAGING when mapping images on the immediate context 2021-06-24 21:07:48 +02:00
Philip Rebohle 9e15831a2d
[d3d11] Store packed format info in D3D11CommonTexture 2021-06-24 21:07:48 +02:00
Philip Rebohle f155b8a8b9
[d3d11] Introduce DiscardSlice and GetMappedSlice for image resources
These do the same as they do for buffer resources, but for a mapped
image subresource instead.
2021-06-24 21:07:48 +02:00
Philip Rebohle 11aa2a703a
[d3d11] Introduce D3D11_COMMON_TEXTURE_MAP_MODE_STAGING
This map mode can be used when no Vulkan image is needed to back a
staging resource, which can save a significant amount of memory.
2021-06-24 21:07:48 +02:00
Philip Rebohle b384f5372e
[d3d11] Zero-initialize mapped buffers for images correctly 2021-06-24 21:07:48 +02:00
Philip Rebohle f50c5234dc
[dxvk] Add source offset/extent to copyPackedBufferToDepthStencilImage 2021-06-24 21:07:48 +02:00
Philip Rebohle a14884c652
[dxvk] Add destination offset/extent to copyDepthStencilImageToPackedBuffer
Needed to support partial copies between buffers and depth-stencil images.
2021-06-24 21:07:47 +02:00
Philip Rebohle ba4938e201
[dxvk] Add slice alignment to copyImageToBuffer 2021-06-24 21:07:47 +02:00
Philip Rebohle 4840cdaf8c
[dxvk] Add slice alignment to copyBufferToImage 2021-06-24 21:07:45 +02:00
Georg Lehmann 6b8ab4fd38 [d3d11] Remove mingw-w64 < 6 workarounds 2021-06-15 20:41:34 +02:00
Philip Rebohle e281eee795 [dxgi] Add NotifyModeChange method to IDXGIVkSwapChain 2021-06-12 13:50:08 +02:00
Philip Rebohle 8b67ef724e [d3d11] Add frame rate limiter and dxgi.maxFrameRate option 2021-06-12 13:50:08 +02:00
Joshua Ashton e64a8ee61a [d3d11] Bump frame id before presentation 2021-06-01 18:31:29 +02:00
Joshua Ashton f98a45b305 [d3d11] Sync frame latency after presentation 2021-06-01 18:16:35 +02:00
Philip Rebohle 0b88d0deab
[vulkan] Remove getSyncSemaphores from presenter
Instead, return the semaphores in acquireNextImage.
2021-06-01 04:32:50 +02:00
Philip Rebohle 253884a8c7
[vulkan] Remove fence from presenter
We don't use these anywhere.
2021-06-01 03:51:16 +02:00
Philip Rebohle 383cde2051
[d3d11] Allow creation of render target views for planar images 2021-05-30 19:42:44 +02:00
Philip Rebohle 01051bac99
[d3d11] Allow creation of unordered access views for planar images 2021-05-30 19:42:44 +02:00
Philip Rebohle 6d72bc94f4
[d3d11] Allow creation of shader resource views for planar images 2021-05-30 19:42:44 +02:00
Philip Rebohle 2740030fca
[d3d11] Support video processor output views in ClearView 2021-05-30 19:42:44 +02:00
Philip Rebohle b04721f9a2
[d3d11] Use staging buffer for MapImage on deferred contexts 2021-05-30 19:42:44 +02:00
Philip Rebohle ff9d6e3226
[d3d11] Use staging buffer and copyBufferToImage for UpdateSubresource
Reduces number of copies and also fixes problems with multi-plane formats.
2021-05-30 19:42:44 +02:00
Philip Rebohle e749a4a4ac
[d3d11] Create shadow copy of video input images if sampled bit is not set
This can happen with RGB input views since not having any bind flags set
is legal for video input views, and SHADER_RESOURCE is actually explicitly
disallowed, but we don't always want to set sampled bit for those resources.
2021-05-30 19:42:44 +02:00
Philip Rebohle 3c22f4066b
[d3d11] Lock context in video context entry points 2021-05-30 19:42:44 +02:00
Philip Rebohle 25607a0692
[d3d11] Report video processor capabilities for image formats 2021-05-30 19:42:44 +02:00
Philip Rebohle 6d9da5a8d7
[d3d11] Don't use MAP_MODE_DIRECT for multi-plane images 2021-05-30 19:42:44 +02:00
Philip Rebohle 01236fbd84
[d3d11] Use correct method to clear multi-plane images 2021-05-30 19:42:44 +02:00
Philip Rebohle ee30acf120
[d3d11] Use new packImageData for initializing mapped image buffers 2021-05-30 19:42:44 +02:00
Philip Rebohle 7184b75f8f
[d3d11] Use GetSubresourceLayout for image maps on the immediate context 2021-05-30 19:42:44 +02:00
Philip Rebohle 1b296f8338
[d3d11] Introduce GetSubresourceLayout 2021-05-30 19:42:44 +02:00
Philip Rebohle e87aa08fd2
[d3d11] Implement basic video processor blitting 2021-05-30 19:42:43 +02:00
Philip Rebohle 969ac59667
[d3d11] Add ID3D11VideoContext stub 2021-05-30 19:42:43 +02:00
Philip Rebohle 1df26a3605
[d3d11] Implement video processor views 2021-05-30 19:42:43 +02:00
Philip Rebohle 09cf2cd11e
[d3d11] Add ID3D11VideoProcessor stub 2021-05-30 19:42:43 +02:00
Philip Rebohle bdb7eef874
[d3d11] Add ID3D11VideoProcessorEnumerator stub 2021-05-30 19:42:43 +02:00
Philip Rebohle 1eaf2545c3
[d3d11] Add ID3D11VideoDevice stub 2021-05-30 19:42:43 +02:00
Philip Rebohle e988895e51
[d3d11] Set mutable and extended usage bits for multi-plane images 2021-05-30 19:42:43 +02:00
Philip Rebohle 6462174c13
[dxvk] Support multi-plane formats in copyImageToBuffer 2021-05-30 19:42:43 +02:00
Philip Rebohle 86542248df
[dxvk] Support multi-plane formats in copyBufferToImage 2021-05-30 19:42:43 +02:00
Philip Rebohle cb7adeef08
[d3d11] Add range checking to GetShaderResources 2021-04-22 12:56:11 +02:00
Philip Rebohle 65655ce37c
[d3d11] Add range checking to GetSamplers 2021-04-22 12:56:11 +02:00
Philip Rebohle ef9ad29b7f
[d3d11] Add range checking to GetConstantBuffers 2021-04-22 12:56:11 +02:00
Philip Rebohle 2d9c229eaa
[d3d11] Add range checking to SOGetTargets 2021-04-22 12:56:11 +02:00
Philip Rebohle 11a02831a9
[d3d11] Add range checking to UAV and render target methods 2021-04-22 12:56:11 +02:00
Philip Rebohle b51fd4d06c
[d3d11] Add range checking to IAGetVertexBuffers 2021-04-22 12:56:11 +02:00
Philip Rebohle a13dad07cc
[d3d11] Add some missing STDMETHODCALLTYPE declarations 2021-04-22 12:56:11 +02:00
Liam Middlebrook fb0b11903b [d3d11] Implement D3D11UserDefinedAnnotation
Reviewed-by: Oleg Kuznetsov <okouznetsov@nvidia.com>
2021-04-08 14:25:02 +02:00
Philip Rebohle c3feea2bce [dxvk] Make samplerAnisotropy feature optional 2021-04-04 20:01:30 +01:00
Philip Rebohle 0a787683b6 [dxvk] Don't require shaderStorageImageExtendedFormats
No real reason to, not sure why we did this in the first place.
2021-04-04 20:01:30 +01:00
Philip Rebohle 2f553b5b16
[d3d11] Implement conservative rasterization
Needed for Nvidia ShadowLibs in Final Fantasy XV.
2021-03-13 20:22:32 +01:00
Philip Rebohle e3b92bcfac
[dxvk] Add conservative rasterization mode to rasterizer state 2021-03-13 20:22:32 +01:00