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
Joshua Ashton
e8ee7a0790
[util] Fix Sha1 dword extraction
...
Previously we were getting incorrect values here.
The u suffix is no longer necessary, which was originally there to work around a MSVC compiler warning which now doesn't happen under the new code 🤷 ♀
2019-10-06 00:28:19 +02:00
Joshua Ashton
19fa1c405c
[d3d10] Remove unused copies of device ptr in D3D10 wrappers
...
Silences a warning when building with Clang, and removes duplicate unused data.
2019-10-06 00:28:19 +02:00
Joshua Ashton
6d0757520b
[dxgi] Initialize size of DEVMODEW structure
...
The documentation says we should do this.
2019-10-06 00:28:19 +02:00
Philip Rebohle
1117daec24
[dxvk] Don't redundantly clear unused vertex strides to zero
...
We're already doing this when setting the input layout, and we
don't touch the strides in other parts of the code. May save
a handful of CPU cycles.
2019-10-05 16:52:26 +02:00
Philip Rebohle
70ef456911
[meta] Release 1.4.2
2019-10-04 21:07:36 +02:00
Philip Rebohle
02b79fb738
[util] Report Nvidia GPUs for Modern Warfare Remastered
2019-10-04 18:35:36 +02:00
Philip Rebohle
50349d1bfe
[d3d11] Add missing break; in CreateSurface
...
Found by a frog. Initial testing did not check return values.
2019-10-02 12:06:51 +02:00
Philip Rebohle
85581bdace
[util] Move GetAdapterLUID out of DXGI internals
2019-10-02 08:42:22 +02:00
Philip Rebohle
8f00af556e
[d3d11] Implement CreateSurface for D3D11DXGIDevice
...
Documentation for this method is really poor so we'll just try to
make pretty much everything work. Fixes various wine tests.
2019-10-02 02:29:06 +02:00
Philip Rebohle
1366fce0f8
[dxgi] Generate adapter LUIDs if Vulkan does not provide them
...
Needed because winevulkan does not provide adapter LUIDs.
Fixes various wine test failures, and will be required to
get D3D12 (vkd3d) to work on top of our DXGI implementation.
2019-10-02 01:07:18 +02:00
Philip Rebohle
73b9846c4f
[dxgi] Fix some IDXGIAdapter return codes
...
Fixes various wine test failures.
2019-10-02 00:33:06 +02:00
Philip Rebohle
d90d450618
[dxgi] Handle invalid arguments passed to Present1
...
fixes a wine test failure.
2019-10-02 00:19:41 +02:00
Philip Rebohle
f58c1c2d1d
[dxgi] Fix SetFullscreenState behaviour with invalid usage
...
Fixes various wine test failures.
2019-10-02 00:01:26 +02:00
Philip Rebohle
60ff2b8977
[dxgi] Fix GetContainingOutput and GetFullscreenState output pointer
...
We're supposed to keep a reference to the output around and return
that for fullscreen swap chains. Fixes various wine test failures.
2019-10-02 00:00:37 +02:00
Philip Rebohle
8d8f4b9200
[d3d11] Add support for DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE
...
Trivial since we treat back buffers as regular D3D textures.
Fixes a wine test failure.
2019-10-01 23:37:54 +02:00
Philip Rebohle
aa35cdbb18
[d3d11] Fix return code on swap chain creation failure
...
Fixes a wine test failure.
2019-10-01 23:37:54 +02:00
Philip Rebohle
0f15c60192
[d3d11] Use private reference to D3D11 device in D3D11SwapChain
...
Fixes a wine test failure.
2019-10-01 22:26:07 +02:00
Philip Rebohle
0436e6ddce
[dxgi] Fix some return codes in DxgiSwapChain
...
Fixes some wine test failures.
2019-10-01 22:25:37 +02:00
Philip Rebohle
0d1048fa87
[d3d11] Fix error handling in SetMaximumFrameLatency
...
Fixes a wine test failure.
2019-10-01 22:12:23 +02:00
Philip Rebohle
2cb9d34f8f
[dxgi] Fix QueryVideoMemoryInfo return values
...
Fixes a wine test failure.
2019-10-01 22:12:19 +02:00
Philip Rebohle
1e00f8046c
[dxgi] Fix CheckInterfaceSupport UMD version writeback
...
Fixes a wine test failure.
2019-10-01 22:12:16 +02:00
Philip Rebohle
cd82669a85
[dxgi] Fix GetDisplayModeList1 output for DXGI_FORMAT_UNKNOWN
...
Fixes a wine test failure.
2019-10-01 22:12:09 +02:00
Philip Rebohle
f5515075f2
[dxgi] Fix GetDisplayModeList behaviour with a zero mode count
...
Allocate at least one array element so that we don't accidentally
treat the mode list like it was NULL. Fixes a wine test failure.
2019-10-01 22:12:08 +02:00
Philip Rebohle
2f4e4abcac
[dxgi] Fix CheckInterfaceSupport for IDXGIDevice
...
On Windows, this succeeds and reports the D3D9 driver version to the
application.
2019-10-01 15:06:50 +02:00
Philip Rebohle
ab51aac6d7
[dxvk] Implement context-local lookup cache for pipeline objects
...
On hit, looking up a pipeline becomes an extremly cheap O(1) operation,
avoiding a mutex lock and an expensive std::unordered_map lookup. This
works because we don't ever destroy pipeline objects.
2019-09-30 03:42:20 +02:00
Philip Rebohle
35a8cedbc2
[dxvk] Move shader set hash/eq functions into respective structs
...
Makes it easier to use them outside the pipeline manager.
2019-09-30 03:42:20 +02:00
Philip Rebohle
ba5f319809
[dxvk] Use new shader lookup hash in pipeline manager
2019-09-30 02:09:09 +02:00
Philip Rebohle
5115a42b08
[dxvk] Expose key-based lookup hash in DxvkShader
2019-09-30 02:08:09 +02:00
Philip Rebohle
54ff7bf769
[dxvk] Add methods to retrieve shaders from pipeline
2019-09-30 01:54:49 +02:00
Philip Rebohle
59d4e8a36a
[dxbc] Fix NaN handling in not-equal comparison
...
Ne and Dne are unordered in DXBC. Avoid FUnordNotEqual to
avoid potential issues with drivers and debugging tools.
2019-09-30 00:19:47 +02:00
Philip Rebohle
d128d776ad
[dxvk] Re-introduce state check for updateFramebuffer
...
Turns out we broke batching render target clears earlier.
2019-09-28 03:29:52 +02:00
Philip Rebohle
6b5d01c934
[meta] Release 1.4.1
2019-09-27 23:03:23 +02:00
Philip Rebohle
2e6da26ff0
[dxvk] Spoof Nvidia GPU for HITMAN 2
...
This game requires a functioning AGS implementation when it detects
an AMD GPU and complains about missing D3D11 support otherwise.
2019-09-26 19:27:19 +02:00
Philip Rebohle
a920a7275b
[dxvk] Eliminate some redundant state checks
2019-09-26 14:25:56 +02:00
Philip Rebohle
7cdc402a58
[dxvk] Introduce finalizeDraw
...
May improve code gen by reducing function call overhead, in a
similar way as the duplicated checks in commitGraphicsState do.
2019-09-26 01:31:51 +02:00
Philip Rebohle
187748e4d3
[d3d11] Add a comment explaining ID3D11Predicate/ID3D11Query hack
2019-09-25 22:18:08 +02:00
Philip Rebohle
53fe3423e2
[d3d11] Fix GetPredication
2019-09-25 20:55:43 +02:00
Philip Rebohle
b6cf518962
Revert "[dxbc] Always decorate SV_POSITION as invariant"
...
This reverts commit 5ee790a4a3
.
Breaks Shadow of the Tomb Raider on Nvidia for unknown reasons.
2019-09-24 23:01:36 +02:00
Philip Rebohle
5ee790a4a3
[dxbc] Always decorate SV_POSITION as invariant
...
Apparently fixes Z-Fighting in Saints Row IV on Nvidia.
2019-09-24 22:19:43 +02:00
Philip Rebohle
51f1d7725c
[dxvk] Store context flags as a 32-bit integer
...
Might improve code generation for 32-bit builds. We currently
have 31 flags and don't expect any new ones to be added.
2019-09-23 23:34:04 +02:00
Philip Rebohle
8f6df2b7fb
[d3d10] Add some null pointer checks when dealing with resources
...
Also, fix some more awkward formatting.
2019-09-23 21:59:02 +02:00
Philip Rebohle
cb60211ce0
[d3d10] Fix some awkward formatting
2019-09-23 21:47:30 +02:00
Philip Rebohle
f498e742ec
[d3d11] Handle D3D_PRIMITIVE_TOPOLOGY_UNDEFINED correctly
...
Luckily, all known cases where games use UNDEFINED topology fail
validation elsewhere due to missing vertex shaders, but we should
handle this correctly anyway.
2019-09-23 15:20:53 +02:00
Philip Rebohle
e8055f81df
[dxvk] Validate primitive topology in pipeline state
2019-09-23 15:19:46 +02:00
Philip Rebohle
f38cfd592e
[dbxc] Actually fix callc implementation
...
Yeah maybe we should close our blocks properly. There seems to be
no way to generate a callc instruction with fxc so this is untested.
2019-09-22 22:36:42 +02:00
Philip Rebohle
94ce76da6b
[dxbc] Implement label, call and callc instructions
...
Fixes #1200 .
2019-09-22 22:28:58 +02:00
Philip Rebohle
1fa8887c47
[d3d11] Return device lost errors in Present if necessary
2019-09-22 19:20:53 +02:00
Philip Rebohle
11b7b1f1a5
[d3d11] Implement GetDeviceRemovedReason
2019-09-22 19:07:48 +02:00
Philip Rebohle
2e9a836adb
[dxvk] Handle device lost errors on command submission
2019-09-22 19:06:53 +02:00
Philip Rebohle
92d1cf8ae0
[d3d11] Fix CheckFeatureSupport formatting and return code
2019-09-22 15:01:49 +02:00
Entryhazard
252d71e55e
Retrieve the function pointer once ( #1198 )
2019-09-22 10:11:17 +02:00
Philip Rebohle
f37d4b58b6
[dxvk] Explicitly compare resource use count to zero
...
Fixes MSVC compiler warnings.
2019-09-21 19:04:23 +02:00
Philip Rebohle
21b2a9a078
[meta] Release 1.4
2019-09-21 16:15:37 +02:00
Philip Rebohle
a74eceaf46
[dxvk] Bump state cache version to v6
2019-09-21 14:11:51 +02:00
Philip Rebohle
e253183bc2
[dxvk] Apply spec constants to compute shaders as well
2019-09-21 14:11:51 +02:00
Philip Rebohle
e926ceb9cc
[dxvk] Only time pipeline compile times if requested
...
Avoids some unnecessary calls to high_resolution_clock::now().
2019-09-21 13:10:09 +02:00
Philip Rebohle
6ecb74d2c0
[dxvk] Check if xfb buffers have actually changed on binding
...
We should avoid redundant render pass spilling at all costs.
This affects all games using deferred contexts for rendering
due to their implicit use of ClearState and RestoreState.
2019-09-21 05:13:05 +02:00
Philip Rebohle
1347aeba33
[dxvk] Use separate counters for read/write resource usage
...
It is not unrealistic at all to overflow the 18-bit and 14-bit
counters in modern games, so just use two 32-bit counters instead.
Avoid 64-bit atomics due to poor performance on 32-bit builts.
2019-09-21 02:45:23 +02:00
Philip Rebohle
71e74f1810
[d3d11] Disable DO_NOT_WAIT for Overwatch
...
Because of course this game breaks for some people with it enabled.
2019-09-21 01:44:38 +02:00
Philip Rebohle
7514aa1ec8
[d3d11] Implement IDXGIDevice4
2019-09-20 18:06:34 +02:00
Philip Rebohle
32410a4f2b
[dxgi] Implement IDXGISwapChain4
2019-09-20 18:06:34 +02:00
Philip Rebohle
5cb7f26bb7
[dxgi] Implement IDXGIOutput5
2019-09-20 18:06:34 +02:00
Philip Rebohle
3e8a6ec463
[dxgi] Implement IDXGIFactory5
2019-09-20 18:06:34 +02:00
Philip Rebohle
9ed980a962
[dxgi] Include DXGI 1.5 headers
2019-09-20 18:06:34 +02:00
marcin mikołajczak
9941769237
[util] Update comment for FIFA 19+ workaround ( #1197 )
2019-09-20 16:20:26 +02:00
Philip Rebohle
7e7609cac0
Revert "[d3d11] Don't create linearly tiled compressed images"
...
This reverts commit b8888ffe6a
.
This is no longer beneficial since initialization of a
linear image does not stall Map anymore.
2019-09-20 05:59:54 +02:00
Philip Rebohle
e82c87dc52
[d3d11] Implement GetDC / ReleaseDC
2019-09-20 01:44:18 +02:00
Philip Rebohle
028633138a
[d3d11] Implement GDI surface
2019-09-20 01:44:18 +02:00
Joshua Ashton
014870b1ff
[util] Add helpers for GDI/DDI interop
2019-09-20 01:44:18 +02:00
Philip Rebohle
c9a0f06ff4
[d3d11] Enable allowMapFlagNoWait by default
...
We still keep the option around so that in case of regressions,
users can check if disabling this option fixes their issue.
2019-09-20 01:44:02 +02:00
Philip Rebohle
e9fcf64a8c
[dxvk] Only wait for writes when mapping with D3D11_MAP_READ
2019-09-20 01:44:02 +02:00
Philip Rebohle
5b5927dd41
[dxvk] Implement read-write tracking for resources
2019-09-20 01:44:01 +02:00
Philip Rebohle
63183141bc
[dxvk] Implement read/write tracking in lifetime tracker
...
This way we will be able to more accurately determine how a
resource is going to be used by the GPU, and we can also cut
unnecessary atomic operations for non-resource objects.
2019-09-20 01:44:01 +02:00
Philip Rebohle
136ad3e4c9
[d3d11] Write to image memory directly in InitHostVisibleTexture
...
Avoids performing a potentially expensive copy or clear operation
on the GPU.
2019-09-20 01:44:01 +02:00
Philip Rebohle
ae4a5232aa
[d3d11] Use VK_IMAGE_LAYOUT_PREINITIALIZED for mapped images
...
This way we can directly write image data directly to the image
without having to do it on the GPU.
2019-09-20 01:44:01 +02:00
Philip Rebohle
eb0a492f51
[dxvk] Add initial layout to initImage
...
Allows us to initialize an image from the PREINITIALIZED layout.
2019-09-20 01:44:01 +02:00
Philip Rebohle
4570b34456
[dxvk] Add initial layout to image create info
2019-09-20 01:44:01 +02:00
Philip Rebohle
51c6eb5cdb
[util] Enable FIFA 19 workaround for FIFA 20 as well
...
Same procedure as every year.
2019-09-20 00:50:01 +02:00
Philip Rebohle
48417c7d19
[d3d11] Implement DiscardView1
...
Basically just behave like DiscardView if no rects are passed to
the function, otherwise ignore the call since we can't discard
individual rectangles in any meaningful way.
2019-09-19 13:56:50 +02:00
Philip Rebohle
0338b70596
[dxgi] Implement IDXGIVkInteropAdapter for IDXGIAdapter
2019-09-18 14:53:44 +02:00
Philip Rebohle
9af8387e4e
[dxgi] Define IDXGIVkInteropAdapter interface
...
Can be used to pull the Vulkan instance and physical device from
a DXGI adapter.
2019-09-18 14:53:44 +02:00
Philip Rebohle
9e02b6b433
[dxgi] Rename IDXGIVkAdapter -> IDXGIDXVKAdapter
...
This interface exposes DXVK internals and cannot be used for
Vulkan interop. We shouldn't pretend like it could.
2019-09-18 14:07:13 +02:00
Philip Rebohle
bc853d0e48
[d3d11] Only use mapped buffer for images if bind flags are non-zero
...
We really shouldn't use the intermediate buffer for DYNAMIC images
that can only ever be used for copy commands, since the copies will
be redundant.
2019-09-18 13:15:22 +02:00
Philip Rebohle
65428da3fe
[util] Enable allowMapFlagNoWait for Warhammer II
2019-09-18 13:14:53 +02:00
Philip Rebohle
abf89356cd
[d3d11] Report unified memory if all heaps are device-local
...
Together with mapping default resources, this may or may not
help performance in some applications on integrated graphics.
2019-09-17 23:52:02 +02:00
Philip Rebohle
518d06b9c2
[d3d11] Enable D3D11.3 MapOnDefaultTextures feature
2019-09-17 23:39:06 +02:00
Philip Rebohle
c59ab258a5
[d3d11] Implement ReadFromSubresource and WriteToSubresource
2019-09-17 23:39:06 +02:00
Philip Rebohle
e764f05a1a
[d3d11] Allow pMappedResource to be null when mapping images
...
This is required to implement mapping default textures correctly.
2019-09-17 23:39:06 +02:00
Philip Rebohle
6ce8450b12
[d3d11] Implement D3D11.2 MapOnDefaultBuffers feature
...
Basically just allocates the buffer on a host-visible memory
type, like DYNAMIC or STAGING buffers depending depending on
the CPU access flags.
2019-09-17 17:47:33 +02:00
Philip Rebohle
2cdbe2e6df
[d3d11] Move GetMemoryFlagsForUsage into D3D11Buffer
...
D3D11Buffer is the only user of this function and the code sharing
potential is limited. This allows us to implement the memory type
selection for buffers in one single place rather than two.
2019-09-17 17:21:10 +02:00
Philip Rebohle
dda89a075e
[d3d11] Report MapOnDefaultTextures feature as unsupported
...
Bad things can happen if we leave this undefined.
2019-09-17 14:21:19 +02:00
Joshua Ashton
ebc394218a
[dxvk] Replicate R component of border color for depth compare samplers ( #1194 )
...
Only the red component matters for these samplers -- this lets us pick the best colour based on that alone, as we could get garbage data that doesn't matter in the other components.
2019-09-17 11:15:09 +02:00
Philip Rebohle
2ef34a055d
[d3d11] Implement ID3D11Device5
2019-09-16 16:37:37 +02:00
Philip Rebohle
56daf44d4c
[d3d11] Implement ID3D11Device4
2019-09-16 16:26:18 +02:00
Philip Rebohle
3ba541fde6
[d3d11] Implement D3D11.4 feature queries
2019-09-16 16:22:52 +02:00
Philip Rebohle
6ab6b4a209
[d3d11] Include D3D11.4 headers
2019-09-16 16:14:47 +02:00
Philip Rebohle
fdf560150f
[d3d11] Implement ID3D11Device3
2019-09-16 16:13:34 +02:00
Philip Rebohle
b0f6655b92
[d3d11] Implement ID3D11Query1
2019-09-16 16:13:34 +02:00
Philip Rebohle
84c80a4aaf
[d3d11] Implement ID3D11UnorderedAccessView1
2019-09-16 16:13:34 +02:00
Philip Rebohle
81935e1684
[d3d11] Implement ID3D11ShaderResourceView1
2019-09-16 14:27:44 +02:00
Philip Rebohle
345f8694e8
[d3d11] Implement ID3D11RenderTargetView1
2019-09-16 14:27:44 +02:00
Philip Rebohle
0758f14a35
[d3d11] Implement ID3D11Texture2D1 and ID3D11Texture3D1
2019-09-16 14:27:44 +02:00
Philip Rebohle
d9f409b92f
[d3d11] Implement ID3D11RasterizerState2
2019-09-16 13:41:31 +02:00
Philip Rebohle
f9d9307a28
[d3d11] Implement ID3D11DeviceContext4
2019-09-16 13:41:31 +02:00
Philip Rebohle
0599a82dee
[d3d11] Implement ID3D11DeviceContext3
2019-09-16 13:41:31 +02:00
Philip Rebohle
17a6c4168e
[dxbc] Implement stencil ref export from fragment shaders
...
This is an optional feature in D3D11.3, but easy enough to support.
2019-09-16 12:42:15 +02:00
Philip Rebohle
b7bc51c3bd
[d3d11] Use shaderStorageImageReadWithoutFormat for typed UAV loads
2019-09-16 12:42:15 +02:00
Philip Rebohle
7fae4a41e8
[d3d11] Add definitions for feature levels 12_0 and 12_1
...
Mostly useful for debugging as we're not going to support these
feature levels for now.
2019-09-16 12:42:14 +02:00
Philip Rebohle
51ff65fbc5
[d3d11] Implement D3D11.3 feature queries
2019-09-16 12:42:14 +02:00
Philip Rebohle
aad44458f7
[d3d11] Include D3D11.3 headers
2019-09-16 12:42:14 +02:00
Philip Rebohle
26afaba410
[dxbc] Implement MSAD4 instruction
...
Apparently we're required to support this for Direct3D 11.2+.
There are currently no known games that require this instruction.
2019-09-16 12:42:14 +02:00
Philip Rebohle
72a356fe01
[d3d11] Implement GetResourceTiling
...
When called on a regular resource, native D3D11 will zero
out the return values. We should match this behaviour.
2019-09-16 12:42:14 +02:00
Philip Rebohle
7ba7178d14
[d3d11] Implement ID3D11Device2
...
Adds some extra validation to resource creation so that
apps cannot accidentally create tiled resources.
2019-09-16 12:42:14 +02:00
Philip Rebohle
c1a7243811
[d3d11] Implement ID3D11DeviceContext2
...
We don't support tiled resources nor markers for now.
Marker support could be added through debug layers.
2019-09-16 12:42:14 +02:00
Philip Rebohle
6e28ab956d
[d3d11] Implement D3D11.2 feature queries
2019-09-16 12:42:14 +02:00
Philip Rebohle
d7476f3fb8
[d3d11] Include D3D11.2 headers
2019-09-16 12:42:14 +02:00
Philip Rebohle
f2d461ab5b
[d3d11] Prevent log spam from repeated Get/SetResourceMinLOD calls
2019-09-16 12:41:44 +02:00
Philip Rebohle
3e17ccfaaa
[d3d11] Implement missing D3D11_FEATURE_D3D9_OPTIONS feature query
2019-09-16 02:21:46 +02:00
Philip Rebohle
c852b6de34
[d3d11] Optimize viewport updates if there is only one single viewport
2019-09-13 14:38:51 +02:00
Philip Rebohle
160b684d5a
[d3d11] Add range check for scissors and make failing it unlikely
2019-09-13 11:49:00 +02:00
Philip Rebohle
e2808309a3
[metæ] Release 1.3.4
2019-09-08 21:03:46 +02:00
Philip Rebohle
f57c021ab5
[util] Enable d3d11.allowMapFlagNoWait for Control
2019-09-08 10:35:57 +02:00
Philip Rebohle
b8888ffe6a
[d3d11] Don't create linearly tiled compressed images
...
Quantum Break uses this for texture uploads, which causes unnecessary
GPU synchronization and queue submissions when doing texture uploads.
2019-09-07 20:16:16 +02:00
orbea
c57e63f7d2
Work around build failure with winegcc/clang. ( #1184 )
...
Fixes #1182 .
2019-09-05 18:01:33 +02:00
Philip Rebohle
b0552751ad
[d3d11] Fix incorrect AddRef -> Release
...
Spotted by @jp7677
2019-08-29 21:24:47 +02:00
Philip Rebohle
2776ef43a3
[meta] Release 1.3.3
2019-08-29 20:56:47 +02:00
Philip Rebohle
30d19cd0f2
[d3d11] Rename some hazard tracking methods for clarity
2019-08-29 19:10:53 +02:00
Philip Rebohle
6be124e2cd
[d3d11] Check for conflicts withing RTV and UAV lists upon binding them
2019-08-29 19:10:53 +02:00
Philip Rebohle
e07ef1ec40
[d3d11] Resolve pipeline hazards when binding render targets
2019-08-29 19:10:53 +02:00
Philip Rebohle
a36f056572
[d3d11] Resolve pipeline hazards when binding compute shader UAVs
2019-08-29 19:10:53 +02:00
Philip Rebohle
c8c781c88b
[d3d11] Add check whether a viewed resource has a given bind flag
2019-08-29 19:10:50 +02:00
Philip Rebohle
afc8e4c29d
[d3d11] Filter redundant OMSetRenderTargets calls
...
Since rebinding render targets is a rather expensive
operation, we should avoid doing so whenever possible.
Affects Resident Evil 2 and Devil May Cry 5.
2019-08-26 23:59:08 +02:00
Philip Rebohle
4789790087
[d3d11] Remove outdated comment
...
We actually handle this properly now.
2019-08-26 23:43:47 +02:00
Philip Rebohle
5756e5c921
[d3d11] Check for shader resource view hazards
...
Fixes incorrect behaviour in games that try to use a currently bound
UAV or render target as a shader resource at the same time.
Fixes visual artifacts in Shining Resonance Refrain on AMD hardware.
2019-08-26 23:43:47 +02:00
Philip Rebohle
137589d755
[d3d11] Add state to track potentially hazardous bound SRVs
2019-08-26 23:29:01 +02:00
Philip Rebohle
4064dd3737
[d3d11] Add bound compute shader UAV mask
...
Will be used for efficient hazard tracking.
2019-08-26 23:29:01 +02:00
Philip Rebohle
8208cedfa9
[d3d11] Add common view info struct to all view types
...
Will be used for hazard detection.
2019-08-26 23:29:01 +02:00
Philip Rebohle
5ae5053a2a
[d3d11] Remove templated SetUnorderedAccessViews
...
Not needed because the CS and OM paths are separate anyway.
2019-08-26 23:29:01 +02:00
Philip Rebohle
08e3500beb
[d3d11] Don't use .at()
2019-08-26 23:29:01 +02:00
Philip Rebohle
473025a93b
[dxvk] Add function to find set bits in binding mask
2019-08-26 23:29:01 +02:00
Philip Rebohle
d2d19b0dec
[dxvk] Add function to set bind mask bit to a given value
2019-08-26 23:29:00 +02:00
Jacek Caban
1981140257
[dxvk] Explicitly include unordered_map in dxvk_renderpass.h
...
When using libstdc++, it's somehow implicitly included, but it's not the case for libc++.
2019-08-26 20:07:58 +02:00
Joshua Ashton
8e54477c2a
[util] Use R string literals for app compat regexes
2019-08-24 21:32:51 +02:00
Philip Rebohle
54ca5900e1
[util] Use regular expressions on full exe path to match app profiles
...
This allows us to detect applications with non-unique executable names
or with variable executable names more reliably, and also allows us to
merge profiles for games that have multiple known exe names.
The matching is also no longer case-sensitive.
2019-08-18 17:49:22 +02:00
Philip Rebohle
c934333a5c
[util] Add method to retrieve full exe path
2019-08-17 11:50:39 +02:00
Philip Rebohle
d38607c9be
[dxvk] Implement depth-stencil resolve
2019-08-13 15:16:09 +02:00
Philip Rebohle
e54dfab471
[dxvk] Support depth-stencil resolve using VK_KHR_depth_stencil_resolve
2019-08-13 15:16:09 +02:00
Philip Rebohle
7e95493fba
[dxvk] Support shader-based depth-stencil resolve
...
Requires VK_EXT_shader_stencil_export for stencil resolves.
2019-08-13 15:16:00 +02:00
Philip Rebohle
a516ca5b85
[dxvk] Add meta shaders for depth-stencil resolve
2019-08-13 14:37:50 +02:00
Philip Rebohle
acf0001fd1
[dxvk] Make device properties accessible from the device
2019-08-13 14:37:50 +02:00
Philip Rebohle
2f15cb7602
[dxvk] Enable VK_KHR_depth_stencil_resolve if available
2019-08-13 12:53:31 +02:00
Philip Rebohle
d127c08487
[dxvk] Enable VK_KHR_create_renderpass2 if available
2019-08-13 12:52:54 +02:00