Commit Graph

71 Commits

Author SHA1 Message Date
Robin Kertels e7d14e97de [dxbc] Implement option to split up fma 2024-04-29 13:17:21 +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 94098aa97d [dxbc] Enable SPV_NV_raw_access_chains 2024-03-05 14:41:18 +01:00
Philip Rebohle e426ec09a1 [d3d11,dxbc] Add d3d11.forceSampleRateShading option 2023-01-09 18:35:02 +01:00
Philip Rebohle a130146f15 [dxvk] Remove dead enableRtOutputNanFixup option
Dead code since 2.0, not sure why this was still in here.
2022-11-18 22:31:54 +01:00
Philip Rebohle 35a84053b5 [dxbc] Implement rasterizer ordered views 2022-09-19 15:44:23 +02:00
Philip Rebohle ccfb986e72 [dxbc] Rework TGSM workaround 2022-09-10 14:27:13 +02:00
Philip Rebohle e8c1a8e734 [dxbc] Clean up support check for R32 reads without format 2022-09-04 18:28:27 +02:00
Philip Rebohle 165648017e [dxbc] Remove fallback path for discards 2022-08-19 13:36:54 +00:00
Philip Rebohle 3717922381
[d3d11,dxbc] Rework check for TypedUAVLoadAdditionalFormats 2022-08-17 15:26:03 +02:00
Philip Rebohle f60bdcbcbf
[dxvk] Replace VK_EXT_shader_demote_to_helper_invocation with core feature 2022-07-14 21:21:34 +02:00
Philip Rebohle 1dd3f24b43
[dxbc] Drop workarounds for unsupported drivers 2022-07-14 21:21:34 +02:00
Philip Rebohle 131af0d677
[dxvk] Replace VK_KHR_driver_properties with core feature 2022-07-14 21:21:34 +02:00
Philip Rebohle 78c5ef88bc
[dxvk] Replace VK_KHR_shader_float_controls with core feature 2022-07-14 21:21:34 +02:00
Philip Rebohle 2774a04195
[dxvk] Use VkPhysicalDeviceVulkan11{Features,Properties} where appropriate 2022-07-14 21:21:34 +02:00
Philip Rebohle f99a833f51
[d3d11] Remove d3d11.constantBufferRangeCheck option 2022-07-12 02:11:39 +02:00
Philip Rebohle e379f472f6
[dxbc] Implement hack to treat multisampled textures as normal textures 2021-07-02 05:52:05 +02:00
Philip Rebohle 81664fce44
[dxbc] Remove atomic counter workaround for ancient Mesa versions
No one should be using Mesa 19.0 at this point.
2021-06-18 15:44:58 +02:00
Philip Rebohle 7beb344f6f
[dxbc] Remove dxvk.useEarlyDiscard option
No longer relevant on drivers that support DemoteToHelperInvocation.
Closes #2109.
2021-06-18 15:44:27 +02:00
Philip Rebohle a1f3f6c971
[dxbc] Remove old RADV/LLVM workaround for early discard
We have Demote now, and ACO is the default.
2021-05-27 00:40:59 +02:00
Philip Rebohle 307f43ff1e [d3d11] Introduce option to disable float controls
And disable for SotTR since it introduces rendering issues.
2021-01-28 20:32:38 +01:00
Philip Rebohle 1478011822
[dxbc] Enable NaN fixup by default on older RADV versions
And get rid of a whole bunch of game-specific workarounds.
2021-01-28 19:37:10 +01:00
Philip Rebohle f5fa7a9099
[dxbc] Set float control bits as necessary 2021-01-28 19:37:10 +01:00
Philip Rebohle 76a6f6eab9
[dxbc] Add option to force memory barriers after shared memory stores 2020-02-08 00:48:42 +01:00
Philip Rebohle 9721938e57
[d3d11] Introduce d3d11.invariantPosition option
Apparently it's better to make app profiles than risk tanking
performance for all applications. Invariance rules in D3D11 are
undocumented so it's not clear what the correct solution is.
2020-01-23 01:28:19 +01:00
Philip Rebohle 11f08c7dea
[dxbc] Declare vertex positions as invariant
Otherwise, games relying on different vertex shaders to produce
the same numerical results may suffer from Z-fighting issues.

