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

5456 Commits

Author SHA1 Message Date
Philip Rebohle
421d7d9077 Revert "[vulkan] Use fence for acquiring a swap chain image"
Breaks things and we don't really need this right now anyway.
2023-01-16 23:16:38 +01:00
Philip Rebohle
599357721a [hud] Support HDR color spaces
Blending is broken if we need to do encoding in the shader, but we
cannot do much about that without changing the rendering process,
so this will have to do for now.
2023-01-16 18:04:18 +00:00
Philip Rebohle
0e503ce795 [vulkan] Log swap chain color space 2023-01-16 18:04:18 +00:00
Philip Rebohle
1482715fd1 [vulkan] Use fence for acquiring a swap chain image
In practice, drivers will block here anyway.
2023-01-16 16:20:56 +01:00
Joshua Ashton
132bc529c3 [dxgi] Only allow colorspace punting if we started in sRGB 2023-01-16 13:45:03 +01:00
Joshua Ashton
28ee6867be [dxgi] Expose only sRGB when enableHDR is disabled
Death Stranding: Director's Cut crashes if HDR was last enabled in-game and CheckColorSpaceSupport reports support for HDR but it is not globally enabled in DXGIOutput::GetDesc1's ColorSpace.

It seems safer to just lock HDR behind an option to avoid any teething issues like this. It sucks, but it also makes sense in a way.
2023-01-16 13:45:03 +01:00
Joshua Ashton
bb75e214d6 [dxgi] Store top-level DxgiFactory in DxgiSwapChain
Can do this now that we tossed the old stuff that depended on the swapchain factory being resident in D3D11.
2023-01-16 13:45:03 +01:00
Joshua Ashton
9010f11adf [dxgi, d3d11] Remove support for legacy IWineDXGISwapChainFactory interface
vkd3d-proton 2.8 released last year with support for the new swapchain
interface.

No need to keep support for this legacy interface hanging around when
it complicates adding DxgiOptions support to the swapchain.
2023-01-16 13:45:03 +01:00
Philip Rebohle
af05265cb6 [dxvk] Set thread priority for background workers
We accidentally lost this somehow.
2023-01-15 15:54:03 +01:00
Philip Rebohle
459758c6ff [d3d9] Don't set storage buffer usage unless necessary
This actually matters now to some degree.
2023-01-15 15:36:05 +01:00
Philip Rebohle
d35bf455d9 [dxvk] Rename bindResourceBuffer to bindUniformBuffer 2023-01-15 15:36:05 +01:00
Philip Rebohle
a8f9fdb21d [dxvk] Rearrange descriptor sets
This allows us not to unnecessarily dirty the FS UBO set when
changing tetxure bindings, leading to a cleaner separation.
2023-01-15 15:36:05 +01:00
Philip Rebohle
4a30933359 [dxvk] Add UBO set property to descriptor info
Used to explicitly propagate storage buffer bindings
to the respective UBO set.
2023-01-15 15:36:05 +01:00
Philip Rebohle
6f194b0e7b [d3d11] Bind UAV counter buffers as views 2023-01-15 15:36:05 +01:00
Philip Rebohle
82f500250f [hud] Bind data buffers as views 2023-01-15 15:36:05 +01:00
Philip Rebohle
c347bd4d8b [dxvk] Allow creating buffer views with undefined format 2023-01-15 15:36:05 +01:00
Philip Rebohle
92de3f3f5f [d3d11] Add missing context locks 2023-01-14 18:40:41 +01:00
Philip Rebohle
1c2df54bdf [dxvk] Improve logging in case of memory errors 2023-01-14 03:39:55 +01:00
Philip Rebohle
2922b780c1 [dxvk] Properly handle bufferImageGranularity for images
Fixes validation errors about dedicated allocations being
bigger than the image's memory requirement on Nvidia.
2023-01-14 03:39:55 +01:00
Robin Kertels
97a91c816f [d3d9] Disable instancing for non-indexed draws 2023-01-13 21:58:41 +00:00
Philip Rebohle
3a84838ac4 [hud] Display approximate progress when compiling shaders 2023-01-13 16:43:27 +01:00
Philip Rebohle
c978e62ec8 [dxvk] Implement better priority system for background shader compiles
Reduces the number of workers that perform background optimization,
which may reduce the performance impact when encountering a large
number of new pipelines at once.
2023-01-13 16:43:27 +01:00
Blisto91
cc9266edaa [util] Add config for Alien Rage
Reporting a GTX 295 puts us into the highest behind the scenes graphics settings preset bucket and prevents the shadow issue with `FloatingPointRenderTargets` set to false in the lower preset bucket.
NvapiHack needs to be disabled on Linux since the game pings it in the Windows system folder and want's the VendorId to match your GPU. Else the issue will still happen on Nvidia Linux
2023-01-13 14:15:54 +01:00
Philip Rebohle
070a340115 [dxvk] Remove path to look up optimized pipeline in cache
For some reason this sometimes takes several milliseconds, which
leads to noticeable stutter. Linking a pipeline is more consistent.
2023-01-13 11:40:01 +01:00
Philip Rebohle
a22d70e184 [dxvk] Remove unused compileComputePipeline function 2023-01-12 17:35:05 +01:00
Philip Rebohle
e5157a5360 [dxvk] Add pre-rasterization pipeline libraries to the state cache
This allows compiling tessellation or geometry shader pipelines
early while still using the pipeline library path.

