1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 16:08:50 +01:00
Commit Graph

5656 Commits

Author SHA1 Message Date
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
Blisto91
afec5cce88 [util] Remove some unneeded built in configs
Dirt 5 does not crash without working ags anymore and Ethan Carter Redux also starts fine without a spoof.
This allows the built in AMD ags in Proton 9 to be used for these games.

The Hitman 3 config is redundant as it doesn't allow RT to be enabled without Nvapi anyway.
2024-03-06 15:24:54 +01:00
Philip Rebohle
0414bbe2d5 [dxgi] Add separate option to override vendor IDs for NVK 2024-03-06 14:46:21 +01:00
Robin Kertels
20490b678f [d3d9] Fix missing else brackets in ResetSwapchain 2024-03-06 12:08:45 +01:00
Blisto91
428c98bc63 [util] Disable countLosableResources for all d3d9 Supreme Ruler games
All the d3d9 Supreme ruler games have this issue.
2024-03-05 15:28:11 +01:00
Robin Kertels
a0e39e94fa [d3d9] Use most recently used swapchain for GetFrontBufferData 2024-03-05 13:54:15 +00:00
Robin Kertels
eaa732d0b3 [d3d9] Place GetFrontBufferData screenshot at window position 2024-03-05 13:54:15 +00:00
Robin Kertels
49b18f03fe [d3d9] Unbind buffers in EndScene & Reset 2024-03-05 13:52:51 +00:00
Philip Rebohle
c9cea93b7b [dxbc] Use raw access chains for buffer loads and stores
Maps more or less perfectly to D3D raw and structured buffers.
2024-03-05 14:41:18 +01:00
Philip Rebohle
69d74a46a0 [dxbc] Remove emitRawBuffer{Load,Store}
And factor these into the callers. We need to preserve the raw
index and offset parameters to use raw access chains.
2024-03-05 14:41:18 +01:00
Philip Rebohle
94098aa97d [dxbc] Enable SPV_NV_raw_access_chains 2024-03-05 14:41:18 +01:00
Philip Rebohle
c677ba9b3e [dxvk] Enable VK_NV_raw_access_chains if available 2024-03-05 14:41:18 +01:00
Philip Rebohle
77c7396ee1 [spirv] Add support for OpRawAccessChainNV 2024-03-05 14:41:18 +01:00
Philip Rebohle
9004c132ed [dxbc] Declare dynamically indexed UBOs with the maximum possible size
Fixes #3861.
2024-02-23 13:39:29 +01:00
Philip Rebohle
24d4c9c938 [util] Disable command lists for Granblue Fantasy Relink
The uses deferred contexts for rendering if driver command lists are enabled,
but when AMDAGS is loaded, it will also unconditionally use MultiDrawIndirect
functions. Since the AGS version in use does not support deferred contexts,
this breaks rendering, so we will have to force it into the immediate context
path.

