1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-05 02:52:11 +01:00

1550 Commits

Author SHA1 Message Date
Philip Rebohle
c92ee8ee07 [dxvk,d3d11] Refactor uploadBuffer to consume a staging buffer 2024-10-08 17:46:18 +02:00
Philip Rebohle
c27cae2f10 [d3d11] Improve per-context staging buffer handling
In D3D11, the staging buffer is only used for UpdateSubresource, which
isn't always used much. Reducing the size and freeing the buffer after
every submission avoids situations where system memory chunks are kept
alive by a single unused 4MB allocation.
2024-10-08 17:46:18 +02:00
Philip Rebohle
c614e537a9 [dxvk] Remove alignment parameter from staging buffers
Just align all suballocations to 256 bytes as usual.
2024-10-08 17:46:18 +02:00
Philip Rebohle
813524c146 [d3d11] Remove texel buffer path for ClearUAV
Instead, recreate the image with the given view format as
necessary. Most of the time we will not actually need this.
2024-10-06 08:47:42 +02:00
Philip Rebohle
329d9a0bb2 [dxvk] Add support for drawing a software cursor 2024-10-04 19:10:14 +02:00
Philip Rebohle
a278d6bf1d [d3d11] Implement sequential swap effects 2024-10-04 12:58:55 +02:00
Philip Rebohle
172d3450d1 [d3d11] Rename EmitCsChunkExternal for consistency 2024-10-04 12:58:55 +02:00
Philip Rebohle
c678e8c803 [d3d11] Remove additional swap chain context
Do everything on the main context instead. Also only
present once regardless of sync interval.
2024-10-04 12:58:55 +02:00
Philip Rebohle
129efdaba6 [d3d11] Do not use separate context to initialize back buffers 2024-10-04 12:58:55 +02:00
Philip Rebohle
63b200f08d [dxvk] Reimplement HUD rendering to use Vulkan directly
And change how rendering works in general so that we emit fewer
draw calls.
2024-10-04 12:58:55 +02:00
Philip Rebohle
b35c0bce4f [dxvk] Always enable multiDrawIndirect and shaderDrawParameters features 2024-10-04 12:58:55 +02:00
Philip Rebohle
207e15eb24 [dxvk] Refactor swap chain blitter to use plain Vulkan
Temporarily disable the HUD until that is refactored too.
2024-10-04 12:58:55 +02:00
Philip Rebohle
1443e22626 [d3d11] Fix derp with anisotropy option
Fixes #4313.
2024-10-02 11:02:06 +02:00
Philip Rebohle
e83446f5c9 [d3d11] Fix remaining synchronization issues with CUDA interop 2024-09-30 10:29:27 +02:00
Philip Rebohle
c26c21edb4 [d3d11] Lock buffers in place when used with CUDA interop 2024-09-30 10:29:27 +02:00
Philip Rebohle
9f0bd8e17f [d3d11] Lock textures in place when used with CUDA interop
Prevents images from being relocated by the backend.
2024-09-30 10:29:27 +02:00
Philip Rebohle
438a08f87c [d3d11] Add functions to emit externally generated CS chunks 2024-09-30 10:29:27 +02:00
Philip Rebohle
5f3fa9e423 [d3d11] Do not proactively enable meta copy usage flags
Instead, let the backend deal with this and recreate the image as necessary.
2024-09-30 10:29:27 +02:00
Philip Rebohle
4635397bb1 [dxvk] Implement sampler pool
Deduplicates redundant sampler objects and makes sampler creation
as well as lifetime tracking a bit more efficient.
2024-09-28 20:21:06 +02:00
Philip Rebohle
b4e69dce76 [dxvk] Remove DxvkImageViewCreateInfo 2024-09-28 01:50:23 +02:00
Philip Rebohle
8195bea63e [dxvk] Remove DxvkBufferViewCreateInfo
Use the new key struct directly to avoid unnecessary struct conversion.
2024-09-28 01:21:07 +02:00
Philip Rebohle
b0d0959329 [dxvk] Remove DxvkDataBuffer
Unused.
2024-09-28 01:06:57 +02:00
Philip Rebohle
1cefe90ce7 [d3d11] Don't use data buffer for small buffer updates
Embed an array instead and lower the size threshold.
2024-09-28 01:05:40 +02:00
Philip Rebohle
01a7457a6f [dxvk] Remove createImageView function
Use the image's method instead, like we already do for buffers.
2024-09-28 00:03:56 +02:00
Philip Rebohle
5e5c283149 [d3d11] Always use fast MAP_WRITE_DISCARD path on deferred contexts
... but keep the SingleUse option as-is anyway because games do not release
their command lists after submission and end up wasting massive amounts of
memory.
2024-09-26 17:37:50 +02:00
Philip Rebohle
39f50999a3 [d3d11] Cache raw mapped pointer rather than allocation object
Reduces ref counting overhead again and matches previous behaviour.

