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

5719 Commits

Author SHA1 Message Date
Philip Rebohle
3a4dadb528 [dxvk] Add chunk concept to page allocator
This allows the allocator to operate on the entire allocated memory pool.
2024-09-26 13:13:48 +02:00
Philip Rebohle
266b99ad8d [hud] Add HUD item to visualize memory chunk allocation 2024-09-26 13:13:48 +02:00
Philip Rebohle
f679d7d90f [dxvk] Add detailed allocation statistics 2024-09-26 13:13:48 +02:00
Philip Rebohle
b46ef2ceff [dxvk] Move memory statistics from memory types to heaps 2024-09-26 13:13:48 +02:00
Philip Rebohle
35fea6475d [dxvk] Tune small buffer allocation sizes
The pool allocator works on powers of two, so buffers should too.
2024-09-26 13:13:48 +02:00
Philip Rebohle
3faa1a76da [dxvk] Simplify memory chunk allocation
Reduces overall waste of memory by reusing already allocated
chunks more aggressively.
2024-09-26 13:13:48 +02:00
Philip Rebohle
661385584a [dxvk] Use new allocators for chunk suballocation 2024-09-26 13:13:48 +02:00
Philip Rebohle
5efaa06c61 [dxvk] Add new page allocator implementation 2024-09-26 13:13:48 +02:00
Philip Rebohle
1eec969448 [util] Add 64-bit lzcnt 2024-09-26 13:13:48 +02:00
Philip Rebohle
15365f2d82 [d3d11] Synchronize shared texture initialization 2024-09-26 08:21:43 +02:00
WinterSnowfall
97091aad39 [util] Enable legacy DISCARD for Rayman 3 2024-09-26 06:48:13 +02:00
WinterSnowfall
a7b3b1e3a4 [d3d8] Add an option to respect DISCARD only for dynamic write-only buffers 2024-09-26 06:48:13 +02:00
WinterSnowfall
4fad20d77c [d3d8] Relax viewport validation in windowed mode 2024-09-25 20:46:48 +02:00
琴梨梨OvO
bb6d1b3b4c [util]Add support for Time Leap Paradise 2024-09-25 19:54:24 +02:00
Robin Kertels
f5ca3cf5df [d3d9] ResolveZ: Only copy aspects that both images support 2024-09-25 00:32:13 +01:00
Robin Kertels
d7c2e3ac76 [d3d9] Use correct aspect mask when blitting depth stencil textures
We don't want to blit stencil when the D3D9 format doesn't have
stencil.
2024-09-25 00:32:13 +01:00
Robin Kertels
ca3aa2014b [d3d9] Improve comment about synchronization with ProcessVertices 2024-09-22 22:53:55 +02:00
Robin Kertels
1d49f247ac [d3d9] Remove incorrect early-exit
The same texture could be bound to
multiple slots and if the shader doesn't
use the lower index texture, we'd never
end up uploading it.
2024-09-22 22:53:55 +02:00
Robin Kertels
ef8bad33a5 [d3d9] Optimize late buffer uploads
... similar to what we're doing for textures.
2024-09-22 22:53:55 +02:00
Blisto91
5a08b3c451 [util] Cap fps for F.E.A.R 1 & expansions
Visual glitches can occur at very high fps
2024-09-22 21:07:08 +02:00
Robin Kertels
04ad98690b [d3d9] Add SWVP HUD item 2024-09-22 21:03:23 +02:00
Robin Kertels
033104f335 [d3d9] Cleanup buffer memory flag selection 2024-09-22 21:03:23 +02:00
Robin Kertels
5bb8d09a96 [d3d9] Always use per-draw buffer uploads on pure SWVP devices 2024-09-22 21:03:23 +02:00
WinterSnowfall
97fb6e4f6d [d3d9] Clean up supported formats from GetUnsupportedFormatInfo 2024-09-22 20:51:15 +02:00
WinterSnowfall
7985ac9cdb [d3d9] Add R16 and AL16 as known unsupported formats 2024-09-22 20:51:15 +02:00
Blisto91
e687303197 [util] Cap Prince of Persia (2008) max fps
Game can get stuck when loading at very high fps
2024-09-22 17:47:51 +02:00
Robin Kertels
07e7781c0b [d3d9] Only add meta image usage after determining layout 2024-09-22 15:48:18 +02:00
WinterSnowfall
c7cf0a7368 [d3d8] Respect D3DCREATE_MULTITHREADED and make d3d8 thread safe 2024-09-21 16:05:25 +02:00
Robin Kertels
c8791a6ba5 [d3d9] Don't emit 1-sized vector type in SWVP Emu
Fixes a validation error.
2024-09-20 12:57:11 +02:00
Robin Kertels
900edf55b5 [d3d9] Only create sampling image views if the image supports sampling
Fixes validation error
2024-09-20 12:57:11 +02:00
Robin Kertels
46e8161649 [d3d9] Enable shaderInt8 for ProcessVertices 2024-09-20 12:57:11 +02:00
Robin Kertels
828aaa5cdd [d3d9] Add missing TRANSFER_SRC usage for swapchain helper images 2024-09-20 12:57:11 +02:00
Philip Rebohle
43c27670ef [dxvk] Fix buffer view stuff again
Testing fallback paths that we only ever hit in scenarios without validation
output sure is fun....
2024-09-20 02:00:50 +02:00
Philip Rebohle
dd8af9da78 [dxvk] Fix buffer view derp systems not supporting maintenance5 2024-09-20 01:25:06 +02:00
Robin Kertels
80e950ac32 [util] Fix small_vector move
... again. We can only move over the ptr
if the other small_vector has MORE than N
elements, otherwise it will still use the local array.
2024-09-20 01:20:25 +02:00
Robin Kertels
2f9ce66879 [util] Fix small_vector move constructor 2024-09-19 20:56:09 +02:00
Philip Rebohle
398c198df6 [dxvk] Fix BDA validation error with dedicated allocations 2024-09-19 18:32:40 +02:00
Philip Rebohle
18ecc17e59 [dxvk] Remove unused discardBuffer method
Unused and not safe to use.
2024-09-18 15:55:57 +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
fb552db65f [dxvk] Do not invalidate buffers that allow querying the device address 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
Philip Rebohle
ab557a2eed [dxvk] Use global buffer whenever possible
Drastically reduces the number of Vulkan buffer objects allocated.
2024-09-18 15:55:57 +02:00
Philip Rebohle
901861c20b [dxvk] Create global buffer for allocated memory chunks 2024-09-18 15:55:57 +02:00
Blisto91
11ec603540 [util] Enable cachedDynamicBuffers for Battle Mages
Helps CPU bound performance
2024-09-18 00:25:05 +02:00
Paul Gofman
ed9ffa6584 [dxgi] Leave fullscreen mode when window looses focus 2024-09-18 00:19:56 +02:00
Paul Gofman
758dc805bb [dxgi] Prevent recursive fullscreen mode change. 2024-09-18 00:19:56 +02:00
WinterSnowfall
5cf0783edb [d3d8] Clean up D3D9 shaders on D3D8 device release 2024-09-17 19:45:18 +02:00
Robin Kertels
010738c107 [d3d9] Add HUD item for FF shaders 2024-09-17 18:30:27 +02:00
WinterSnowfall
89e190b771 [d3d8] Ensure d3d9 interface release 2024-09-17 18:30:00 +02:00
WinterSnowfall
84a8ea9d4a [d3d8] Remove some unneeded explicit ptr use 2024-09-17 18:30:00 +02:00
WinterSnowfall
9f8832dd14 [d3d8] Improve handling of failed d3d9 calls 2024-09-17 18:30:00 +02:00
WinterSnowfall
0a2f2275da [d3d8] Add a framecap for Chrome: Gold Edition 2024-09-14 23:52:20 +02:00
Philip Rebohle
04cf0008a0 [dxvk] Correctly enable VK_EXT_line_rasterization
Oversight, and fixes a validation error.
2024-09-13 11:58:11 +02:00
WinterSnowfall
8e03b64ca4 [d3d8] Validate viewport dimensions on SetViewport 2024-09-12 16:39:40 +02:00
Robin Kertels
903f1af176 [d3d9] Fix PresentGDI 2024-09-12 15:39:21 +02:00
Kacper Michajłow
26a14c5175
[util] Fix GetEnvironmentVariableW usage 2024-09-12 00:04:49 +02:00
WinterSnowfall
3e26958906 [util] Add a framecap for Pandora Tomorrow 2024-09-12 00:02:34 +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
c1a25df468 [dxvk] Fix some logic errors around sysmem chunk size 2024-09-11 15:21:03 +02:00
Philip Rebohle
565ec7e0d3 [dxvk] Remove dxvk.maxChunkSize option 2024-09-09 18:45:34 +02:00
Philip Rebohle
619b9b12c2 [dxvk] Implement dynamically growing chunk size
May reduce memory footprint for launchers.
2024-09-09 18:45:34 +02:00
WinterSnowfall
63506ee1ff [util] Enable cachedDynamicBuffers for Steel Soldiers and FIFA 2003 2024-09-08 19:26:46 +02:00
WinterSnowfall
22ff53013a [d3d8] Ignore unsupported D3DPRESENT_RATE_UNLIMITED 2024-09-08 19:25:16 +02:00
Billy Laws
9077e5212d [util] Use cdecl calling convention for __wine_dbg_output
This matches wine's definition, fixes crashes when wine is built with clang.
Since __cdecl isn't defined for non-windows targets ifdef this needs all
dbg callback uses to be ifdefed out.
2024-09-07 19:44:36 +02:00
Robin Kertels
daccde7643 [d3d9] Don't set IMAGE_USAGE_SAMPLED_BIT for non-msaa depth stencil surfaces 2024-09-04 22:17:10 +00:00
Robin Kertels
7f8cfec46f [d3d9] Always set IsAttachmentOnly for CreateOffscreenPlainSurfaceEx
Surfaces cannot be bound as textures.
2024-09-04 22:17:10 +00:00
Robin Kertels
1b172344eb [d3d9] Remove redundant scene check in StretchRect 2024-09-04 22:17:10 +00:00
Robin Kertels
11efd5092e [d3d9] Handle remaining edge cases of Discard & Lockable 2024-09-04 22:17:10 +00:00
WinterSnowfall
2c23e462b3 [d3d8] Clamp BaseVertexIndex to INT_MAX during use 2024-09-04 21:11:08 +02:00
Philip Rebohle
d0ea5a4a87 [spirv] Account for unreachable continue blocks
Fixes code gen in the following pattern encountered in Black Ops 3:

loop
  break
endloop

We cannot eliminate the loop since we have to adhere to structured
control flow rules, which might be broken if the code inside the
loop was non-trivial.
2024-09-04 02:26:35 +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
ericzlmd
38308d443e [build] added <algorithm> header for failed subcommand fix - remove_if 2024-08-31 13:23:26 +02:00
Tiagoquix
d31b7997c0 [util] Enable cachedDynamicBuffers for APB:Reloaded
Fixes frametime jumps when shooting.
Discussed on the Discord server.
2024-08-30 20:27:05 +02:00
MickAlmighty
8c58bef9cf [util] Hide Intel for Kena: Bridge of Spirits to skip faulty water rendering path. 2024-08-30 17:39:21 +02:00
Robin Kertels
a5fc08d176 [util] Disable direct buffer mapping for Max Payne 1
Improves performance by avoiding stalls.
2024-08-30 00:37:58 +02:00
Robin Kertels
e4fd9ff16b [d3d11] Always keep barrier control options set by app profile 2024-08-26 23:15:32 +02:00
Robin Kertels
eb8d1885bd [dxgi] Remove emulateUMA option
The option was only used for GTA IV.
It broke and we have a better solution now.
2024-08-24 19:05:44 +02:00
Robin Kertels
9a280b063a [util] Set maxDeviceMemory for GTA IV
... and replace emulateUMA
2024-08-24 19:05:44 +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
6da1ba7cff [dxgi] Avoid reporting large VRAM amounts as a power of two 2024-08-23 01:13:10 +02:00
Philip Rebohle
d89e324bc4 [util] Remove obsolete Metro Exodus EE config
No longer necessary or useful.
2024-08-20 13:33:04 +02:00
Philip Rebohle
be45907479 [dxgi] Under-report iGPU memory if dGPUs are present
Should help games pick the correct GPU on setups with integrated graphics.
2024-08-20 13:33:04 +02:00
Philip Rebohle
02d8fa593b [dxgi] Change reported UMD driver version
Fixes a potential crash in Hunt Showdown.
2024-08-15 22:04:06 +02:00
Philip Rebohle
71e44b380d [util] Enable context lock for EDF6
May or may not fix random crashing.
2024-08-15 20:55:17 +02:00
Philip Rebohle
159f540e10 [dxvk] Bump internal engine version
Due to large shader-related changes.
2024-08-14 22:15:50 +02:00
Philip Rebohle
1e5b78e8ea [d3d9] Enable longMad behaviour by default
And remove the respective config option.
2024-08-14 22:15:50 +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
beaf01ecad [dxbc] Reverse order of long dot products
Matches output of AMD's dxbc compiler this way.
2024-08-14 22:15:50 +02:00
Philip Rebohle
813b653645 [spirv] Implement basic dead code elimination
Fixes invalid SPIR-V in Trails through Daybreak.
2024-08-14 22:15:50 +02:00
Blisto91
6308266a0f [d3d9] Default to Strict floatEmulation for amdvlk 2024.Q3.1
The AMD Linux open source driver now optimizes for the Strict floatEmulation path.
2024-08-13 17:18:34 +02:00
Philip Rebohle
0d0b9eaac1 [util] Enable d3d11.longDot for Trails through Daybreak 2024-08-11 18:30:59 +02:00
Philip Rebohle
4ee907a6df [dxbc,d3d11] Add option to explicitly emit long dot products 2024-08-11 18:30:59 +02:00
Paul Gofman
5c987ea3d1 [d3d9] Handle map failure in texture initializer 2024-08-08 21:42:04 +02:00
Jeff
e38693cdbc [d3d9] Allow querying ID3D9VkInteropTexture from surfaces 2024-08-08 05:25:41 +01:00
Blisto91
7c9e1ed7cd [util] Set maxChunkSize to 1 for Epic Games Launcher
Also move up Battle.net so the launchers are grouped
2024-08-03 14:57:36 +02:00
Blisto91
e2b823b760 [util] Enable cachedDynamicBuffers for Art of Murder
Horrible CPU bound perf
2024-07-31 18:34:39 +02:00
Blisto91
1077d6a67f [util] Set textureMemory to 0 for Operation Racoon City
Works around a crash
2024-07-30 09:15:28 +02:00
Blisto91
33bf09122c [util] Add configs for Splinter Cell Conviction
The game will sometimes black screen upon alt-tab without deviceLossOnFocusLoss.
Spoofing the GPU through dxgi to a known one from its list prevents the System Detection tool from complaining that it is unsupported on some setups.
2024-07-28 23:04:35 +02:00
Eric Sullivan
c26b2ade1d [dxvk] Update shouldSubmit to correctly handle descriptorPoolOverallocation
Currently shouldSubmit will force the dxvk context to be flushed when
too many descriptor pools have been allocated. This heuristic does not
work when VK_NV_descriptor_pool_overallocation is in use because there
will only ever be a single pool.