Also removes compute shaders. Since API-provided compute shaders
are always compiled early, supporting them is no longer needed.
2023-01-11 11:48:16 +01:00
Philip Rebohle
28ae85b7ab [dxvk] Enable creating full pre-rasterization pipeline libraries 2023-01-11 11:48:16 +01:00
Philip Rebohle
17529101d5 [dxvk] Allow creating pipeline libraries with more than one shader 2023-01-11 11:48:16 +01:00
Philip Rebohle
f9ff96d727 [dxvk] Implement checks for pre-raster pipeline library compatibility 2023-01-11 11:48:16 +01:00
Philip Rebohle
b916dc04e5 [dxbc] Fill in patch vertex count info 2023-01-11 11:48:16 +01:00
Philip Rebohle
5e42230b95 [dxvk] Add patch vertex count to shader info struct 2023-01-11 11:48:16 +01:00
Philip Rebohle
f76a7c285c [dxvk] Rework DxvkShaderPipelineLibrary to work with multiple shaders 2023-01-11 11:48:16 +01:00
Philip Rebohle
8011a40843 Revert "[dxbc] Handle dead code in shader binaries"
Apparently this regressed something, but the reporter who asked
for this fix in the first place did not specify what, so let's
just revert this and break the whole thing again until we get
something to actually work with.

This reverts commit 5115d80d51.
2023-01-10 20:37:22 +01:00
Philip Rebohle
8052347a22 [dxvk] Keep more empty system memory chunks alive 2023-01-10 03:42:37 +01:00
Philip Rebohle
0342a25e61 [d3d9,dxso] Add d3d9.forceSampleRateShading option 2023-01-09 18:35:02 +01:00
Philip Rebohle
e426ec09a1 [d3d11,dxbc] Add d3d11.forceSampleRateShading option 2023-01-09 18:35:02 +01:00
Philip Rebohle
06fb93daf0 [dxvk] Only create state cache file on demand
If no pipelines are ever written to it, we should not create
the cache file in the first place.
2023-01-09 18:31:18 +01:00
Philip Rebohle
6a4fe06ac6 [dxvk] Fix incorrect flags for null fs pipeline layout 2023-01-09 18:31:18 +01:00
Joshua Ashton
5206d97710 [dxgi] Workaround UE4 DX11 + HDR crashes
Unreal Engine 4 titles use AGS/NVAPI to try and enable
HDR globally.
They can key this off IDXGIOutput::GetDesc1's ColorSpace
being HDR10.
Many of these UE4 games statically link against AGS.

This is a problem as when UE4 tries to enable HDR via AGS,
it does not check if AGSContext, and the display info etc
are nullptr unlike the rest of the code using AGS.
So we need to special-case UE4 titles to disable reporting a HDR
when they are in DX11 mode.

The simplest way to do this is to key off the fact that all
UE4 titles have an executable ending with "-Win64-Shipping".

We check if d3d12.dll is present, to determine what path in
UE4 we are on, as there are some games that ship both and support HDR.
(eg. The Dark Pictures: House of Ashes, 1281590)
Luckily for us, they only load d3d12.dll on the D3D12 render path
so we can key off that to force disable HDR only in D3D11.
2023-01-09 12:54:28 +00:00
Blisto91
3ed0a4fd43 [util] Set Secret World Legends launcher to SM 2 2023-01-08 10:47:04 +01:00
Beyley Thomas
c11a63f5e5 [wsi] Add GLFW backend 2023-01-08 10:36:25 +01:00
Hunter Kvalevog
3491895960 [dxvk] Remove SDL dummy window
SDL >= 2.0.9 permits passing a nullptr window to
SDL_Vulkan_GetInstanceExtensions, so there's no
point in going though the work of creating a
window just to call this function.
2023-01-07 22:43:32 +00:00
Philip Rebohle
196fefec4c [dxvk] Enable dynamic multisample state if supported by the device
Eliminates stutter in situations where sample rate shading is used with MSAA.
2023-01-06 23:48:31 +01:00
Philip Rebohle
f269cde749 [dxvk] Enable device features for dynamic multisample state 2023-01-06 23:48:31 +01:00
Philip Rebohle
4612113227 [meta] Update hopelessly outdated README entry 2023-01-06 23:48:14 +01:00
Philip Rebohle
389634f9b9 [d3d11] Fix D3D11Texture2D reference counting 2023-01-06 22:52:29 +01:00
Philip Rebohle
5115d80d51 [dxbc] Handle dead code in shader binaries
We should not emit any code when not inside a function.

Fixes #3154.
2023-01-06 20:49:13 +01:00
Joshua Ashton
c10b53ed3e [dxgi] Add dxgi.enableHDR option 2023-01-06 17:27:38 +01:00
Joshua Ashton
3375cdf1fa [dxgi] Initialize DxgiOptions before DxgiMonitorInfo
Needed to we can access DxgiOptions inside of DxgiMonitorInfo for the dxgi.enableHDR property coming up in a future commit.
2023-01-06 17:27:38 +01:00
Joshua Ashton
f25475d05e [dxgi] Normalize display metadata to something rational
Sometimes we can't get an EDID if things aren't plumbed fully, or some displays just have broken EDIDs.

This accounts for both of those cases by using some dummy data if we are missing information.

Fixes value reporting to match Windows on common displays such as LG OLEDs.
2023-01-06 17:27:38 +01:00