Testing also shows slightly higher performance (~3-5%) with this path in
CPU-bound scenarios.
2024-02-22 16:07:24 +01:00
Philip Rebohle
5ded7d67f0 [d3d11] Implement UpdateSubresource bug if native command lists are disabled 2024-02-22 16:07:24 +01:00
Philip Rebohle
234f3ea071 [d3d11] Add option to hide native command list support 2024-02-22 16:07:24 +01:00
Robin Kertels
c5a37d443a [d3d9] Handle null IBO when uploading data for draw 2024-02-20 13:04:01 -08:00
Robin Kertels
f254afb4fb [util] Enable strict float emulation for Red River 2024-02-20 12:58:03 -08:00
Robin Kertels
39c19e9299 [d3d9] End scene on reset 2024-02-20 12:58:03 -08:00
Robin Kertels
738fd4f895 [d3d9] Don't actually unbind buffers 2024-02-20 12:58:03 -08:00
Philip Rebohle
9491b56beb util: Enable d3d11.ignoreGraphicsBarriers for Granblue Relink
Improves GPU-bound performance due to the game using PS UAVs.
2024-02-15 20:33:55 +01:00
Robin Kertels
ab3593185f [d3d9] Fail GetRTData if src and dst have mismatching sizes
MySims tries to do this and needs this to fail,
otherwise mouse picking is off.
2024-02-06 11:02:43 +01:00
Robin Kertels
e9a0fec5b3 [dxso] Clamp Exp when fast float emulation is enabled 2024-02-06 11:02:20 +01:00
Echo J
fae78407a2 d3d9: Remove an unused variable
This fixes a gcc warning (originally reported by Saancreed)
2024-02-06 10:19:28 +01:00
Robin Kertels
5312ef1cf9 [d3d9] Upload DYNAMIC+SYSMEM vertex and index data for each draw 2024-02-05 13:13:18 +00:00
Robin Kertels
62d64bd63a [d3d9] Don't upload buffers before Up draws 2024-02-05 13:13:18 +00:00
Robin Kertels
f83ba898af [dxvk] Use signed int for vertexOffset
BaseVertexIndex is signed in Vulkan, D3D11 & D3D9.
2024-02-05 13:13:18 +00:00
Philip Rebohle
05cb963e22 [util] Set sync interval override for P3R 2024-02-02 17:30:13 +01:00
Philip Rebohle
eb339bc7e4 [dxgi,d3d11] Move syncInterval override to DXGI swap chain
This way it also applies to D3D12 games.
2024-02-02 17:30:13 +01:00
Tatsuyuki Ishi
e2a46a347d [meta] Declare bool conversion operators as explicit
Non-explicit conversion operators in general can participate in very
surprising conversion chains. Explicit bool operator is a good place to
start with, because even with explicit they do get automatic contextual
conversion in a lot of places, e.g., if conditions.
2024-01-27 11:44:51 +01:00
Tatsuyuki Ishi
afc6aa70fb [d3d11] Explicitly convert DxvkExt to bool in D3D11DeviceFeatures
When assigning to a BOOL (which is an uint in disguise) and using explicit
bool conversion operators (introduced in a latter commit) an explicit cast
is required.
2024-01-27 11:44:51 +01:00
Tatsuyuki Ishi
799aeff560 [dxvk] Fix incorrect comparison in DxvkSparsePageTable::updateMapping
m_mappings[page] was getting implicitly converted to bool.
2024-01-27 11:44:51 +01:00
Robin Kertels
2ca8fdf890 [util] Disable counting losable resources for Supreme Ruler Ultimate
The game is broken and leaks a state block.
2024-01-26 18:11:25 +00:00
Robin Kertels
0841f5faf4 [d3d9] Implement config option to disable rejecting reset 2024-01-26 18:11:25 +00:00
Robin Kertels
7d9864c077 [d3d9] Only enable ATOC when rendering to MS RT 2024-01-26 17:48:21 +00:00
Dean Beeler
d4c5fc74e7
d3d11: Fix crash when srv is submitted to ClearUnorderedAccessViewUint
* The Settlers submits (possibly incorrectly) an SRV to ClearUnorderedAccessViewUint. The static_cast in the function does not translate correctly and crashes.

