Commit Graph

641 Commits

Author SHA1 Message Date
Philip Rebohle 5595844f75 [dxvk] Add explicit buffer/image memory barrier methods
Useful for interop.
2023-03-18 00:50:42 +01:00
Philip Rebohle fa8cf50263 [dxvk] Implement functionality to import foreign buffers 2023-03-18 00:50:42 +01:00
Philip Rebohle da32453b42 [dxvk] Add submission feedback to command submissions 2023-03-16 20:59:43 +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 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 fea86ef116 [dxvk] Use dynamic depth clip enable for linked pipelines if supported
This way we won't have to compile any vertex shader pipelines twice.
2022-10-24 16:39:24 +02:00
Philip Rebohle d9466eb2b9 [dxvk] Get rid of immutable sampler for resolve operations 2022-09-12 18:59:58 +02:00
Philip Rebohle 044e2e9dff [dxvk] Defer host barriers until the end of the current command buffer 2022-09-08 19:26:55 +02:00
Philip Rebohle c4516c5b04 [dxvk] Improve behaviour when variableMultisampleRate is not supported 2022-09-04 18:28:27 +02:00
Philip Rebohle 735349bf1b [dxvk] Fix barrier typo 2022-09-01 03:35:58 +02:00
Philip Rebohle 43b19f773c [dxvk] Introduce initSparseImage 2022-08-26 05:53:03 +02:00
Philip Rebohle fc0d952edb [dxvk] Introduce copySparsePages{To,From}Buffer 2022-08-26 05:53:03 +02:00
Philip Rebohle d5348a0cf0 [dxvk] Introduce updatePageTable 2022-08-26 05:53:03 +02:00
Philip Rebohle 6f216f9df4 [dxvk] Do not discard sparse buffers
This would only blow up.
2022-08-26 05:53:03 +02:00
Philip Rebohle e923cc5b69 [dxvk] Change emitGraphicsBarrier to specify a dependency 2022-08-26 05:53:03 +02:00
Philip Rebohle 5117210c93 [dxvk] Fix fb resolve barriers
No idea how that ended up broken *this* badly.
2022-08-25 02:25:23 +02:00
Philip Rebohle 07a1045ffb [dxvk] Add context methods for submission splitting 2022-08-22 15:44:00 +02:00
Philip Rebohle 6f2ff2562d [dxvk] Support splitting command lists into multipe submissions 2022-08-22 15:43:23 +02:00
Philip Rebohle 23c3960f65 [dxvk] Store WSI semaphore pair directly with the command list 2022-08-22 00:07:15 +02:00
Philip Rebohle 3806bd44d8
[dxvk] Change descriptor info to take only one shader stage
And fix the binding index -> descriptor mapping.
This affects D3D9 since the spec constant change.
2022-08-17 22:40:58 +02:00
Philip Rebohle a4848201f8
[dxvk] Update buffer views in commitGraphicsBarriers
Otherwise we might end up accessing stale buffer slices, since this
happens before descriptor updates. This is not needed for compute.

