Commit Graph

426 Commits

Author SHA1 Message Date
Philip Rebohle 3cbd109020
[dxvk] Remove redundant null pointer check for framebuffer
Not necessary because we're *always* calling updateFramebuffer
before startRenderPass.
2020-05-02 11:36:31 +02:00
Philip Rebohle 2967f567d8
[dxvk] Introduce performClear helper 2020-05-02 11:36:31 +02:00
Philip Rebohle 46f860f93e
[dxvk] Don't flush memory in changeImageLayout 2020-05-02 11:36:28 +02:00
Philip Rebohle 7b8a65589e [dxvk] Use null descriptors for unbound resources
This way we won't have to recompile pipelines any time the app
unbinds a resource.
2020-04-30 16:36:59 +02:00
Philip Rebohle 2a25e3f899 [dxvk] Skip draws if no index buffer is bound
It doesn't make much sense to bind the null buffer here, as we'd
just draw the same vertex over and over again.
2020-04-30 16:36:59 +02:00
Philip Rebohle 6d5f5580fb
[dxvk] Use correct size to clear zero buffer 2020-04-23 20:49:59 +02:00
Philip Rebohle bea16263e4
[dxvk] Use GPU-local buffer in clearCompressedColorImage
Saves VA space in applications that do not initialize their textures..
2020-04-21 18:10:09 +02:00
Joshua Ashton bbe681d9ca [dxvk] Fix incorrect logic in resolveDepthStencilImage
This fallbath check path should be triggered if we aren't currently using the fb.

Impacts #1537
2020-04-03 11:20:21 +02:00
Philip Rebohle 304dad2d2e
[dxvk] Fix dumb typo in changeImageLayout 2020-03-08 03:18:34 +01:00
Philip Rebohle 81c3daa3d0
[dxvk] Remove image renaming
Broken by design, has to be implemented by client APIs instead.
2020-01-23 22:21:45 +01:00
Philip Rebohle 073669b7e7 [dxvk] Don't enable VK_KHR_maintenance1, VK_KHR_maintenance2
Core in Vulkan 1.1.
2020-01-17 17:46:59 +01:00
Philip Rebohle 41a91cbae6 [dxvk] Implement image swapping 2020-01-16 18:50:23 +01:00
Philip Rebohle b9258c0c49
[dxvk] Separate gfx resource hazard checking and barrier emission
Otherwise, when performing three draws with the same storage buffers or
storage images bound, we don't emit a barrier between the 2nd and 3rd
draw since the tracking information gets cleared by the second draw.

Fixes #1262.
2019-12-11 13:45:57 +01:00
Philip Rebohle 1ae7d4b302
Revert "[dxvk] Don't clear bind mask for unbound UBOs and samplers"
For some bizarre reason, this crashes Star Citizen. The reason might be
that we create multiple pipelines with identical pipelines when using a
state cache, which used to crash some drivers in the past.

Fixes #1266.

