Philip Rebohle
b756c229a9
[dxvk] Implement more compact state cache data format (v8)
...
Omits a lot of unnecessary data and considerably reduces
the state cache file size, often by over 80%.
2019-10-18 00:33:50 +02:00
Philip Rebohle
0ac89ccd9e
[util] Add missing != operator to Sha1Hash
2019-10-18 00:33:40 +02:00
Philip Rebohle
4b0a5dffb2
[dxvk] Support component mappings in blitter
2019-10-16 20:00:38 +02:00
Philip Rebohle
d998aaad12
[dxvk] Add some component mapping helpers
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
6290cfdb48
[dxvk] Add class for framebuffer-based blits
2019-10-16 17:31:40 +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
d899bd2d76
[d3d11] Remove obsolete DefaultDesc methods from state classes
2019-10-14 05:28:46 +02:00
Philip Rebohle
68c257fc0d
[d3d11] Fix ref counting for state objects bound to a context
...
Using raw pointers is safe here since the objects never get destroyed
during the lifetime of the context.
2019-10-14 02:06:33 +02:00
Philip Rebohle
1282c2b99e
[d3d11] Fix immediate context reference counting
...
Fixes various wine test failures.
2019-10-14 01:56:34 +02:00
Philip Rebohle
4d0cc3e24e
[d3d11] Don't subclass state objects from ComObject
...
These override reference counting, so we shouldn't use ComObject.
2019-10-14 01:44:37 +02:00
Philip Rebohle
c5c43fb2a4
[d3d11] Allow choosing type wrapper for D3D11DeviceChild base class
...
Allows subclasses to replace ComObject with something else.
2019-10-14 01:44:27 +02:00
Philip Rebohle
dd9a55ecc0
[util] Don't allow multiple inheritance for COM objects
...
This never made any sense whatsoever in the first place.
2019-10-14 01:42:24 +02:00
Philip Rebohle
c281e76bac
[d3d11] Don't get private references for state objects
...
Otherwise we will end up deleting the objects even though they
aren't explicitly heap-allocated. Whoops...
2019-10-14 01:39:54 +02:00
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