We should probably do something about the possible case of deferred context
execution with MAP_WRITE_DISCARD followed by MAP_WRITE_NO_OVERWRITE on the
immediate context, but we haven't seen a game rely on this yet.
2024-09-26 17:37:50 +02:00
Philip Rebohle
25076d9220 [dxvk] Rework image view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
713b76bea5 [dxvk] Rework image creation
Uses DxvkResourceAllocation to manage image backing storage,
which will allow invalidating images in the future.
2024-09-26 17:37:50 +02:00
Philip Rebohle
9a51849920 [d3d11] Use allocation cache for dynamic buffers 2024-09-26 17:37:50 +02:00
Philip Rebohle
088ba404a6 [dxvk] Rework buffer view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
1fd3c8040d [dxvk] Remove DxvkBufferAllocation 2024-09-26 17:37:50 +02:00
Philip Rebohle
8e45a60542 [d3d11] Use DxvkBufferAllocation where appropriate 2024-09-26 17:37:50 +02:00
Philip Rebohle
15365f2d82 [d3d11] Synchronize shared texture initialization 2024-09-26 08:21:43 +02:00
Philip Rebohle
c8410e578e [d3d11] Enable device address usage for non-mappable buffers
NVAPI queries the GPU address of certain resources in a way that could
break otherwise.
2024-09-18 15:55:57 +02:00
Philip Rebohle
ddb59ae394 [dxvk] Add usage property to buffer views
And pass it to the Vulkan driver depending on maintenance5 support.
2024-09-18 15:55:57 +02:00
llyyr
1a1c3a4202 [d3d9,d3d11] recreate swapchain on VK_SUBOPTIMAL_KHR
The vulkan wayland wsi returns suboptimal when the window is
fullscreened and not directly scanned out, and there are modifiers
available that would allow the window to be directly scanned out.
Recreate the swapchain if we receive suboptimal result.

This allows us recreate the swapchain to use a modifier that allows
direct scan-out under winewayland on wayland compositors.
2024-09-11 16:38:26 +02:00
Philip Rebohle
427e706a40 [util,d3d11] Be more robust against use-after-free
Sims 4 binds an SRV after destroying it, so we need to ensure our internal
view pointers are null or we'll create a problem otherwise.
2024-09-02 22:03:26 +02:00
Philip Rebohle
04d558cf2e [util] Make frame rate limiter enablement heuristic more robust
Allow for more buffering to happen in order to not enable the limiter
too eagerly.
2024-09-02 17:50:47 +02:00
Robin Kertels
e4fd9ff16b [d3d11] Always keep barrier control options set by app profile 2024-08-26 23:15:32 +02:00
Philip Rebohle
1c30bc92bb [d3d11] Validate viewport parameters
And skip invalid calls. Fixes Senran Kagura Peach Ball.
2024-08-23 14:39:56 +02:00
Philip Rebohle
60e04503a6 [d3d11] Enable longMad/longDot behaviour by default
And remove the respective config options.
2024-08-14 22:15:50 +02:00
Philip Rebohle
4ee907a6df [dxbc,d3d11] Add option to explicitly emit long dot products 2024-08-11 18:30:59 +02:00
Philip Rebohle
1c198dcd48 [dxgi] Limit frame rate to display refresh as necessary 2024-06-11 15:45:17 +02:00
Danylo Piliaiev
58d8ea2d31 [d3d11,d3d9,util] Add a config option for reproducible VK output
It ensures that for the same D3D commands the output VK commands
don't change between runs.

Useful for comparative benchmarking, can negatively affect performance.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
2024-05-23 15:20:28 +02:00
Simon McVittie
2ff2c826a5 [build] Generate pkg-config metadata to link to DXVK libraries
This allows dependent projects to query the version and location of DXVK
via the pkg-config interface.

The include directories aren't yet set, because the headers aren't
installed; that will follow in a subsequent commit.

The naming of these pkg-config files is based on proposed Fedora packages
for DXVK 2.0, and is not compatible with older Fedora packages for DXVK
1.x (which used the naming convention dxvk-native-d3d9 and so on).
Packagers can create symlinks such as dxvk-native-d3d9.pc -> dxvk-d3d9.pc
if they want to retain compatibility with older names.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-21 19:18:12 +00:00
Simon McVittie
83436a97f2 [meson] Set the stem of library names instead of the name_prefix
This is necessary for compatibility with Meson's pkg module, which
generates pkg-config metadata containing "-lNAME" where NAME is the
first argument to shared_library(). Changing the name_prefix parameter
would break that.

Conversely, including .dll or .so in the first parameter would also
break that, so remove the `+dll_ext` part (in practice this is not a
functional change, because `dll_ext` is always set to an empty string).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-21 19:18:12 +00:00
Ethan Lee
f33453afbb [build] Add soversion to dxvk-native binaries 2024-05-21 19:18:12 +00:00
Philip Rebohle
ab715a8876 [d3d11] Implement better filtering when blitting video content
Unlike linear filtering this guarantees that we never read outside the source
region, and this also lets us perform color space conversion prior to filtering.
2024-05-03 16:23:17 +02:00
Rémi Bernon
4333ee872d [d3d11] Use nearest filter for ID3D11VideoContext scaling 2024-05-02 18:17:54 +02:00
Rémi Bernon
b99d42c688 [d3d11] Implement VideoProcessorSetStreamSourceRect scaling 2024-05-02 18:17:54 +02:00