1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 16:24:29 +01:00
Commit Graph

1714 Commits

Author SHA1 Message Date
Philip Rebohle
a53e053391
[dxbc] Fix incorrect data type for explicit interpolation instructions 2018-10-25 22:25:13 +02:00
Philip Rebohle
5a30110d0f
Revert "[d3d11] Remove some flush points"
This reverts commit 5ab6f691ae.

Apparently this leads to extremely bad frame times on some Nvidia setups.
2018-10-25 20:55:37 +02:00
Philip Rebohle
422cf71c55
[util] Spoof Nvidia GPU for The Vanishing of Ethan Carter Redux
For some reason it crashes with AMD cards, but apparently not in D3D code.
Closes #732.
2018-10-25 18:31:55 +02:00
Philip Rebohle
941db96f79
[dxvk] Remove obsolete DxvkShaderKey constructor 2018-10-25 11:30:02 +02:00
Philip Rebohle
c9ce09e098
[d3d11] Respect xfb metadata when computing shader hash
Closes #733.
2018-10-25 11:28:02 +02:00
Philip Rebohle
7eeeeaa625
[util] Provide method to compute SHA-1 hash from multiple data chunks
The underlying implementation supports this trivially, so we should
provide a way to use this feature.
2018-10-25 10:34:38 +02:00
Philip Rebohle
589229f4ca
[dxgi] Query device interface from the presenter
Removes the coupling between IDXGISwapChain and IDXGIDevice.
This is necessary because D3D12 devices don't support IDXGIDevice.
2018-10-24 15:54:56 +02:00
Philip Rebohle
7b9726fd93
[d3d11] D3D11Presenter -> D3D11PresentDevice 2018-10-23 15:10:01 +02:00
Philip Rebohle
83b51a66ac
[dxgi] Don't build shaders for presentation
These are now embedded in the D3D11 module.
2018-10-23 14:58:57 +02:00
Philip Rebohle
86e6477e80
[dxgi] Remove unused presenter options 2018-10-23 14:58:57 +02:00
Philip Rebohle
3b5b20ca3f
[dxgi] Remove old DXGI presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
b53f6661f8
[dxgi] Use new presenter for D3D11 2018-10-23 14:58:57 +02:00
Philip Rebohle
967b276acb
[d3d11] Add COM interface for API-agnostic presenter 2018-10-23 14:58:57 +02:00
Philip Rebohle
64185d9be4
[d3d11] Move some DXGI presenter options to D3D11 2018-10-23 14:58:57 +02:00
Philip Rebohle
8cb4852a61
[d3d11] Add new D3D11 swap chain code
- Fix deferred surface creation
2018-10-23 14:58:39 +02:00
Philip Rebohle
db2880acfd
[dxvk] Update blend constants only when they have actually changed
Reduces number of redundant state changes in Resonance of Fate.
2018-10-22 15:35:56 +02:00
Andreas Heider
ac0f8d6a64
Spoof AMD GPU for Assetto Corsa Competizione 2018-10-22 10:57:54 +02:00
Błażej Szczygieł
57718dcf84 [util] Spoof AMD GPU for SAO FB
Improves performance by not trying to load nvapi.
2018-10-22 10:51:48 +02:00
Philip Rebohle
5124fd87d5
[d3d11] Implicitly flush when queueing an event query
Significantly improves GPU utilization in Quake Champions.
2018-10-17 17:28:47 +02:00
Philip Rebohle
5ecfbd8425
[d3d11] Do not use QueryInterface to get query pointers
We're not going to implement counters anyway, so this is
unnecessary overhead.
2018-10-17 17:28:47 +02:00
Philip Rebohle
5ab6f691ae
[d3d11] Remove some flush points
These aren't as useful as they may look like since they occur
at render pass boundaries anyway.
2018-10-17 17:28:47 +02:00
Philip Rebohle
f14d17b743
[d3d11] Don't mark context methods as 'final' 2018-10-17 17:28:47 +02:00
Philip Rebohle
11b269efd1
[d3d11] Save a few CPU cycles in Map/MapBuffer 2018-10-16 12:29:04 +02:00
Philip Rebohle
e0e945f724
[d3d11] Show SetPredication message only when the predicate is not NULL
Helps determine which games actually use the feature.
2018-10-15 19:35:50 +02:00
Philip Rebohle
56e9bba279
[dxgi] Fix scaling when swap image extent mismatches window size
In Proton 3.16, the window size is not necessarily equal to the size
of the WSI swap chain and DXVK is responsible for doing the scaling,
so we should compare to the actual swap image size instead.
2018-10-15 18:35:00 +02:00
Philip Rebohle
254cd8bd06
[dxvk] Optimize image descriptor updates
Avoids unnecessary atomic operations when rendering to a framebuffer
with a depth attachment.
2018-10-15 16:35:40 +02:00
Philip Rebohle
890e5f8c9c
[meta] Release v0.90 2018-10-13 16:31:32 +02:00
Philip Rebohle
6b5aa0b928
Merge branch 'vk_transform_feedback' 2018-10-13 08:00:51 +02:00
Philip Rebohle
8172d347be
Revert "[d3d10] Implement ID3D10Multithread"
This reverts commit 55d6eae210.