Fixes #1364.
2020-01-22 23:59:51 +01:00
Philip Rebohle 27ea176295
[d3d11] Remove d3d11.strictDivision option 2019-11-30 20:39:32 +01:00
Philip Rebohle 3b030d9569
[dxbc] Implement workaround to replace NaN render target outputs by zero 2019-11-30 20:39:32 +01:00
Philip Rebohle e95bc3256f
[d3d11] Move handling of constantBufferRangeCheck option to D3D11Options 2019-10-30 10:57:36 +01:00
Philip Rebohle 3d213efe53
[dxbc] Use SSBOs for dynamically indexed constant buffers if needed
SSBOs are tightly bound-checked on all Nvidia GPUs, so this allows for
a more accurate workaround for games relying on OOB access behaviour.
2019-10-28 15:42:46 +01:00
Philip Rebohle 6ab074c95b
[dxbc] Only use atomic append/consume optimization in compute shaders
- For fragment shaders, this isn't safe since ballots include helper invocations
- For vertex shaders, if drivers don't support subgroup operations in those
  stages, we don't want it to affect the performance of compute shadres.
2019-07-26 14:07:39 +02:00
Philip Rebohle 8644d75722
[dxbc] Use OpDemoteToHelperInvocationEXT for discards if supported 2019-07-11 19:33:17 +02:00
Philip Rebohle 06d4e06d8a
[dxbc] Enable early discard on RADV/ACO
Still can't enable on LLVM due to GPU hangs. The way we detect it
may have to change in the future, but for now, this should do.
2019-07-08 16:30:56 +02:00
Philip Rebohle 58dcf77c08
[dxbc] Disable atomic counter optimization on old RADV versions
Breaks TressFX in Tomb Raider 2013 for some reason, whereas this works
fine on 19.1 with both LLVM 8.0 and 9.0-git.
2019-06-15 12:58:31 +02:00
Philip Rebohle d5ba36443e
[dxbc] Fix useRawSsbo option
Add some break to fix some breakage.
2019-06-11 20:23:47 +02:00
Philip Rebohle d755b18ccb
[dxbc] Repurpose useRawSsbo option
Basically, abuse the minSsboAlignment property to convince the
compiler to always/never emit raw SSBOs for raw and structured
buffers, and use the actual device limit by default.
2019-06-11 20:20:40 +02:00
Philip Rebohle 0f7c23c022
[dxbc] Always use raw storage buffers if alignment requirements are met 2019-06-11 20:20:40 +02:00
Philip Rebohle d94d89c3ef
[dxbc] Add option to use subgroup ops for atomic counter operations
This can greatly reduce the number of atomic operations when using
append/consume buffers.
2019-05-15 18:49:02 +02:00
Philip Rebohle dc52212873
[dxbc] Disable Constant Buffer Range Check on AMD
The hardware already behaves as intended, no need to waste GPÜ cycles.
2019-04-30 16:07:24 +02:00
Philip Rebohle 5819a69302
[d3d11] Add option to enable constant buffer range checks 2019-04-05 20:56:32 +02:00
Philip Rebohle 0326258829 [dxbc] Use SDiv instead of ShiftRightLogical for index calc on Nvidia
Reportedly fixes Resident Evil 2 and Devil May Cry 5 on Nvidia.
2019-03-09 19:59:56 +01:00
Philip Rebohle 38c6eeed26
[dxbc] Only emit depth clamp in fragment shader if necessary
We don't need this if the depth clip extension is supported
by the driver.
2019-02-19 14:27:21 +01:00
Philip Rebohle c0b325b483
[dxbc] Add option to enable strict sm4-compliat division
SM4 is defined to return the first source operand if the divisor is zero.
Windows drivers don't do this by default, so we shouldn't do it either.
2019-02-05 21:08:13 +01:00
Philip Rebohle 4fe5929799
[dxbc] Add options to enable/disble early discard and raw ssbo use 2019-01-08 20:58:18 +01:00
Philip Rebohle 48548eb894
[dxbc] Add useRawSsbo option
ENabled when we can replace texel buffers for raw and structured
buffers with raw SSBOs.
2018-12-14 23:45:37 +01:00
Philip Rebohle f276bcd0e7
[dxbc] Check for RADV/Nvidia drivers explicitly using the new function
This way, only RADV gets locked out of using early discard whereas
AMDVLK and -PRO are able to use it.
2018-12-12 16:27:01 +01:00
Philip Rebohle 7096937c11
[dxbc] Use ballot to determine early-discard condition in fragment shaders 2018-11-27 11:50:01 +01:00
Philip Rebohle 2424cf0289
[dxbc] Disable early discard on AMD cards
Causes GPU hangs.
2018-11-24 10:09:33 +01:00
Philip Rebohle a75c596132
[d3d11] Add config option to enable TGSM initialization 2018-11-23 16:12:02 +01:00
Philip Rebohle 3e686098cc
[dxbc] Disable subgroup early discard on Nvidia GPUs
People report performance regressions up to 5% with it enabled.
2018-11-23 12:28:48 +01:00