This change updates the heuristic to use the number of allocated sets
when VK_NV_descriptor_pool_overallocation is in use.
2024-07-25 23:53:03 +02:00
Tobias Jakobi
10ab85c3ba [d3d8] Remove references to d3d8.useShadowBuffers for now
The current D3D8 codebase in DXVK does not implement this
feature, i.e. setting this option is a NOP. It was
implemented in D8VK at some point, but was removed before
the big merge.

Remove any references to avoid confusion.
2024-07-22 00:14:15 +02:00
Robin Kertels
031a98c232 [d3d9] Allow fourcc formats as the source in CheckFormatConversion
The docs say:
"The source format must be a FOURCC format or a valid back buffer format."
2024-07-19 19:25:31 +00:00
Robin Kertels
b7d61b70c1 [d3d9] Use converted format for multiplane formats in CheckFormat 2024-07-19 19:25:31 +00:00
WinterSnowfall
bac7ae2929 [util] Disable countLosableResources for Inquisitor 2024-07-16 16:42:44 +02:00
Felix Klinge
2a2d51e049 changed dxgi.customVendorId to dxgi.hideIntelGpu for Batman Arkham Knight 2024-07-16 16:21:08 +02:00
Felix Klinge
b74725b264 Add Batman Arkham Knight Custom Vendor ID to config to fix the game for Intel GPUs 2024-07-16 16:21:08 +02:00
Robin Kertels
af1ba1b205 [d3d9] FF: Fix return type for lighting op 2024-07-16 16:08:33 +02:00
WinterSnowfall
a8dbbcfa31 [util] Reorder config options by API 2024-07-12 16:42:31 +02:00
Philip Rebohle
008afc1c5f [meta] Release 2.4 2024-07-10 11:56:14 +02:00
WinterSnowfall
d731608d5e [d3d8] Mimic native token allocations 2024-07-10 00:28:10 +02:00
WinterSnowfall
ff137dac9f [d3d8] Implement monotonic state block tokens 2024-07-09 23:20:52 +02:00
Robin Kertels
d456d0b437 [d3d9] StretchRect: Allow using an offscreen surface as dst when stretching 2024-07-09 13:54:59 +00:00
Robin Kertels
cc87870be1 [d3d9] Relax stretch rect check in D3D8 mode 2024-07-09 13:54:59 +00:00
Robin Kertels
a7ae5999a9 [d3d8] Slightly clean up CopyRects 2024-07-09 13:54:59 +00:00
Blisto91
5f9ca08071 [util] Enable deviceLossOnFocussLoss for Rise of Nations
To prevent it from crashing on a alt-tab
2024-07-09 15:42:49 +02:00
Blisto91
fe9c875fe9 [util] Set cachedDynamicBuffers for The Sims 2 and friends
Helps very low CPU bound performance especially in Castaway Stories.
2024-07-07 14:31:37 +02:00
Blisto91
a63a5753d4 [util] Enable longMad for Tomb Raider Legend
Since the enablement of invariant position by default the game suffers from white flickers on characters when you use the Next Generation Content option
2024-07-07 14:23:11 +02:00
Robin Kertels
5a0f05ae66 [util] Disable counting losables for Battlefield 2 & 2142 2024-07-07 14:21:59 +02:00
Er2
38006e9cda
[dxvk] Add FreeBSD support 2024-07-07 11:22:43 +00:00
Jeff
60e523b4bf
[d3d8] Implement Direct3D 8 Frontend
Co-authored-by: WinterSnowfall <WinterSnowfall@users.noreply.github.com>