We probably don't need it, and the current implementation is broken.
2018-10-12 19:29:52 +02:00
Philip Rebohle
8630ee235a
[util] Re-enable D3D10 for Bioshock 2018-10-12 19:06:53 +02:00
Philip Rebohle
55d6eae210
[d3d10] Implement ID3D10Multithread 2018-10-12 19:06:05 +02:00
Philip Rebohle
e549c9303b
[d3d10] Respect D3D10_CREATE_DEVICE_SINGLETHREADED flag
May improve performance in games which do not need the locking behaviour.
2018-10-12 18:36:02 +02:00
Philip Rebohle
6d18efdfc7
[d3d10] Lock device on context operations
May fix thread safety issues in some games. Apparently, the
D3D10Device is supposed to be thread safe by default.
2018-10-12 18:31:55 +02:00
Tk-Glitch
502af0f866 [util] Spoof AMD GPU for Dauntless and Redout.
It silences some nvapi related warnings and improves performance on both titles by up to 10%.
Also fixes a random crash on Redout.
2018-10-12 12:43:58 +02:00
Fredrick Lockert
27026f48a2 [util] Spoof AMD card for Star Citizen 2018-10-12 07:10:13 +02:00
Philip Rebohle
406816d17c
[d3d10] Support pOffsets parameter in SOGetTargets 2018-10-10 19:55:42 +02:00
Philip Rebohle
93a851a2fc
[d3d11] Implement DrawAuto method 2018-10-10 19:55:42 +02:00
Philip Rebohle
44024e7a7a
[d3d11] Implement Stream Output queries 2018-10-10 19:55:42 +02:00
Philip Rebohle
93753a5ce7
[d3d11] Bind transform feedback buffers in SOSetTargets 2018-10-10 19:55:41 +02:00
Philip Rebohle
97d776cc00
[d3d11] Allocate counter for stream output buffers 2018-10-10 19:55:41 +02:00
Philip Rebohle
0d89dfae95
[d3d11] Report format support for stream output buffers 2018-10-10 19:55:41 +02:00
Philip Rebohle
7369dee9d6
[d3d11] Create passthrough geometry shader if necessary
Fixes stream output in Unity Engine titles.

- Fix compilation with new DxbcProgramInfo struct.
2018-10-10 19:55:41 +02:00
Philip Rebohle
5463dc7e6c
[d3d11] Implement CreateGeometryShaderWithStreamOutput
- Emit error instead of warning when enabling rasterization
2018-10-10 19:55:26 +02:00
Philip Rebohle
f42ea9f1d1
[d3d11] Set transform feedback usage, stage and access flags 2018-10-10 13:05:38 +02:00
Philip Rebohle
3a48092630
[dxvk] Implement transform feedback draw call 2018-10-10 13:05:37 +02:00
Philip Rebohle
929b75a038
[dxvk] Add support for transform feedback queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
4bdf6daa39
[dxvk] Add structure for transform feedback stream queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
3435702719
[dxvk] Add basic support for indexed queries 2018-10-10 13:05:37 +02:00
Philip Rebohle
76d917df20
[dxvk] Add xfb counter write -> xfb counter read barrier
- Update xfb counter barrier
2018-10-10 13:05:37 +02:00
Philip Rebohle
93b1b9bc00
[dxvk] Implement transform feedback
Begins transform feedback when rendering with an xfb-enabled
pipeline bound, and ends transform feedback as needed, while
writing back the counters supplied by the app. This does not
yet support transform feedback queries or the draw command.
2018-10-10 13:05:37 +02:00
Philip Rebohle
a27e440272
[dxvk] Detect Xfb and set rasterized stream index 2018-10-10 13:05:37 +02:00
Philip Rebohle
1f135f59ed
[dxvk] Add Xfb API stubs 2018-10-10 13:05:37 +02:00
Philip Rebohle
52e1671167
[dxvk] Add Xfb context state 2018-10-10 13:05:37 +02:00
Philip Rebohle
989a10ab88
[dxvk] Enable transform feedback device feature if available
- Enable geometryStreams feature
2018-10-10 13:05:37 +02:00
Philip Rebohle
e27083a04f
[dxvk] Query transform feedback device properties if available 2018-10-10 13:05:37 +02:00
Philip Rebohle
13ecbcaaf5
[dxvk] Enable VK_EXT_transform_feedback 2018-10-10 13:05:37 +02:00
Philip Rebohle
61d56a1732
[dxvk] Add definitions for transform feedback entry points 2018-10-10 13:05:37 +02:00
Philip Rebohle
bf906aa226
[dxvk] Add support for transform feedback access flags 2018-10-10 13:05:37 +02:00
Philip Rebohle
d2c62a8645
[dxbc] Implement passthrough geometry shader
This is needed when vertex or domain shader code is
passed to CreateGeometryShaderWithStreamOutput.