Also fix weird indentation while we're at it.
2022-08-11 13:13:02 +02:00
Philip Rebohle ad020c23f9
[dxvk] Optimize barrier logic
The is*Dirty methods can exit early if the resource to check
is only used for reading. Only call get*Access to check for
write-after-write scenarios.
2022-08-10 20:47:52 +02:00
Philip Rebohle 11fbcd3131
[dxvk] Rework compute barrier handling to use common functions
Cleans up code a bit and should technically even make things a bit
more efficient.
2022-08-10 19:28:35 +02:00
Philip Rebohle 01014c1a2b
[dxvk] Rework checkGfx*Barrier methods 2022-08-10 19:28:35 +02:00
Philip Rebohle ab1d629961 [dxvk] Implement lifetime tracking for graphics pipelines 2022-08-09 13:40:58 +02:00
Philip Rebohle a84beae112 [dxvk] Add flat shading field to pipeline state 2022-08-08 13:34:59 +02:00
Philip Rebohle 26d46e7f80
[dxvk] Handle bound buffers with zero size in the backend 2022-08-07 18:45:17 +02:00
Philip Rebohle 88bdf2b592
[dxvk] Use vertex extent from vertex binding info
Computing this at runtime is fairly expensive, so try to avoid.
2022-08-07 17:58:19 +02:00
Joshua Ashton dff514c924 [dxvk] Add hazard tracking to fragment output state
We need this to set the right pipeline bits for supporting attachment feedback loops on some vendors.
2022-08-06 01:33:30 +01:00
Philip Rebohle b950102233
[dxvk] Don't use MaxNumActiveBindings for descriptor updates 2022-08-06 01:44:56 +02:00
Philip Rebohle 2fe61675bf
[dxvk] Use existing bit mask iterator when updating descriptor sets
And clean up the code a little.
2022-08-05 21:43:11 +02:00
Philip Rebohle 211ad0efcc
[dxvk] Always use init barrier set for initial transition in initImage
This allows us to batch image initialization barriers better.
2022-08-05 12:46:41 +02:00
Philip Rebohle f10be7bc85
[dxvk] Add binding methods that take rvalue references
The goal here is to replace the old methods entirely.
2022-08-04 13:43:32 +02:00
Philip Rebohle 2782afaf8a
[dxvk] Inline pushConstants method
No reason not to.
2022-07-30 17:52:55 +02:00
Philip Rebohle 94ca65d587
[dxvk] Ignore spec constants that are not used by the current pipeline
May reduce the number of pipeline permutations.
2022-07-30 17:42:46 +02:00
Philip Rebohle 05a827703b
[dxvk] Add fence support to command list
Co-authored-by: Derek Lesho <dlesho@codeweavers.com>
2022-07-21 02:14:59 +02:00
Philip Rebohle a178c57aea
[dxvk] Remove barrier argument from render target transition functions
We're always using the same barrier set anyway.
2022-07-20 16:57:27 +02:00
Philip Rebohle 0ba741b7d2
[dxvk] Use copy_commands2 functions for buffer <-> image copies 2022-07-19 15:16:54 +02:00
Philip Rebohle 23846ad577
[dxvk] Use copy_commands2 functions for image copies 2022-07-19 15:16:54 +02:00
Philip Rebohle dc1d82deff
[dxvk] Use copy_commands2 functions for buffer copies 2022-07-19 15:16:54 +02:00
Philip Rebohle f39d49772d
[dxvk] Use copy_commands2 functions for image resolves
Same idea as with blits, don't expose VkImageResolve2.
2022-07-19 14:10:47 +02:00
Philip Rebohle ff81323228
[dxvk] Use copy_commands2 functions for image blits
Don't expose VkImageBlit2 to client APIs since we can't easily
support pNext chains, so just convert the struct internally.
2022-07-19 13:53:28 +02:00
Philip Rebohle 0c79882e84
[dxvk] Use synchronization2 functions for events 2022-07-19 02:27:31 +02:00
Philip Rebohle adb906b18c
[dxvk] Use synchronization2 functions for barriers
We don't really use the new stage/access flags yet, and I'm not sure
whether we will move to them since the benefits seem rather limited.
However, using the functions means we can bypass a lot of internal
translation inside some Vulkan drivers.
2022-07-19 02:27:31 +02:00
Philip Rebohle 17205f5353
[dxvk] Fix formatting in barrier function 2022-07-18 22:49:47 +02:00
Philip Rebohle a1ace8ef21
[dxvk] Clean up misc. code 2022-07-18 14:51:26 +02:00
Philip Rebohle ff39819086
[dxvk] Merge methods to bind a compute pipeline
There is no workload in practice where the same shader will be used
multiple times with different spec constants, so there is no good
reason to have two dirty flags or to split lookup and binding.
2022-07-17 00:09:30 +02:00
Philip Rebohle 39dd25e972
[dxvk] Unconditionally call updateDynamicState
And optimize that instead. The previous check would always succeed anyway
since we'd set unused dynamic states to dirty, which is necessary for us
to update that state once it's actually used by a pipeline.
2022-07-16 14:47:54 +02:00
Philip Rebohle dadc1bc8ff
[dxvk] Add dirty tracking for dynamic depth-stencil state
Significantly reduces the number of API calls and potentially
context rolls when switching between different base pipelines.
2022-07-16 13:27:55 +02:00
Philip Rebohle 2fabc90f46
[dxvk] Add fast path for rasterizer state comparison 2022-07-16 13:21:58 +02:00