Philip Rebohle
9c6209fbf5
[d3d11] Fix reference counting for state objects
...
Fixes various wine test failures. Also, state objects are now
allocated in the hash map itself rather than a wrapped COM object.
2019-10-14 01:27:59 +02:00
Philip Rebohle
accbc8828c
[d3d11] Return error if no desc is provided for Create*State methods
...
Fixes wine test failures.
2019-10-14 01:08:31 +02:00
Philip Rebohle
bd58f1a913
[d3d11] Don't sync CS thread if resource to map is already in use
...
SynchronizeCsThread can only update the in-use state from available
to in-use, so doing this on a resource that is already in-use is not
necessary. May improve performance in combination with DO_NOT_WAIT.
2019-10-14 00:14:00 +02:00
Philip Rebohle
12f0f8b13f
[d3d11] Don't use a state object for default blend state
2019-10-13 23:15:23 +02:00
Philip Rebohle
c30fd8fb97
[d3d11] Don't use a state object for default depth-stencil state
2019-10-13 23:15:23 +02:00
Philip Rebohle
b0231403fe
[d3d11] Don't use a state object for default rasterizer state
2019-10-13 23:15:23 +02:00
Philip Rebohle
a89c662984
[d3d11] Introduce ResetState and use it for ClearState
...
ClearState gets used a lot in games that use deferred
contexts, so we should make sure it's fast. Since we
apply default state everywhere, there is no need to
perform any expensive RestoreState operations.
Reduces the amount of time spent on ClearState on the
CS thread by ~40%, and by ~90% on the calling thread.
2019-10-13 23:15:23 +02:00
Philip Rebohle
dbe8b09b05
[dxvk] Don't store sampler description in sampler objects
...
We aren't using this anywhere in the backend or client APIs.
2019-10-13 04:36:33 +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
b25ab4155b
[dxvk] Remove outdated comment
2019-10-13 02:01:14 +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
102a18060e
[d3d11] Don't spill render pass when rebinding render targets
...
The backend handles this now, so it's no longer necessary.
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
803ec3542d
[dxbc] Fix sample positions
...
From the D3D11.3 functional specification:
"The sample position is relative to the pixel's center"
Fixes wine test failures.
2019-10-11 18:41:10 +02:00
Philip Rebohle
3a39027987
[d3d11] Add more rigid validation for buffer creation
...
Fixes several wine test failures.
2019-10-11 17:32:46 +02:00
Philip Rebohle
762df0bedf
[d3d11] Change ValidateBufferProperties to NormalizeBufferProperties
2019-10-11 17:23:02 +02:00
Philip Rebohle
409991b9db
[d3d10] Fix reported bind flags for D3D10 resources
...
Turns out that the UAV bind flag remains set in the D3D10 description,
even though D3D10 does not support the feature. Fixes wine test failures.
2019-10-11 17:15:33 +02:00
Philip Rebohle
127e037627
[d3d11] Validate texture array size
...
Fixes a wine test failure and possibly prevents invalid Vulkan API usage.
2019-10-11 17:11:01 +02:00
Philip Rebohle
554b77b47a
[d3d11] Initialize feature level to zero in D3D11CreateDevice
...
Fixes a wine test failure.
2019-10-11 17:01:23 +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
bd5630439e
[dxvk] Inline freeBufferSlice implementation
...
May save a cycle or two in invalidateBuffer.
2019-10-11 13:06:55 +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
e615416b31
[dxvk] Fix tessellation validation
...
Prevents crashes in case an app tries to use tessellation with
an incorrect primitive topology.
2019-10-11 00:04:06 +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
Philip Rebohle
63cc8cdd35
[dxvk] Move descriptor set updates to updateShaderResources
...
Saves two state flags and allows us to move the descriptor info
array into the function itself.
2019-10-10 22:48:06 +02:00
Philip Rebohle
7df3b409c3
[dxvk] Move dynamic descriptor offset array to stack
...
There's absolutely no reason to store it in the object.
2019-10-10 22:19:31 +02:00
Philip Rebohle
a743ba6531
[dxvk] Use memcmp replacement for pipeline state lookup
...
Measured to be over twice as fast as memcmp on Ryzen for the
512-byte graphics pipeline state struct, achieving two cycles
per iteration.
2019-10-07 22:01:48 +02:00
Philip Rebohle
5cb7be2454
[dxvk] Implement state cache v6 -> v7 conversion
2019-10-07 22:01:48 +02:00
Philip Rebohle
345e263a3b
[dxvk] Increase maximum spec constant count to 12
...
Fills some padding created by the 32-byte alignment.
2019-10-07 22:01:48 +02:00
Philip Rebohle
782b021690
[dxvk] Move compute pipeline state to dxvk_graphics_state.h
2019-10-07 22:01:48 +02:00
Philip Rebohle
e086db5ce5
[dxvk] Use new struct for specialization constant info
...
Stylistic reasons.
2019-10-07 22:01:47 +02:00
Philip Rebohle
b2087b2e7e
[dxvk] Use packed blend state
2019-10-07 22:01:47 +02:00
Philip Rebohle
079b480602
[dxvk] Use packed depth-stencil state
2019-10-07 22:01:47 +02:00
Philip Rebohle
a933bec72c
[dxvk] Use packed multisample state
2019-10-07 22:01:47 +02:00
Philip Rebohle
09c813c934
[dxvk] Use packed rasterizer state
2019-10-07 22:01:47 +02:00
Philip Rebohle
a5ab88d8f2
[dxvk] Use packed input layout state
...
Also move attribute and binding descriptions to the end
so that comparisons are more likely to fail early.
2019-10-07 22:01:47 +02:00
Philip Rebohle
c0ae4e38eb
[dxvk] Use packed input assembly state
2019-10-07 22:01:47 +02:00
Philip Rebohle
8d09aa12da
[dxvk] Move DxvkGraphicsPipelineStateInfo to new file
...
We're going to put a lot of code here, so try to keep things clean.
2019-10-07 22:01:47 +02:00
Philip Rebohle
9dad44a6b1
[dxvk] Prepare for pipeline state changes and bump cache format to v7
...
One of the changes includes hard-coding certain constants into the old
pipeline state structs, since changing the constants would invalidate
any old state cache and making the conversion pointless.
2019-10-07 22:01:47 +02:00
Philip Rebohle
32dff89b2d
[dxvk] Don't use alignas(16) for DxvkMetaClearArgs members
...
Instead, pad members explicitly. This is necessary because GCC
makes incorrect assumptions about stack alignment on 32-bit.
2019-10-07 22:01:47 +02:00
Joshua Ashton
ca634ec484
[dxvk] Add missing {} to border color list
...
Fixes a warning when compiling with Clang
2019-10-06 00:28:19 +02:00