1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-09 11:53:54 +02:00

504 Commits

Author SHA1 Message Date
Philip Rebohle
9bb7d8ca12 [dxvk,d3d9,d3d11] Refactor rasterizer state object 2025-03-24 03:25:27 +01:00
Philip Rebohle
a1106db71f [dxvk,d3d9,d3d11] Refactor blend state object 2025-03-24 03:25:27 +01:00
Philip Rebohle
3c097046b2 [dxvk,d3d9,d3d11] Refactor logic op state object 2025-03-24 03:25:27 +01:00
Philip Rebohle
357e130668 [dxvk,d3d9,d3d11] Refactor multisample state object 2025-03-24 03:25:27 +01:00
Philip Rebohle
92b3e96ebc [dxvk,d3d9,d3d11] Refactor depth-stencil state object
No reason to pass 72 bytes around when we can do with 10.
2025-03-24 03:25:27 +01:00
Philip Rebohle
1a8030a54a [d3d11] Fix A8 UAV clears 2025-03-24 00:25:17 +01:00
Philip Rebohle
05e26f512b [dxvk,d3d11,d3d9] Refactor viewport updates
Might as well use the CS chunk array functionality for this.
2025-03-11 11:16:36 +01:00
Philip Rebohle
209b07f7db [dxvk] Extend resolveImage to support depth-stencil resolves
Also require the format to be defined.
2025-03-11 01:30:14 +01:00
Philip Rebohle
416f9c5a4a [d3d11] Embed UpdateBuffer data in CS chunk
Tiny optimization that gets rid of a copy and also lets us use chunk
memory more efficiently.
2025-03-02 13:29:48 +01:00
Philip Rebohle
b35e69b467 [d3d11] Skip empty draws
Watch Dogs 2 likes to do this with graphics UAVs bound, which
introduces quite a bit of unnecessary GPU synchronization.
2025-03-01 11:30:38 +01:00
Philip Rebohle
016f05a770 [dxvk] Implement draw batching via VK_EXT_multi_draw 2025-02-23 13:24:28 +01:00
Philip Rebohle
7815b6942d [d3d11] Implement direct draw batching
Not super useful without backend support though.
2025-02-23 13:24:28 +01:00
Philip Rebohle
fc3d3ae331 [dxvk,d3d11] Refactor CS command data allocation
Allows us to allocate a (potentially growing) array of
arbitrary data structures for a CS command.
2025-02-23 13:24:28 +01:00
Philip Rebohle
20dc389ab7 [d3d11] Skip unnecessary iterations when binding graphics UAVs
Some games will unconditionally use a high index for UAVStartSlot.
2025-02-23 12:06:51 +01:00
Philip Rebohle
9f9d51d52c [d3d11] Lazy-bind pixel shader UAVs
Moderately cursed because PS UAVs are also available to other graphics
stages.
2025-02-23 12:06:51 +01:00
Philip Rebohle
9389456d20 [d3d11] Lazy-bind compute shader UAVs
And factor UAV counter updates out of binding.
2025-02-23 12:06:51 +01:00
Philip Rebohle
69171873fa [d3d11] Add compile-time debug flag for lazy binding 2025-02-23 12:06:51 +01:00
Philip Rebohle
c0983a32be [d3d11] Reset dirty bindings on command submission 2025-02-23 12:06:51 +01:00
Philip Rebohle
3e6dfcfb15 [d3d11] Reset dirty tracking when re-applying context state 2025-02-23 12:06:51 +01:00
Philip Rebohle
9d890c75ac [d3d11] Don't template methods that restore shader bindings
This was only needed because Bind* methods were also templated.
2025-02-23 12:06:51 +01:00
Philip Rebohle
771f14c466 [d3d11] Refactor BindUnorderedAccessView
We won't do lazy bindings for UAVs, but at least bring this function
in line with the rest of the binding functions.
2025-02-23 12:06:51 +01:00
Philip Rebohle
b0d881046f [d3d11] Lazy-bind samplers 2025-02-23 12:06:51 +01:00
Philip Rebohle
f2ab76c8db [d3d11] Lazy-bind shader resources 2025-02-23 12:06:51 +01:00
Philip Rebohle
4fdbfffdcc [d3d11] Lazy-bind constant buffers 2025-02-23 12:06:51 +01:00
Philip Rebohle
41ec7b6a02 [d3d11] Track shader stages with dirty bindings as well as used bindings 2025-02-23 12:06:51 +01:00
Philip Rebohle
a135e01f89 [dxvk] Unroll merged indirect draws as necessary 2025-02-20 13:30:31 +01:00
Philip Rebohle
a2c9c0f740 [d3d11] Use resource cookies for draw buffer tracking
Avoids keeping draw buffers alive when the app stops using indirect
draws. Unlikely to have caused issues in practice, but draw buffers
are not part of the API state to begin with.
2025-02-19 19:34:52 +01:00
Philip Rebohle
07f7ccdc96 [dxvk,d3d11] Fix draw buffer tracking for DrawAuto
Not like anybody uses this feature, but we need to both check for
hazards and make sure the SO counter actually gets tracked. Use
the existing draw buffer mechanism for this.
2025-02-19 19:34:52 +01:00
Philip Rebohle
813ae020b6 [d3d11] Flush more around non-multisampled render passes 2025-02-11 16:14:53 +01:00
Philip Rebohle
3aeedb9c98 [d3d11] Forward DiscardResource calls to backend for images 2025-02-10 16:13:31 +01:00
Philip Rebohle
45da7d6678 [d3d11] Fix rectangle check in ClearView
It is legal to pass a potentially invalid pointer if NumRects is 0.
Fixes validation errors in TopSpin 2k25.
2024-12-09 17:43:53 +01:00
Philip Rebohle
1d2d05dde0 [d3d11] Clean up some texture map mode checks 2024-11-08 11:19:21 +01:00
Philip Rebohle
ae9024492b [d3d11] Devirtualize context method forwarding 2024-10-23 16:56:22 +02:00
Philip Rebohle
df60a061a4 [d3d11] Throttle resource uploads via UpdateSubresource
Otherwise, some games (e.g. Frostpunk, New World) end up allocating over
a gigabyte of staging memory.
2024-10-08 17:46:18 +02:00
Philip Rebohle
ad1f70beea [dxvk] Support format conversion in copyImageToBuffer 2024-10-08 17:46:18 +02:00
Philip Rebohle
f67c8dd1da [dxvk] Support format conversion in copyBufferToImage 2024-10-08 17:46:18 +02:00
Philip Rebohle
c614e537a9 [dxvk] Remove alignment parameter from staging buffers
Just align all suballocations to 256 bytes as usual.
2024-10-08 17:46:18 +02:00
Philip Rebohle
813524c146 [d3d11] Remove texel buffer path for ClearUAV
Instead, recreate the image with the given view format as
necessary. Most of the time we will not actually need this.
2024-10-06 08:47:42 +02:00
Philip Rebohle
b4e69dce76 [dxvk] Remove DxvkImageViewCreateInfo 2024-09-28 01:50:23 +02:00
Philip Rebohle
8195bea63e [dxvk] Remove DxvkBufferViewCreateInfo
Use the new key struct directly to avoid unnecessary struct conversion.
2024-09-28 01:21:07 +02:00
Philip Rebohle
1cefe90ce7 [d3d11] Don't use data buffer for small buffer updates
Embed an array instead and lower the size threshold.
2024-09-28 01:05:40 +02:00
Philip Rebohle
01a7457a6f [dxvk] Remove createImageView function
Use the image's method instead, like we already do for buffers.
2024-09-28 00:03:56 +02:00
Philip Rebohle
25076d9220 [dxvk] Rework image view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
9a51849920 [d3d11] Use allocation cache for dynamic buffers 2024-09-26 17:37:50 +02:00
Philip Rebohle
088ba404a6 [dxvk] Rework buffer view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
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
1c30bc92bb [d3d11] Validate viewport parameters
And skip invalid calls. Fixes Senran Kagura Peach Ball.
2024-08-23 14:39:56 +02:00
Philip Rebohle
5ded7d67f0 [d3d11] Implement UpdateSubresource bug if native command lists are disabled 2024-02-22 16:07:24 +01: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
Philip Rebohle
92dc61f161 [d3d11] Fix up UAV clears for A8_UNORM 2023-08-24 13:12:07 +02:00