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

1193 Commits

Author SHA1 Message Date
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
Philip Rebohle
3acdf6e22a
[d3d11] Perform bound-checking in GetBufferSlice
Ensures that we don't pass invalid buffer slices to the backend.
2021-03-04 17:37:13 +01:00