Native D3D11 behavior is to ignore the bad parameter entirely. It does not clear the SRV nor does it fault or even error with the DEBUG validator.
2024-01-23 16:01:12 +01:00
Tatsuyuki Ishi
89267b62ad [build] Remove declspec UUID annotations
MIDL_INTERFACE already implies struct DECLSPEC_UUID.
2024-01-23 15:44:47 +01:00
Blisto91
34d8e65fd7 [util] cachedDynamicBuffers for Codename Panzers Phase One/Two
Helps CPU bound performance
2024-01-23 15:44:28 +01:00
Joshua Ashton
1568c263fb [d3d9] Only add unique modes to mode list 2024-01-19 16:28:22 +00:00
Joshua Ashton
0cd4165658 [d3d9] Add D3DDISPLAYMODEEX operator 2024-01-19 16:28:22 +00:00
Joshua Ashton
4b8e8bed6e [d3d9] Move operators out of dxvk namespace 2024-01-19 16:28:22 +00:00
r-a-sattarov
ac78048c23 [util] Fix e2k build 2024-01-16 22:03:31 +01:00
Richard Yao
14560600a9 Micro-optimize locking in fences
When a fence has been missed, we can avoid locking *most* of the time
via the double-checked locking pattern. We still lock before a second
check in case the scheduler caused us to miss the fence. If the
scheduler did cause us to miss the fence, we can drop the lock prior to
executing the callback function, as a second micro-optimization.

Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
2024-01-15 12:42:19 +01:00
Blisto91
854e06d3f0 [util] Enable deviceLossOnFocusLoss for BF2 and BF2142
The ingame spawn and gear selection GUI can disappear from view unless this is set.
2024-01-14 22:25:43 +01:00
Blisto91
eb806952d8
[util] Set deviceLossOnFocusLoss for Assassin's Creed 2 (#3763)
Makes it not crash on alt tab using at least Proton. 
Windows will still have issues with alt tab.
2024-01-09 10:43:48 +01:00
Blisto91
a44dfabe26 [util] Set float emulation to Strict for UK Truck Simulator 1
Fixes black foliage
2024-01-09 10:42:52 +01:00
spiffeeroo
5e06cf9573 [util] Limit Sonic CD to 60 fps
Game engine physics/speed for Sonic CD is tied to frame rate so limit max frame rate to 60 fps. Otherwise, the game runs too quickly for high refresh rate monitors.
2024-01-02 19:05:44 +01:00
Blisto91
2cf590f636 [util] Enable cached vertex buffers for Kenshi
Improves the games performance when CPU bound.
2023-12-30 22:47:24 +01:00
Robin Kertels
a7a63b37c3 [util] Fix incorrect config option name 2023-12-27 03:06:49 +01:00
Robin Kertels
9cde0b5798 [d3d9] Fix off-by-one when copying shader defined constants 2023-12-25 14:51:02 +00:00
Blisto91
adb33d3af1 [util] Hide Intel in Far Cry 3, 4 and Primal
Also unhides Nvidia in Primal as it has the same clear value rounding assumptions as Far Cry 3 and 4
2023-12-23 09:23:27 +01:00
Philip Rebohle
1b31aa5dbc [util] Enable hideIntegratedGraphics for Metro Exodus EE 2023-12-01 14:14:36 +01:00
Philip Rebohle
03c09ce15f [dxvk] Add option to skip integrated GPU adapters 2023-12-01 14:14:13 +01:00
Blisto91
91f7f43c35 [util] Don't spoof Nvidia on AMD GPUs in Hitman 3
Spoofing to Nvidia prevents ray tracing enablement on AMD and the game does not crash without ags anymore
2023-11-18 12:18:08 +01:00
Robin Kertels
d998dee46e [d3d11] Lock context in KeyedMutex::ReleaseSync
Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-11-16 15:43:07 +01:00
Philip Rebohle
ea3149801f [d3d9] Return empty buffer slice for out-of-bounds offsets
Fixes #3715.
2023-11-14 10:54:54 -08:00
xpander69
1cb58b0732 [Util] two more executables to workaround Warhammer Online
Test server executables need the same VendorID to work around the rendering issues.
2023-11-14 12:23:50 +01:00
Philip Rebohle
2ed1778df9 [d3d11] Handle potential integer overflow when validating draw offsets
Apparently some games use -1 as an argument offset, which is nonsensical
and leads to issues.
2023-11-02 17:49:38 +01:00
Philip Rebohle
a427d22cde [dxvk] Add Vulkan instance flag for D3D9 apps 2023-10-31 16:05:58 +01:00
Joshua Ashton
22c2abb9b7 [dxgi] Treat R16G16B16A16_FLOAT as 32bpp for display
HDR in Control (a patch released by a developer post-launch, not
actually in the game sadly) tries to set a video mode with
DXGI_FORMAT_R16G16B16A16_FLOAT.

This seemingly works on Windows, and based on FindClosestMode etc
documentaton, this seems required to work for any format that scanout
it supported for.

It's really not like the bpp is meaningful on Windows with the
distinction of 8bit and 10bit not working in GDI modes at all.
Nor does it end up actually setting anything on Linux/Deck where
modesets are emulated.

So, treat DXGI_FORMAT_R16G16B16A16_FLOAT as 32bpp so the
FindClosestMatchingMode and EnterFullscreenMode calls succeed.
2023-10-29 10:09:34 +01:00
Blisto91
f45911a28f [util] Disable allowDirectBufferMapping for SkyDrift
Works around a alt tab OOM crash
2023-10-23 14:52:44 +02:00
Blisto91
e00db24557 [util] Enable useMonitorFallback for Holocure
Temporary performance drop workaround until QueryDisplayConfig optimization is in Proton Wine.
2023-10-10 19:32:23 +02:00
Paul Gofman
552d2f0a6d [dxgi] Add useMonitorFallback option
And enable it for CP2077.
It is supposed to be dropped once QueryDisplayConfig optimization
is in Proton Wine.
2023-10-10 12:01:51 +02:00