This reverts commit 00a064e32b.
2019-12-04 12:24:25 +01:00
Philip Rebohle 4c0e4fba0c
[dxvk] Don't return a value from updateShaderResources
We're checking the bind point all the time anyway, so the previous
design was inconsistent.
2019-11-28 15:25:12 +01:00
Philip Rebohle 2aa1ff414c
[dxvk] Bind descriptor sets at descriptor update time
Gets rid of one 'if' per draw/dispatch and two functions.
2019-11-28 15:17:42 +01:00
Philip Rebohle 00a064e32b
[dxvk] Don't clear bind mask for unbound UBOs and samplers
These don't need special treatment, so we really don't need to
recompile the pipeline if they are not bound.
2019-11-28 00:55:36 +01:00
Philip Rebohle 2d1fb52b2f
[util] Reimplement Signal
The new implementation is more akin to D3D12 fences or timeline
semaphores, and should make implementing similar concepts easier.
2019-11-26 16:11:46 +01:00
Philip Rebohle 014798161c
[dxvk] Avoid some unnecessary barriers around render target clears 2019-11-18 19:36:19 +01:00
Philip Rebohle 44c0f96fc1
[dxvk] Pause transform feedback on buffer updates
Otherwise, we might override a currently bound transform
feedback buffer or counter buffer. Fixes Unity Engine.
2019-10-26 19:57:39 +02:00
Philip Rebohle 3c4a57acc6
[dxvk] Fix bogus xfb buffer update check 2019-10-26 19:40:32 +02:00
Philip Rebohle 320e0de4a0
[dxvk] Handle xfb barriers in commitGraphicsBarriers
Avoids spilling the render pass when switching xfb buffers.
2019-10-26 17:44:29 +02:00
Philip Rebohle 5b66f1ec0b
[dxvk] Replace buffer in updateBuffer even outside of render passes
Needed to avoid barriers arount D3D11 UAV counter buffer updates.
2019-10-26 17:44:29 +02:00
Philip Rebohle 83fc15c594
[dxvk] Force-update draw buffer for graphics pipeline barrier checks 2019-10-26 12:41:40 +02:00
Philip Rebohle c44d30d78b
[dxvk] Consider indirect draw buffer in graphics pipeline barriers 2019-10-26 04:13:05 +02:00
Philip Rebohle f60d1db1f1
[dxvk] Consider vertex/index buffers in graphics pipeline barriers
Leaving these out was an oversight.
2019-10-26 04:12:32 +02:00
Philip Rebohle e918104ef3
[dxvk] Introduce checkGfxImageBarrier 2019-10-26 03:56:57 +02:00
Philip Rebohle 7a78852776
[dxvk] Introduce checkGfxBufferBarrier 2019-10-26 03:56:52 +02:00
Philip Rebohle 2b812f07c1
[dxvk] Move finalizeDraw into commitGraphicsState
There is no readon to perform this after the draw anymore.
2019-10-26 03:55:03 +02:00
Philip Rebohle 4b0a5dffb2
[dxvk] Support component mappings in blitter 2019-10-16 20:00:38 +02:00
Philip Rebohle 0d7f658f96
[dxvk] Implement framebuffer-based blit 2019-10-16 20:00:38 +02:00
Philip Rebohle 6234a1a6b0
[dxvk] Support arbitrary source texture coordinates in blitter 2019-10-16 02:45:44 +02:00
Philip Rebohle 859ac59e6c
[dxvk] Support multisampled destinations in blitter
Apparently this is required for some D3D9 content.
2019-10-16 02:17:55 +02:00
Philip Rebohle e747315ba6
[dxvk] Support both linear and nearest samplers in blitter 2019-10-16 02:08:04 +02:00
Philip Rebohle 6ea21d57fe
[dxvk] Factor out mip gen classes and rename them to DxvkMetaBlit*
Since mip map generation is a blit operation, we can make a more
general-purpose blitter and implement mip map generation on top
of that.
2019-10-16 01:52:14 +02:00
Philip Rebohle b67e5809ba
[dxvk] Fix buffer usage flags in commitGraphicsBarriers
Only checking for one single usage flag is incorrect since
buffers can have both the storage buffer and storage texel
buffer usage bits set.
2019-10-13 03:18:08 +02:00
Philip Rebohle 950ea21b83
[dxvk] Don't rely on binding mask in commitGraphicsBarriers
We can't actually use that here since we check barriers before
updating shader resources, unlike on the compute path. Check
all resources manually instead.
2019-10-13 02:19:48 +02:00
Philip Rebohle 0e578adcf5
[dxvk] Don't clear binding masks in update*Pipeline
Has no effect anymore since the entire mask gets
overridden in updateShaderResources anyway.
2019-10-13 02:18:09 +02:00
Philip Rebohle 0a5b427ded
[dxvk] Add function to insert framebuffer read-back barriers
Required for some D3D9 content.
2019-10-13 02:00:10 +02:00
Philip Rebohle 41cb5ab5f7
[dxvk] Add dependency flag parameter to emitMemoryBarrier
Will be needed for framebuffer-local barriers inside render passes.
2019-10-13 01:51:29 +02:00
Philip Rebohle 8446c28de1
[dxvk] Remove spill parameter from bindRenderTargets
No longer needed.
2019-10-13 01:44:31 +02:00
Philip Rebohle 4360021539
[dxvk] Implement accurate barrier tracking for draws with side effects
Similar to how this is handled for compute shaders, with some caveats:
- The barriers are never actually emitted, only tracked. Spilling the
  render pass will reset the barriers as it acts as a full barrier.
- Doing this for all draws and all resources would be prohibitively
  expensive, so whenever switching between pipelines with side effects
  and pipelines without side effects, we'll spill the render pass.
2019-10-13 01:44:28 +02:00
Philip Rebohle baf81473a6
[dxvk] Introduce HasStorageDescriptors to signify pipeline side effects 2019-10-13 01:43:18 +02:00
Philip Rebohle c5676d3108
[dxvk] Remove incorrect framebuffer-space barriers
We're technically required to use VK_DEPENDENCY_BY_REGION_BIT,
but that isn't actually good enough.
2019-10-12 23:54:54 +02:00
Philip Rebohle d8c3002b92
[dxvk] Don't use dynamic storage buffers
Doesn't really help in pracrice, but getting rid of them reduces
the number of dynamic offsets we have to update per draw/dispatch.
2019-10-11 14:33:45 +02:00
Philip Rebohle 0068740341
[dxvk] Optimize invalidateBuffer for use with uniform buffers
Since this is by far the most common use case for this
method, an early-out path helps save a bit of CPU time.

Ditch dynamic descriptor set offsets for storage buffers
at the same time since it does not seem to benefit any
real-world applications.
2019-10-11 14:16:47 +02:00
Philip Rebohle 594f04d4ed
[dxvk] Dirty framebuffer in beginRecording
This guarantees that the framebuffer is never null.
2019-10-11 12:19:45 +02:00
Philip Rebohle 48b3b3ee85
[dxvk] Use float format for sampled unbound image views
Fixes validation errors in many cases if a texture is not bound.
2019-10-11 02:58:39 +02:00
Philip Rebohle 2c974cbe1e
[dxvk] Validate graphics state in commitGraphicsState
Same idea as for the related compute work.
2019-10-10 23:56:54 +02:00
Philip Rebohle 649c8d10d6
[dxvk] Validate compute state in commitComputePipelines
This way we can implement early-out for invalid dispatch calls
and save a few validation checks later in the pipeline.
2019-10-10 23:56:54 +02:00