## Config Changes

Co-authored-by: Blisto91 <47954800+Blisto91@users.noreply.github.com>
Co-authored-by: simifor <simirmonfor@gmail.com>
2024-07-07 11:10:48 +00:00
WinterSnowfall
ef0c6b6f6f [d3d9] Hardware cursor fixes 2024-07-07 01:32:40 -07:00
Robin Kertels
9b504b506e [d3d9] Rework FF texcoord processing to be more accurate 2024-07-07 01:28:44 -07:00
Blisto91
b2d89db8d8 [util] Disable countLosableResources for Myst V
Works around a crash regression in dxvk 2.3 upon resolution change.
2024-07-05 14:16:18 +02:00
Blisto91
fa5ce49675 [util] Enable longMad for Watch_Dogs 2 and Legion
Works around flickering on characters when a outline or highlight effect is showing.
2024-07-05 13:04:59 +02:00
Robin Kertels
bbe851f6a2 [d3d9] Reduce data copied for SWVP vertex decls 2024-07-05 00:44:28 -07:00
Robin Kertels
7de88ff993 [util] Add move & copy constructors to small_vector 2024-07-05 00:44:28 -07:00
Robin Kertels
ab12ffa0da [d3d9] Use max point size of Vulkan device
The default render state value has to match what we report in the device caps.
Fixes a Wine stateblock test.
2024-07-05 00:44:28 -07:00
Robin Kertels
dc3dd0f88c [d3d9] Ignore the vertex stream offset in StateBlock::Capture
Fixes a Wine test and matches further testing on Windows.
2024-07-05 00:44:28 -07:00
Robin Kertels
da814668bc [d3d9] FF: Prevent specular highlights on the back of geometry
Fixes the Wine test "test_specular_lighting".
2024-07-05 00:44:28 -07:00
Robin Kertels
df9bdfc6ea [util] Return unchanged matrix if matrix cannot be inverted 2024-07-05 00:44:28 -07:00
Robin Kertels
9e422a2b63 [d3d9] Fix default light
Fixes the diffuse alpha and the direction.
2024-07-05 00:44:28 -07:00
Robin Kertels
11db6d691c [d3d9] Fix reference leak in ProcessVertices
Also fixes a Wine test.
2024-07-05 00:44:28 -07:00
Robin Kertels
9c898bd269 [d3d9] Skip presenting if D3D9Swapchain has no associated window 2024-07-05 00:44:28 -07:00
Robin Kertels
175772944c [d3d9] Fix Wine test failures in StretchRect 2024-07-05 00:44:28 -07:00
WinterSnowfall
5ae3cfe402 [d3d9] Fix DF Formats selection logic 2024-07-05 00:43:09 -07:00
WinterSnowfall
b03de97f1b [d3d9] Expose support for D16_LOCKABLE only on AMD 2024-07-05 00:43:09 -07:00
WinterSnowfall
18035820de [d3d9] Remove vestigial D32 support 2024-07-05 00:43:09 -07:00
Łukasz Zając
1783b9591a
[util] Enable 60 FPS lock for WRC4
Fixes an audio issue.
2024-07-04 20:12:08 +02:00
Philip Rebohle
afbcd94569 [util] Fix up recently added app profiles 2024-06-26 00:44:43 +02:00
Philip Rebohle
86f04a2da3 Revert "[util] Consolidate maxFrameRate options"
This reverts commit 1811f4b995.