- Fix compilation with new DxbcProgramInfo.
2018-10-10 10:28:15 +02:00
Philip Rebohle
017699df15
[dxbc] Implement Xfb output declarations and setup 2018-10-10 10:28:15 +02:00
Philip Rebohle
bb780bbe10
[dxbc] Add Xfb decorations 2018-10-10 10:28:15 +02:00
Philip Rebohle
6a5fe2247a
[dxbc] Add support for multiple streams in geometry shaders 2018-10-10 10:28:15 +02:00
Philip Rebohle
a42f03e32d
[dxbc] Add Xfb structures to DxbcModuleInfo 2018-10-10 10:28:15 +02:00
Philip Rebohle
eff81c7edf
[dxvk] Implement getShader method for graphics pipelines 2018-10-10 10:28:12 +02:00
Philip Rebohle
e5f3019524
[dxgi] *Actually* silence WaitForVBlank warning
Guess who needs more coffee.
2018-10-09 19:17:20 +02:00
Philip Rebohle
08b241b3ea
[d3d11] Add option to disable deferred context mapping speed hack
Fixes a regression in The Evil Within.

We should probably find a proper solution, but for now this is the best
thing we can do for games which reuse command lists.
2018-10-09 17:07:50 +02:00
Philip Rebohle
6dd5cdbc3e
[dxgi] Silence WaitForVblank warning 2018-10-09 14:48:49 +02:00
Andre Heider
8fcdf78b51 [dxbc] rename DxbcProgramVersion to DxbcProgramInfo
The version in not part of this class anymore.
2018-10-08 12:32:01 +02:00
Andre Heider
8492f0501e [dxbc] Drop unused major/minor from DxbcProgramVersion 2018-10-08 12:32:01 +02:00
Philip Rebohle
781ee00f5c
[dxvk] Refactor indirect draw/dispatch commands
Introduces an OpenGL-style bind point for the argument buffer, which
means we can avoid a lot of unnecessary reference tracking in games
that do a lot of indirect draw calls.

Reduces CPU overhead in Assassin's Creed Odyssey.
2018-10-08 10:23:18 +02:00
Philip Rebohle
eb55325640
[dxvk] Fix missing buffer tracking for indirect draw calls
This is optimized to allow a large number of indirect draws to be
submitted if they all access the same argument buffer, as is the
case in Assassin's Creed Syndicate and Odyssey.
2018-10-07 17:51:44 +02:00
Philip Rebohle
af16461858
[dxvk] Fix missing indirect dispatch barriers and tracking 2018-10-07 17:33:03 +02:00
Philip Rebohle
417b6cb6dc
[dxvk] Reduce CPU overhead of indirect draw calls 2018-10-07 17:09:46 +02:00
Philip Rebohle
87f1cd2385
[dxgi] Fix undefined display mode format for display mode transitions
Fixes resolution change option in Dark Souls 3.
2018-10-06 08:01:48 +02:00
Philip Rebohle
09bbb68d98
[meta] Release v0.81 2018-10-05 21:14:11 +02:00
Philip Rebohle
a3bf90f5a3
[vr] Cosmetic code cleanup 2018-10-04 12:30:26 +02:00
Andrew Eikum
bc367fd817
[vr] Load native openvr library on winelib builds 2018-10-04 12:08:12 +02:00
Philip Rebohle
0b4f1b6d6f
[d3d11] Implement DiscardView and DiscardResource for images 2018-10-01 16:54:34 +02:00
Philip Rebohle
0d9e714d3e
[dxvk] Add discardImage method 2018-10-01 16:54:34 +02:00
Philip Rebohle
da76d74a2d
[dxvk] Minor internal buffer API cleanup 2018-09-30 11:05:20 +02:00
Philip Rebohle
aaaf2c53e0
[dxvk] Don't reset unused bind points
Saves a few CPU cycles when binding resources.
2018-09-29 20:23:00 +02:00
Philip Rebohle
387f41ede5
[dxvk] Make DxvkBuffer destructor explicit
Prevents compiler from inlining massive amounts of code where it's
not needed. This is more consistent with the other classes as well.
2018-09-29 20:19:07 +02:00
Philip Rebohle
da8274daaf
[d3d11] Don't set meta-resolve usage flags for depth buffers
Depth buffers cannot be resolved in D3D11.
May improve performance on some hardware when MSAA is used.
2018-09-29 14:59:36 +02:00
Philip Rebohle
894d9606d5
[dxgi] Add option to force-enable MAILBOX present mode
Provides Enhanced Sync-like functionality (#678).
2018-09-29 08:13:52 +02:00
Philip Rebohle
de4c88d5aa
[d3d11] Skip CopyResource when src and dst resource are the same 2018-09-28 19:41:27 +02:00
Philip Rebohle
c9d61e16d9
[d3d11] Skip ResolveSubresource when dst and src resource are the same
Fixes black screen issue in Mortal Kombat X (#670).
2018-09-28 19:41:16 +02:00
Philip Rebohle
33408a8a74
[dxvk] Fix stencil state assignment
Not really important since we don't use stencil anyway,
but we should at least populate the struct correctly.
2018-09-27 21:04:49 +02:00
Philip Rebohle
161fb6215a
[d3d11] Optimize UAV binding
- UpdateBuffer is faster than ClearBuffer for small updates.
- We shouldn't dispatch *two* CS commands for each UAV, one is enough.
2018-09-27 16:50:34 +02:00
Philip Rebohle
518ab2ebdd
[dxvk] Refactor resolve ops
Brings this more in line with clear and copy operations, which
both have more than one code path. Also optimizes barriers.
2018-09-27 12:42:20 +02:00
Philip Rebohle
c5f7f9f3b0
[d3d11] Enable usage flags for meta copy formats
This is required in order to make meta copies work between images
that do not have the necessary D3D11 bind flags set, and it may
speed things up because it allows rendering to the destination
image directly rather than requiring a temporary image.
2018-09-27 11:44:09 +02:00
Philip Rebohle
509e6f1abf
[dxvk] Use new meta copy for depth <> color image copies 2018-09-27 11:44:09 +02:00
Philip Rebohle
fad2e13882
[dxvk] Add meta copy code
The current way of copying data between incompatible images is slow
and does not work for multisampled images. This new code implements
a render pass which performs an exact copy of the source data.
2018-09-27 11:44:09 +02:00
Philip Rebohle
c11d492597
[dxvk] Add meta copy shaders
Used to copy between depth and color images.
2018-09-27 11:44:09 +02:00
Philip Rebohle
b73b91a5c9
[dxgi] Implement slightly better QueryResourceResidency stub
This now returns redidency values for all queried resources, but
not the correct ons. May fix issues in Fallout 4?
2018-09-27 07:31:30 +02:00
Philip Rebohle
63d7770870
[dxvk] Flush queued barriers when binding any frame buffer
We need to flush when starting meta render passes as well.
2018-09-25 21:32:21 +02:00
Philip Rebohle
8bcd47d6dc
[dxvk] Simplify pipeline object locking
Any more complex approach is not very useful at the moment
because we have to put a lock around the actual compile
function anyway.
2018-09-25 18:22:58 +02:00
Philip Rebohle
0be291e123
[dxvk] Don't do image-to-buffer copies for multisampled images
Vulkan does not allow this.
2018-09-25 14:37:53 +02:00
Philip Rebohle
305c361c00
[d3d11] Fix incomplete usage mask for buffer UAVs 2018-09-25 10:14:42 +02:00
Philip Rebohle
ddfa7e40b3
[dxvk] Renove redundant vkDestroyPipeline 2018-09-24 22:54:49 +02:00
Philip Rebohle
a950872c7c
[dxvk] Check whether the vertex binding / attribute count is valid 2018-09-24 16:22:12 +02:00
Philip Rebohle
1e40a14a50
[d3d10] Disable D3D10 support for Bioshock 2018-09-24 15:30:13 +02:00
Philip Rebohle
bd4338be42
[d3d10] Add option to enable or disable D3D10 support 2018-09-24 15:26:33 +02:00
Philip Rebohle
04ed4273ba
[dxvk] Avoid buffer slice copy when binding index/vertex buffers
Also redesigns getDescriptor to always return the offset.
2018-09-23 20:09:01 +02:00
Philip Rebohle
1c865328d3
[meta] Release v0.80 2018-09-23 19:01:15 +02:00
Philip Rebohle
b49876528a
[dxvk] Enable state cache for compute pipelines
Also cleans up some code to get the design more in line
with how graphics pipelines are handled.
2018-09-23 14:42:03 +02:00
Philip Rebohle
6c8ac9e5f4
[dxvk] Add compute shader support to pipeline state cache 2018-09-23 14:42:03 +02:00
Philip Rebohle
689602497f
[d3d11] Use state cache 2018-09-23 14:41:49 +02:00
Philip Rebohle
4a72cae1e6
[dxvk] Enable state cache 2018-09-23 14:41:43 +02:00
Philip Rebohle
57dab630b5
[dxvk] Add pipeline state cache
Stores state vectors for graphics pipelines in a file and allows
games to start compiling them in advance on subsequent launches.

Changes:
(1) Add environment variable to select the cache file path
(2) Add magic number and entry size to cache file header
2018-09-22 22:38:35 +02:00
Philip Rebohle
d6742e38c5
[dxvk] Lock pipeline object while compiling one pipeline
This prevents us from compiling the exact same pipeline twice
at the same time, which for some reason crashes RADV.
2018-09-22 12:04:06 +02:00
Philip Rebohle
0e2d63f6d2
[dxvk] Add method to retrieve shader key from shader module 2018-09-22 12:04:06 +02:00
Philip Rebohle
f3a23ab81f
[util] Add convenience method for SHA1 hash compulation 2018-09-22 12:04:06 +02:00
Philip Rebohle
83447975ac
[dxvk] Refactor pipeline stat counters
The stat counter struct no longer has to be passed to
the pipeline compiler function.

The new implementation uses atomic counters of the pipeline manager
rather than per-command list counters, which removes the need to
pass the counter structure to the compiler function.
2018-09-22 12:02:20 +02:00
Philip Rebohle
5410680401
[dxvk] Refactor pipeline object constructors
This way we don't need to pass everything to the pipeline objects.
2018-09-22 11:59:25 +02:00
Philip Rebohle
9284081180
[dxvk] Remove redundant declaration 2018-09-21 19:43:47 +02:00
Philip Rebohle
0f52ec2796
Revert "[dxvk] Move command submission to separate thread"
This reverts commit f61ff5d345.

Apparently, this causes extremely poor frame times on some
configurations. Reason is currently unknown.
2018-09-20 19:58:00 +02:00
Philip Rebohle
2eda95f61a
[dxvk] Optimize retrieval of dynamic buffer offsets 2018-09-20 15:19:33 +02:00
Philip Rebohle
f61ff5d345
[dxvk] Move command submission to separate thread
- Reduces load on the CS thread and the main rendering thread.
- This takes into account that VR apps access the queue as well.
2018-09-20 14:43:06 +02:00
Philip Rebohle
539cc77b6e
[dxvk] Eliminate buffer slice copy when updating buffer descriptors 2018-09-20 12:10:43 +02:00
Philip Rebohle
03a760bec6
[meta] Remove redundant linker entries for the utils library
Fixes #651.
2018-09-19 21:00:44 +02:00
Philip Rebohle
35238ec4d1
[d3d11] Make D3D11 context methods more robust to null pointers
Assetto Corsa tries to do some questionable things when reflections
are disabled in the game options. Refs #648.
2018-09-19 12:33:30 +02:00
Philip Rebohle
c1190e81b2
[d3d11] Handle pResource == nullptr case during view creation 2018-09-19 11:55:11 +02:00
Philip Rebohle
837a3f5787
[d3d11] Don't allow creation of 0x0-sized textures 2018-09-18 21:33:27 +02:00
Philip Rebohle
bf5476900a
[d3d11] Expose Feature Level 11_1
- We don't actually support the ExtendedResourceSharing feature, but
  since we currently don't support resource sharing at all, this makes
  no difference in practice
- Likewise, MultisampleRTVWithForcedSampleCountOne is not really
  supported, as the Vulkan backend will still use the sample count
  of the color attachments, but should have no effect in practice.
- This does not change the fact that Predication and Stream Output
  are still missing.
2018-09-18 16:27:40 +02:00
Philip Rebohle
d9009efd22
[d3d11] Implement and advertize support for CopyWithOverlap feature 2018-09-18 16:22:47 +02:00
Philip Rebohle
e3c2815782
[dxvk] Add copyBufferRegion and copyImageRegion methods
These new methods can support overlapped subresource copies by
creating a temporary resource and effectively using two copy
operations. This is required for D3D11 overlapped copies.
2018-09-18 16:20:57 +02:00
Philip Rebohle
3f47fdab4d
[d3d11] Advertize support for the ForcedSampleCount rasterizer state 2018-09-18 13:23:28 +02:00
Philip Rebohle
482930f04a
[dxvk] Implement backend support for D3D11 forced sample count
We don't support rasterization with a sample count different from
the framebuffer sample count, but if there are no attachments, any
sample count is allowed.
2018-09-18 13:22:28 +02:00
Philip Rebohle
4469ef1ec1
[d3d11] Replace shader debug name with shader key 2018-09-18 10:35:27 +02:00
Philip Rebohle
a078bb947e
[d3d11] Replace D3D11ShaderKey with DxvkShaderKey 2018-09-18 10:35:08 +02:00
Philip Rebohle
0843e2211c
[dxvk] Add new DxvkShaderKey to represent unique shader key 2018-09-18 10:35:08 +02:00
Philip Rebohle
12efd88726
[dxvk] Avoid more unnecessary copies of ref-counted pointers
Improves performance measurably in Shadow Warrior 2 when CPU bound.
2018-09-17 23:42:34 +02:00
Philip Rebohle
3a1fbdaaf1
[dxvk] Avoid buffer slice copy when tracking buffer views 2018-09-17 23:30:36 +02:00
Philip Rebohle
6c889c0005
Revert "[d3d11] Avoid unnecessary buffer slice copy when mapping buffer"
This reverts commit 72106a02cb.

Breaks things for some reason. Doesn't have much of an impact anyway.
2018-09-17 23:08:00 +02:00
Philip Rebohle
72106a02cb
[d3d11] Avoid unnecessary buffer slice copy when mapping buffer 2018-09-17 22:04:31 +02:00
Philip Rebohle
820904f22d
[dxvk] Optimize ref counting around resource tracking
Micro-optimization that reduces the number of atomic increments
and decrements when moving reference-counted objects around.
2018-09-17 20:42:08 +02:00
Philip Rebohle
f42f708f72
[dxvk] Rename DxvkBindingState -> DxvkBindingMask
Preparation for some more binding-related work.
2018-09-17 10:45:28 +02:00
Philip Rebohle
eac86fab15
[dxvk] Do not map allocations that don't need a HOST_VISIBLE memory type
Should reduce the amount of virtual memory used on systems without
dedicated VRAM. Refs #640.
2018-09-17 09:08:00 +02:00
Philip Rebohle
19408f0ebe
[d3d11] Fix reported RowPitch/DepthPitch for mapped buffers
Some games rely on this being the exact buffer size.
2018-09-17 07:45:05 +02:00
Philip Rebohle
a78dc3b444
[dxvk] Do not store a strong reference from adapter to instance
The instance stores an array of adapters now. Fixes crash when
using the device filter, and fixes the instance not getting
destroyed.
2018-09-16 19:11:15 +02:00
Philip Rebohle
fde67b9773
[dxgi] IsCurrent is not actually a stub 2018-09-16 10:20:24 +02:00
Philip Rebohle
c8e0c253ba
[dxvk] Simplify graphics pipeline instance management 2018-09-16 10:07:45 +02:00
Philip Rebohle
b6bf72aeb6
[dxvk] Fix some legacy cruft around Vulkan instance creation 2018-09-15 14:16:56 +02:00
Philip Rebohle
364e15d11a
[dxvk] Remove all remaining pipecompiler code 2018-09-14 17:22:56 +02:00
Philip Rebohle
18927dc958
[dxvk] Remove asynchronous pipeline compiler 2018-09-14 16:46:07 +02:00
Jens Peters
d4947261c6
[util] Improve logging of configuration options 2018-09-14 15:34:46 +02:00
Philip Rebohle
922f0382f6
[dxvk] Remove option for asynchronous shader compilation
Unsafe.
2018-09-13 20:40:32 +02:00
Philip Rebohle
059073fcd0
[dxbc] Fix missing hull shader input declarations
Fixes tessellation in Tomb Raider 2013. Closes #368.
2018-09-13 18:25:32 +02:00
Philip Rebohle
797c568c74
[dxbc] Use temporary array for per-patch hull shader outputs
Drivers don't seem to like it when output arrays are addressed dynamically.
2018-09-13 15:17:39 +02:00
Philip Rebohle
d86b5361f0
[dxvk] Only mark render targets as used on draw calls 2018-09-13 12:00:49 +02:00
Philip Rebohle
9e3914b368
[dxvk] Remove redundant parameter from DxvkCommandList constructor 2018-09-12 18:54:05 +02:00
Philip Rebohle
2d93452cba
[util] Spoof Nvidia card for Assassin's Creed Syndicate
This one actually doesn't work properly when the AMD AGS library
is not present, but is fine with nvapi not being there.
2018-09-12 14:10:49 +02:00
Philip Rebohle
1127a344dc
[dxvk] Fix query type enablement in query manager
We cannot use query types as flag indices, since query
types added in the future may have gretaer enum values
than 32.
2018-09-11 13:01:00 +02:00
Philip Rebohle
f9add97a07
[d3d11] Fix Begin/End for all queries other than Event and Timestamp 2018-09-11 13:00:52 +02:00
Philip Rebohle
ea6b6e2e53
[dxvk] Rename useAsyncPipeCompiler -> asyncPipeCompiler 2018-09-11 08:38:18 +02:00
Philip Rebohle
ea9e812798
[dxvk] Introduce new 'Created' state for queries
New initial state for queries. D3D11 returns an error when trying to
retrieve data from a query in this state, rather than S_FALSE or S_OK.
2018-09-10 23:07:51 +02:00
Philip Rebohle
d7441f274b
[dxvk] Enable device features for VK_EXT_vertex_attribute_divisor 2018-09-10 22:10:16 +02:00
Philip Rebohle
ba65a1e36b
[dxvk] Query new Vertex Attribute Divisor features
This was added in revision 3 of the extension.
2018-09-10 21:46:14 +02:00
Philip Rebohle
f5270c8522
[dxvk] Collect info about the supported revisions of an extension 2018-09-10 21:40:40 +02:00
Philip Rebohle
5c89a68879
[dxvk] Implement render target state tracking for async compilation
This ensures that we always render to targets which are only used once.
2018-09-10 19:41:17 +02:00
Philip Rebohle
f94f5a74ba
[dxvk] Add methods to track render target view usage 2018-09-10 18:05:52 +02:00
Philip Rebohle
c7ddaea5a6
[dxvk] Add method to retrieve current frame number 2018-09-10 18:05:33 +02:00
Philip Rebohle
5cc2c219dd
[dxvk] Use all but two available threads for async pipeline compilation 2018-09-10 17:03:11 +02:00
Philip Rebohle
6532302e34
[util] Implement dxvk:🧵:hardware_concurrency 2018-09-10 17:02:51 +02:00
Philip Rebohle
c3b542878c
[dxvk] Repurpose asynchronous pipeline compiler
Removes support for DISABLE_OPTIMIZATION_BIT. Instead, pipelines
will not be made available until compiled by one of the worker
threads.
2018-09-10 17:02:42 +02:00
Philip Rebohle
012a5c2f74
[d3d11] Add option to enforce anisotropic filtering
When setting d3d11.samplerAnisotropy to a non-negative value,
AF will be either disabled (0) or enabled with the given
anisotropy (>0) for all samplers.
2018-09-10 15:42:55 +02:00
Philip Rebohle
16a3ae52fe
[dxbc] Remove emitCsSystemValueLoad
There are no compute shader system values.
2018-09-10 11:50:13 +02:00
Philip Rebohle
f8dc5612f7
[d3d11] Added option to limit tessellation factors
d3d11.maxTessFactor accepts values ranging from 8 to 64, and limits
the maximum tessellation factor accordingly.
2018-09-09 23:14:00 +02:00
Philip Rebohle
2541aeb25c
[dxgi] Add option to override the sync interval 2018-09-09 19:14:30 +02:00
Philip Rebohle
d7b16dd90a
[dxgi] Add option to change the back buffer count 2018-09-09 19:12:07 +02:00
Philip Rebohle
b7d8be25f1
[dxgi] Use DXGI back buffer count for the Vulkan swap chain 2018-09-09 19:07:41 +02:00
Philip Rebohle
45f61cbae5
[dxvk] Fix initial query state
Trying to retrieve data from newly created D3D11 queries is supposed
to return S_FALSE and not return data, so we shouldn't mark the query
as available immediately after creation.
2018-09-09 14:35:09 +02:00
Jens Peters
e48c27ac30 [util] Spoof AMD card for Batman: Arkham Knight (#627)
This prevents game crashes in "Detective Mode" for NVidia cards.
Fixes https://github.com/doitsujin/dxvk/issues/580
2018-09-08 16:33:44 +02:00
MartinPL
f949240b2f Spoof AMD card for GTA V
GTA V working out of box on Proton for Nvidia users. Tested
#624
https://github.com/ValveSoftware/Proton/issues/37#issuecomment-415833819
2018-09-08 12:51:39 +02:00
Philip Rebohle
60796a8143
[util] Spoof AMD card for Dragon Quest XI
This game for some reason seems to keep searching for NVAPI DLLs
and runs at an extremely low framerate as a result. Fixes #622.
2018-09-07 07:50:08 +02:00
Philip Rebohle
108a6645e6
[dxbc] Make emitRawBufferLoad more readable 2018-09-06 21:44:53 +02:00
Philip Rebohle
57e5b05f32
[d3d11] Fix layer count for 3D RTVs with non-zero base mip level
We have to take the mip level into account as well, or otherwise
we may create a view with more layers than the selected mip level has.
2018-09-04 07:39:46 +02:00
Philip Rebohle
2533b9f4ed
[dxvk] Fix layer count for 2D views into 3D images 2018-09-04 07:38:47 +02:00
Philip Rebohle
9520c9b1b8
[dxbc] Apply Modulo 31 to bit counts and offsets (shr/shl/bfe/bfi)
Assassin's Creed Syndicate relies on correct behaviour.
2018-09-03 01:01:44 +02:00
Philip Rebohle
09948a3495
[d3d11] Synchronize CS thread after flush when waiting for resource
In some rare cases, the flush operation itself may add new references
which we need to see while spinning on the resource's usage counter.
2018-09-01 21:25:39 +02:00
Philip Rebohle
2b3d9aaf5c
[dxvk] Remap spec constant ranges
Keeping the numbers low will make debugging shaders easier.
glslang seems to have an upper limit on spec constant IDs
in place.
2018-09-01 20:41:25 +02:00
Philip Rebohle
825200b2a2
[dxvk] Don't change spec constant IDs that are no valid resource slots
Fixes pipeline state-related specialization constants.
2018-09-01 20:27:36 +02:00
Philip Rebohle
ffc2130ee6
[d3d11] Pass format swizzle to render target views
Fixes missing caterpillars in World of Tanks (#410).
2018-09-01 18:15:31 +02:00
Philip Rebohle
05e505a844
[dxbc] Implement pixel shader output component mapping 2018-09-01 18:15:27 +02:00
Philip Rebohle
70786aeee8
[spirv] Support OpVectorExtractDynamic instruction 2018-09-01 17:59:50 +02:00
Philip Rebohle
cb274e040d
[dxvk] Add spec constants for pixel shader output mapping 2018-09-01 17:59:50 +02:00
Philip Rebohle
37a8743dbc
[dxvk] Add output component mask state to graphics pipelines
This is required in order to implement swizzled render target views.
We currently use this to remap color write masks as needed.
2018-09-01 17:59:50 +02:00
Philip Rebohle
7c97e276f2
[dxvk] Fix up component swizzle for render target views
Vulkan does not support non-identity swizzles for image views that are
used for rendering, but we have to keep the information around in order
to support rendering to swizzled image formats.
2018-09-01 15:51:56 +02:00
Philip Rebohle
f74661daa4
Revert "[util] Limit device memory size to 4095 MB for Life is Feudal MMO"
This reverts commit 73cbf5b352.

The workaround is no longer necessary due t a game update.
Closes #614.
2018-08-31 22:54:16 +02:00
Philip Rebohle
2f90213c0f
[dxvk] Enable pipeline statistics queries around compute shaders
Fixes potential issues caused by csInvocations being 0.
2018-08-31 16:24:03 +02:00
Philip Rebohle
657093c14e
[dxvk] Refactor query management
Moved all query-related state tracking and management into a
separate class. This allows for new query types to be added
in the future, and makes less dodgy assumptions about the
current state when beginning or ending a query.
2018-08-31 15:38:09 +02:00
Jacek Caban
9fd30cf5bf [util] Handle WCHAR strings in str::format. 2018-08-31 05:37:34 +02:00
Philip Rebohle
66d1bed083
[d3d11] Remove old UAV counter buffer implementation 2018-08-30 15:32:46 +02:00
Philip Rebohle
5c45a50daf
[d3d11] Use D3D11CounterBuffer for UAV counters 2018-08-30 15:24:47 +02:00
Philip Rebohle
9992ba1a79
[d3d11] Add more general counter buffer allocator
We're going to need it for more than just UAV counters soon.
2018-08-30 15:24:38 +02:00
pchome
ff604d5a53 [d3d10] Fix d3d11 dependecy for winelib build 2018-08-28 12:52:45 +02:00
Philip Rebohle
f1b075c0f3 [dxvk] Add CS chunk pool
Reduces the number of dynamic memory allocations for CS chunks by
recycling them once they are no longer needed. Also fixes a potential
issue with chunks that are dispatched multiple times.
2018-08-27 16:07:38 +02:00
Philip Rebohle
b75b7d0999 [dxvk] Simplify discardBuffer access flags
Specifying both read and write access is unnecessary, as the dirty
check will always return true for writes when it would also return
true for reads.
2018-08-27 14:50:47 +02:00
Philip Rebohle
01cc49555a [dxbc] End functions correctly even if last instruction is not 'ret'
Some DXBC shaders don't end in a return instruction, but rather implicitly
end when all branches end in a return instruction. Fixes an illegal shader
generated in Crysis 1.
2018-08-27 14:29:40 +02:00
Philip Rebohle
34152a01a5 [dxvk] Add device filter
When setting DXVK_FILTER_DEVICE_NAME, only devices with a
matching device name will be reported to the application.
2018-08-27 14:22:14 +02:00