The D3D12 Beyond Good and Evil remaster uses the same exe name as the
original D3D9 game, so it turns out the separation was useful after all.
2024-06-26 00:42:31 +02:00
Philip Rebohle
8573190c7d [dxvk] Apply frame rate limiter before signaling frame latency event
Otherwise we add latency for no reason.
2024-06-24 18:12:59 +02:00
Blisto91
fe0e02de18 [util] Set cachedDynamicBuffers for Battle for Middle-Earth 2
Helps slowdowns below 30fps in certain scenarios like when moving the camera over heavy vegetation areas among others
2024-06-22 21:58:16 +02:00
Robin Kertels
3145020a62 [d3d9] Only change vertex offset draw parameters when necessary
... Only change it when the vertex data is actually dynamically uploaded.
2024-06-21 13:18:39 +02:00
WinterSnowfall
e9fc071d95 [d3d9] Validate D3DCREATE_PUREDEVICE usage 2024-06-20 03:34:45 +00:00
Blisto91
a276e13821 [util] Set deviceLossOnFocusLoss for Guild Wars
Works around the game black screening on alt-tab when it is set to fullscreen with a non native resolution
2024-06-19 15:08:37 +02:00
Blisto91
4b4d323ec3 [util] Set cachedDynamicBuffers for Dragonshard
Works around massive FPS decreases in some scenes
2024-06-17 22:49:25 +02:00
Blisto91
d9994665a8 [util] Set strict floatEmulation for New Vegas
Fixes various visual issues with some effects in mods such as New Vegas Reloaded. White spots/shapes, black streaks across the screen (rain?) and probably more.
2024-06-17 22:49:25 +02:00
Blisto91
22b13a94ca [util] Enable deviceLossOnFocusLoss for The Force Unleased
Prevents the game from black screening on each alt-tab
2024-06-16 22:04:22 +02:00
Jeff
3e5eb1660f
[d3d8] Implement Dref scaling and fixed-function depth textures (#3565) 2024-06-14 12:10:49 +02:00
Trevonn
a8710f70a5 [util] Dead Space 2 - Lock to 60 FPS and enable vsync
Similar to the first game it has a poor vsync implementation and physics issues when the frame rate is unlocked.

Locking to 60 FPS and enabling vsync externally provides a better experience after the ingame vsync is disabled
2024-06-13 18:03:12 +02:00
Philip Rebohle
336c9b6acc [dxgi] Allow changing refresh rate even without ALLOW_MODE_SWITCH
Matches Windows behaviour, entering fullscreen state will only prevent
us from changing the display resolution if the flag is not set.
2024-06-12 17:33:41 +02:00
Blisto91
018db92342 [util] Disable Crysis 1 refresh rate fps limiter
Game bug in its d3d10 mode where it selects the lowest supported refresh rate.
2024-06-11 15:45:30 +02:00
Philip Rebohle
51f2e246fa [util,dxvk] Limit frame rate based on deadline
This should work better now that present_wait is universally supported.
2024-06-11 15:45:17 +02:00
Philip Rebohle
1811f4b995 [util] Consolidate maxFrameRate options 2024-06-11 15:45:17 +02:00
Philip Rebohle
5674abe483 [d3d9] Limit frame rate to display refresh as necessary 2024-06-11 15:45:17 +02:00
Philip Rebohle
1c198dcd48 [dxgi] Limit frame rate to display refresh as necessary 2024-06-11 15:45:17 +02:00
Philip Rebohle
379346751a [util] Implement refresh rate heuristic for frame rate limiter 2024-06-11 15:45:17 +02:00
Philip Rebohle
b4c4c9e683 [util] Remove useless vsync parameter from FPS limiter 2024-06-11 15:45:17 +02:00
Sanakan8472
2188caae8e Fix GLFW exception at startup
`GlfwWsiDriver::getInstanceExtensions` was creating an `std::vector` with a size argument in the ctor but then used `push_back` instead of filling the pre-allocated elements, leading to a bunch of nullptr entries at the start that caused an exception later on when accessed.
2024-06-10 13:41:50 +02:00
Blisto91
8d965359a5 [util] Set longMad for Watch_Dogs
Works around flickering on some objects such as the blue light arrow on lowering gates
2024-06-06 19:01:42 +02:00
Philip Rebohle
fd978704fb [dxvk] Add dxvk.deviceFilter config option 2024-06-05 00:49:26 +02:00
Tiagoquix
ee18aecb8a
[util] Add dxvk.maxChunkSize 1 for Origin Web Helper Service and Ubisoft Connect (UPlay) (#4047)
* Add dxvk.maxChunkSize 1 to Ubisoft Connect (UPlay)

* Add Origin Web Helper Service and fix Rockstar Games entries

* Revert Rockstar changes, improve Origin and Ubisoft
2024-06-02 20:08:52 +02:00
Blisto91
c2fd91f835 [util] Set longMad for Ghostbusters Remastered
Works around flickering on character faces
2024-06-02 11:10:13 +02:00
Tiagoquix
79eea564fb Add dxvk.maxChunkSize 1 to Origin 2024-05-31 23:46:26 +02:00
Robin Kertels
7df8017e46 [d3d9] FF: Apply transform flags count to generated texture coords
... and fix cases where projection doesn't get applied.
2024-05-27 20:52:32 +00:00
WinterSnowfall
c98152683f [d3d9] Tweak VCache query results 2024-05-27 19:53:19 +02:00
Robin Kertels
60cfafe027 [d3d9] Fix strange type in dynamic vertex upload 2024-05-26 04:58:47 +00:00
Robin Kertels
889802887f [d3d9] Rework uploading dynamic sysmem buffers at draw time
... and handle mismatching vertex sizes and vertex strides.
2024-05-23 16:44:49 +02:00
WinterSnowfall
a1ce690c5c [d3d9] Determine DF format support in the options parser 2024-05-23 16:37:09 +02:00
WinterSnowfall
07d007c642 [d3d9] Use customVendorId to determine the options vendorId 2024-05-23 16:37:09 +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
Philip Rebohle
61bd62c327 [dxvk] Allow descriptor pool overallocation if supported 2024-05-23 14:27:28 +02:00
Philip Rebohle
7bc77b597e [dxvk] Enable VK_NV_descriptor_pool_overallocation if available 2024-05-23 14:27: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
Robin Kertels
65dd3c7df3 [d3d9] Always enable STORAGE_BUFFER usage
Fixes a validation error. Drivers don't care about buffer usage bits anyway.
2024-05-21 20:32:13 +02:00
Robin Kertels
dfc3776b24 [d3d9] FF: Fix a bunch of wine tests with FF texture coordinates 2024-05-21 20:32:13 +02:00
Philip Rebohle
3420cd78ac [dxvk] Use new Version helper to deal with driver version numbers 2024-05-20 18:30:36 +02:00
Philip Rebohle
4225f35034 [util] Add version helper class
Useful to decode, store and compare human-readable driver versions.
2024-05-20 18:30:36 +02:00
Philip Rebohle
2cb2f8694e [dxvk] Use VK_MAKE_API_VERSION instead of VK_MAKE_VERSION.
The old macro is deprecated.
2024-05-20 18:30:36 +02:00
Blisto91
c1f665f92b [util] Disable supportDFFormats for Prototype
Incorrect shadows on AMD & Intel
2024-05-18 19:31:07 +02:00
WinterSnowfall
20185a5309 [d3d9] Do not enable support for DF formats on Nvidia 2024-05-18 16:16:34 +00:00
Blisto91
c7d61b2fc0 [native] Change DXVK_WSIDRIVER to DXVK_WSI_DRIVER 2024-05-16 10:57:35 +00:00
Ethan Lee
6259e86392 [meson] Use dependency() instead of find_library() for SDL2/GLFW detection.
Since we're not linking to the libraries anymore, it doesn't make much sense to
use find_library, and in fact we need to use dependency() in order to get the
right CFLAGS for includes, defines, etc, so use that instead.

As a result, we can remove the 'SDL2/' folders from the includes, making the SDL
includes more correct.
2024-05-13 13:18:03 +00:00
Ethan Lee
d5d236a1e2 [wsi] Refactor platform system to support multiple WSI implementations 2024-05-13 13:18:03 +00:00
Ethan Lee
10b83d184b [native] Dynamically load SDL2/GLFW at runtime.
Removing these link-time dependencies is important for making a single binary that is compatible with either backend, regardless of whether or not each one is currently available to the program.
2024-05-13 13:18:03 +00:00
Ethan Lee
0f7c1f753a [wsi] Refactor the WSI backends to be implementations of a WsiDriver interface.
Rather than directly calling functions, the API now calls shared functions that call into a WsiDriver instance, which is allocated and implemented by the backend. Functionally this should be the same, it just has the extra allocation for the function table.

This prepares the WSI library for supporting multiple implementations in a single binary.
2024-05-13 13:18:03 +00:00
Ethan Lee
529129c332 [dxvk] Move getInstanceExtensions platform logic to wsi.
This ensures that all of the WSI backend logic is in one place rather than two.
2024-05-13 13:18:03 +00:00
Ethan Lee
4055a92856 [wsi] Add init/quit functions, integrate them into DxvkInstance.
This is preparation for loading/unloading WSI backends at runtime, which will be in an upcoming commit.
2024-05-13 13:18:03 +00:00
Blisto91
7bad17c1d1 [util] Set deviceLossOnFocusLoss for The Sims 3
Prevents the game black screening on alt-tab
2024-05-11 14:38:43 +02:00
Blisto91
6b76d70d9d [util] Enable d3d11.longMad for Guild Wars 2
Fixes invisibility effect flicker when invariantPosition is enabled
2024-05-09 00:47:13 +02:00
Philip Rebohle
611dc60018 [d3d9] Do not support cube textures with depth formats 2024-05-08 17:05:48 +00:00
WinterSnowfall
b2789ab894 [d3d9] Validate DS format support during CheckDepthStencilMatch 2024-05-06 20:26:09 +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
talkingerbil
1fb35b6d19
[dxgi] Initialize UMD version quad to a max signed int64 (#3985) 2024-05-03 16:22:58 +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
Blisto91
dacb8b434b [util] Add configs for Delta Force Xtreme 1 & 2
Prevents the games from black screening on Alt-Tab and helps big performance dips.
2024-05-01 14:08:03 +02:00
Philip Rebohle
ea4cb84d8a [dxvk] Remove workaround for non-dynamic depth clip
Kind of pointless and everyone supports the required EDS3 subset anyway.
2024-04-29 17:43:40 +02:00
Philip Rebohle
65373792d2 [dxvk] Forward link flags when using shader identifiers
Fixes a long-standing bug that now causes validation errors.
2024-04-29 17:43:40 +02:00
Lierrmm
29253da356 feat: add H2M-Mod to config 2024-04-29 16:19:42 +02:00
Robin Kertels
79398b468d [util] Enable longMad for Red Faction Guerrila Remastered 2024-04-29 13:17:21 +02:00
Robin Kertels
e7d14e97de [dxbc] Implement option to split up fma 2024-04-29 13:17:21 +02:00
Philip Rebohle
c613078ba8 [dxvk] Bump internal version number
Potentially useful for drivers and tools to deal with the new pipeline
layout changes.
2024-04-26 19:54:52 +02:00
Philip Rebohle
2970645f33 [dxvk] Fix push constant compatibility for pipeline libraries
When linking pipelines, all pipeline libraries are required to declare
the exact same set of push constants, even for stages not part of the
respective libraries.

This invalidates all fossilize databases.
2024-04-26 19:54:52 +02:00
Philip Rebohle
462165da19 [util] Add Deck profile for Fallout 4
Should fix the FPS problem on Deck OLED.
2024-04-26 14:34:08 +02:00
Philip Rebohle
3f27a0ee58 [util] Add a way to define app profiles exclusive to Steam Deck 2024-04-26 14:34:08 +02:00
Katharine Chui
aac3396671 [dxgi] unchain DxgiFactory::CreateSwapChain and CreateSwapChainForHwnd
similar to https://github.com/doitsujin/dxvk/pull/3966, avoid
chaining so that dxgi tools attempting to wrap swapchains don't
end up double wrapping

ref: https://github.com/SpecialKO/SpecialK/issues/168
2024-04-25 12:07:50 +02:00
Katharine Chui
92a43ebf65 [dxgi] unchain DxgiSwapChain::Present1 and Present
dxgi hooking tools might hook both, eg. https://github.com/SpecialKO/SpecialK/issues/167
2024-04-22 14:04:43 +02:00
Blisto91
8ba5256dc7 [util] Set deferSurfaceCreation for 9th Dawn II
OpenGL game that also spins up d3d9. Will black screen without deferSurfaceCreation when using dxvk
2024-04-22 04:48:56 +02:00
Philip Rebohle
2b70ba8f77 [dxbc] Do not emit OpImageQueryLevels for multisampled images 2024-04-19 13:55:31 +02:00
Philip Rebohle
00872e9e4f [dxvk] Fix render target clears with format reinterpretation
With LOAD_OP_CLEAR, we cannot rely on the clear actually being performed
with the view format in mind. Use a vkCmdClearAttachment path instead.
2024-04-19 13:08:36 +02:00
Philip Rebohle
35157357dd [dxvk] Fix stencil discard being broken 2024-04-19 01:43:23 +02:00
Philip Rebohle
617ebf4e05 [dxbc] Take used components into account for PS inputs 2024-04-19 01:01:52 +02:00
Philip Rebohle
c2489d5a45 [dxbc] Fix array register anaylsis with multiple dst operands 2024-04-19 01:01:52 +02:00
Philip Rebohle
6ef98c613f [dxvk] Re-enable maintenance4 feature
Sileces some validation errors.
2024-04-19 01:01:52 +02:00
Philip Rebohle
7441137a33 [dxbc] Ignore system value components when declaring inputs 2024-04-19 01:01:52 +02:00
WinterSnowfall
571948cfc0 [d3d9] Remove support for VERTEXSTATS queries 2024-04-13 19:11:00 +01:00
Martino Fontana
133f0794bc [util] Remove framerate limiter for Nier Replicant
Without mods, Nier Replicant runs faster when going above 60 FPS.
The game had an official patch that implemented a framerate limiter to prevent this. This limiter is terrible, because it's not a stable 60 FPS, but a weird 57-58 FPS. There's no way to disable this in-game, it has to be done by editing a config file or through a mod.

So, why remove the default frame limiter from DXVK?
- In the default case (a user plays the game as it is), it does nothing, since 57-58 is lower than 60.
- If a user is going out of their way to edit the config file, why would they assume that DXVK already provides a frame limiter? They are going to follow [a guide](https://www.pcgamingwiki.com/wiki/NieR_Replicant#Framerate_limited_to_57.7E58_FPS) that says to set up a frame limiter, it doesn't say "set up a frame limiter, unless you are using DXVK, in that case it's already there".
- They are using [Special K in order to use a mod to play at high refresh rates at normal speed](https://wiki.special-k.info/SpecialK/Custom/Replicant). In this case, DXVK's default limiter is harmful, since it is not documented that it's there by default.

Since this default limiter is useless in the first two cases and harmful in the third, I think it should be removed.
The alternative would be to document this (e.g. in PCGamingWiki), but the instructions wouldn't look pretty... "After following the instructions to use Special K in order to play at higher framerates at normal speed, if are using DXVK/Proton, also do these things to disable its default 60 FPS cap: [...]"

Especially because that the game isn't broken in the default case, I don't think DXVK should tamper with these things in a way that requires documentation to revert.

Tested Special K's mod to play at higher refresh rates on Linux.
2024-04-08 21:48:47 +02:00
Philip Rebohle
44695f9311 [dxvk] Adjust desciptor pool reset heuristic
Drastically limits the amount of descriptor memory we allocate in situations
where an application renders without presenting anything to a swap chain.

The new limit is a bit tight for some real-world use cases (e.g. Ashes of the Singularity),
but at worst we will start calling vkAllocateDescriptorSets once per set and draw.
2024-04-08 15:40:25 +02:00
Casey Bowman
49e9ea5f5a [dxgi] Force vendor ID change when XeSS is detected on an Intel GPU
Games using libxess.dll or wrapper modules will crash.
To work around this, we hide the Intel GPU's vendor ID to avoid using the
XeSS module.
2024-04-03 20:32:04 +02:00
Blisto91
198bd3a4b8 [d3d11] Remove missed Shared Keyedmutex warning
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX is implemented.
2024-04-03 20:31:52 +02:00
Philip Rebohle
f06c646315 [dxbc] Remove broken atomic counter subgroup optimization
This is not a legal optimization inside non-uniform control flow due
to Vulkan's extremely permissive convergence rules, and apparently
breaks on Nvidia as a result.

Mesa drivers already do the same thing internally anyway.
2024-04-03 14:55:43 +02:00
Philip Rebohle
855b2746b6 [util] Remove TRAHA Global config
This game apparently no longer exists.
2024-03-26 13:42:55 +01:00
Blisto91
28c7c09bf5 [dxgi] Remove useMonitorFallback option
QueryDisplayConfig optimization is now in Proton 9 Wine
2024-03-21 17:23:38 +01:00
Philip Rebohle
2742486540 [dxvk] Don't query color space support for null surfaces
Fixes a crash in games with the dxgi.deferSurfaceCreation workaround set.
Note that this potentially breaks HDR.
2024-03-21 15:32:48 +01:00
Philip Rebohle
037d0fa1ad [meta] Release 2.3.1 2024-03-20 13:48:30 +01:00
Philip Rebohle
cbf51a7a25 [d3d11] Enable copy usage for typeless images as necessary 2024-03-20 13:30:31 +01:00
Philip Rebohle
70e34dc31c [dxvk] Support arbitrary source formats for color<->depth copies
Fixes rendering bugs in War Thunder.
2024-03-20 13:29:59 +01:00
Philip Rebohle
c5aeb0f87a [dxvk] Get rid of separate depth shaders for shader-based copies
We can export both depth and color in a single shader instead.
2024-03-19 19:32:12 +01:00
Philip Rebohle
a163082770 [dxvk] Align index buffer size to index size
Fixes validation errors in FFXIV.
2024-03-19 19:32:12 +01:00
Blisto91
2e1a19c7fd [util] Cap Dark Void to 60fps
Game crashes in certain places like specific cutscenes unless capped at 60fps.
2024-03-18 12:56:27 +01:00
Joshua Ashton
0beb18ef73 [d3d9] Wait for submission when calling ReturnUnderlyingResource 2024-03-16 19:11:11 +00:00
Joshua Ashton
ef4428ab8c [d3d9] Improve ReturnUnderlyingResource stub for 9on12 2024-03-16 18:59:03 +00:00
Philip Rebohle
1085ba713e [dxgi] Implicitly set HDR color space for RGBA16_FLOAT swap chains 2024-03-16 18:56:41 +00:00
Philip Rebohle
e857b09432 [dxgi] Change default behaviour of hideNvkGpu option 2024-03-15 22:48:57 +01:00
Kaitlyn
538f1d13d4 Fix UAV as well 2024-03-15 15:22:13 +01:00
Kaitlyn
783c9d4591 Fix MiscFlags check in GetDescFromResource 2024-03-15 15:22:13 +01:00
Kaitlyn
1a685b1c67 Implement D3D11DXGIDevice::EnqueueSetEvent 2024-03-15 13:47:28 +01:00
Robin Kertels
8b8be7c2bf [d3d9] Fix stream count in Reset 2024-03-10 17:12:22 +01:00
Billy Laws
0776d764a4
build: Support building for ARM64EC
When targeting ARM64EC, both __x86_64__ and _M_X86_64 are defined but
not all x86 intrinsics are present, treat EC as regular ARM64 so the
native intrinsics are used instead.
2024-03-09 05:43:46 +00:00
Robin Kertels
15ddadc4de [d3d9] Fix number of streams 2024-03-08 18:42:15 +01:00
Philip Rebohle
69a52b3da0 [dxbc] Do not emit depth compare for unsupported image types
Fixes invalid SPIR-V.
2024-03-07 16:11:23 +01:00
Philip Rebohle
707ad6f328 [spirv] Add OpConstantNull 2024-03-07 16:11:23 +01:00
Philip Rebohle
3a6992ea97 [dxbc] Enable depth compare types for 1D images
Used by Renderdoc internal shaders.
2024-03-07 16:11:23 +01:00
Robin Kertels
72c86b8229 [d3d9] Only unbind in EndScene if the game cleared the binding 2024-03-06 22:58:48 +01:00
Robin Kertels
85215b10d6 [d3d9] Respect vertex buffer offset when dynamically uploading geometry 2024-03-06 18:13:26 +01:00
Philip Rebohle
fd3fbf6607 [dxvk] Remove old memory budget code
Obsolete since we removed the Nvidia HVV workaround for old drivers.

Closes #3877.
2024-03-06 15:48:34 +01:00
Minelelol
0a699fddb6 Update config.cpp
Insane Performance increase
2024-03-06 15:25:16 +01:00