Joshua Ashton
8cfca32c2a
[d3d9] Don't InitReturnPtr in GetBackBuffer
...
Matches native behaviour.
Found via a Wine test.
2020-02-28 01:02:56 +00:00
Joshua Ashton
c07f8c941c
[d3d9] Delegate VCACHE check to QuerySupported
...
Fixes a failing Wine test
2020-02-28 00:59:44 +00:00
Joshua Ashton
3332bb2844
[d3d9] Add some missing synchronization when completely remaking a presenter
2020-02-27 22:55:20 +00:00
Joshua Ashton
33f6add0ff
[d3d9] Fix sampler decision at Present time
2020-02-27 22:54:43 +00:00
Joshua Ashton
b6e1da916a
[d3d9] Fix scissor rect size when presenting
2020-02-27 22:53:14 +00:00
Joshua Ashton
1592e2770b
[d3d9] Remove unnecessary dirty checks in Reset
2020-02-26 22:34:17 +00:00
Joshua Ashton
fbf76e8420
[d3d9] Don't mark unuploaded textures as uploaded
2020-02-25 04:37:01 +00:00
Joshua Ashton
d1dc217d31
[d3d9] Fix readback for evictManagedOnUnlock
2020-02-23 16:59:33 +00:00
Joshua Ashton
0e353895fd
[d3d9] Enumerate adapters by display
...
WPF expects us to return an adapter for every display attached otherwise
it decides to device reset every frame.
Closes #1459
2020-02-21 18:03:57 +00:00
Joshua Ashton
f095f6385e
[d3d9] Initialize all backbuffers in swapchain creation
...
Otherwise they are garbage and undefined layout.
Fixes some validation errors in Lumino City #1462
2020-02-21 06:45:02 +00:00
Joshua Ashton
38838f7428
[d3d9] Synchronize present and wait for idle when invalidating a swapchain
...
Lumino City calls CreateAdditionalSwapchain instead of the regular device reset functions.
We were missing some needed synchronization here to make this work properly for this game.
Impacts #1462
2020-02-21 01:38:58 +00:00
Joshua Ashton
2408b881a2
[dxso] Use SSBOs for vertex constant buffers if we'd be outside of uniform range
...
Impacts #1375
2020-02-20 08:14:58 +01:00
Joshua Ashton
d11a07082c
[d3d9] Remove unnecessary dirty flag change in CreateConstantBuffers
2020-02-20 08:14:58 +01:00
Joshua Ashton
512393e469
[d3d9] Refactor constant buffer creation
2020-02-20 08:14:58 +01:00
Joshua Ashton
f688889b41
[d3d9] Avoid setting cursor position if we are already at that position
...
Avoids an infinite loop where we trigger the cursor move window message which calls SetCursorPos and so on and so forth...
Closes #1400
2020-02-20 01:44:50 +00:00
Joshua Ashton
17166a8aeb
[d3d9] Add equality operator overloads for POINT
2020-02-20 01:39:13 +00:00
Joshua Ashton
261a242486
[d3d9] Disallow GetFrontBufferData for anything but D3DPOOL_SYSTEMMEM
...
Fixes #1464
2020-02-19 18:05:50 +00:00
Joshua Ashton
74d23c22de
[build] Use __CRT_UUID_DECL for uuid definitions
...
Closes #1463
2020-02-18 20:25:05 +01:00
Joshua Ashton
760a163fc5
[util] Disable discard for D&D Temple of Elemental Evil
...
This game uses D3DLOCK_DISCARD incorrectly
2020-02-18 17:01:41 +00:00
Joshua Ashton
8fabc25a38
[d3d9] Implement d3d9.allowDiscard
2020-02-18 16:53:51 +00:00
Joshua Ashton
6b85e6d3f1
Revert "[d3d9] Ignore D3DLOCK_DISCARD when partially locking buffers"
...
This reverts commit 50cf3a465b
.
2020-02-18 16:50:39 +00:00
Joshua Ashton
378bdbdfb0
[d3d9] Remove repeated wrap state setting in Reset
2020-02-17 18:05:45 +00:00
Philip Rebohle
4cf3ef538c
[d3d9] Fix A4R4G4B4 swizzle
2020-02-17 15:32:28 +00:00
Joshua Ashton
4405b51bf3
[dxso] Respect src modifiers in Texcrd for PS 1.4
...
`texcrd r4.xy, t4_dw.xyww`
Cross Racing Championship Extreme 2005 uses a writemask in texcrd as well as the _dw modifier on the src which we weren't respecting previously.
Closes #1450
2020-02-16 23:24:33 +00:00
Joshua Ashton
a6d554615e
[d3d9] Avoid needless swizzle for A4R4G4B4
...
Should fix this d3d9 format working on Intel ANV
Impacts #1455
2020-02-16 22:54:28 +00:00
Joshua Ashton
50cf3a465b
[d3d9] Ignore D3DLOCK_DISCARD when partially locking buffers
...
Fixes #1444
2020-02-15 03:10:00 +00:00
Joshua Ashton
7d3ec74b40
[d3d9] Don't perform clipping in FF if disabled
...
Avoids unnecessary matrix multiplications in the shader, given this isn't as cheap as it is for programmable.
2020-02-14 19:19:22 +00:00
Joshua Ashton
0c16cc7749
[d3d9] Perform FF vertex clipping in world space
...
Previously we were doing this in object space which is incorrect.
Closes #1446
2020-02-14 19:09:02 +00:00
Joshua Ashton
cad3b69e82
[d3d9] Fix likeliness in GetStreamSource
2020-02-14 17:21:52 +00:00
Joshua Ashton
2096a95262
[d3d9] Fix ColorFill using sampler views for partial extents
...
Closes #1434
2020-02-14 06:49:15 +01:00
Joshua Ashton
02c79d892c
[d3d9] Try to create offscreen surfaces with render target usage
2020-02-14 06:49:15 +01:00
Joshua Ashton
1f5ddde411
[d3d9] Remove unused D3D9ViewSet structure
2020-02-14 06:49:15 +01:00
ryester27
dff2a4ea24
[util] Force 16:9 aspect ratio for Hyperdimension Neptunia U: Action Unleashed
2020-02-14 02:50:15 +00:00
Joshua Ashton
582fe899f8
[dxso] Implement TexBemL
2020-02-14 01:15:34 +00:00
Joshua Ashton
c7d5ce1c50
[d3d9] Fix incorrect type for luminance scale and offset in D3DTOP_BUMPENVMAPLUMINANCE
2020-02-14 01:10:26 +00:00
Joshua Ashton
ae68e3a5bc
[d3d9] Defer managed texture uploads until PrepareDraw and when needed
...
This also caches shader masks used for hazard tracking.
2020-02-14 00:51:58 +00:00
Joshua Ashton
0ea510eb9b
[util] Add clearAll helper to bitset
2020-02-14 00:51:58 +00:00
Joshua Ashton
6e9725a124
[d3d9] Use bitsets for bool subresource arrays
...
Also remove lockflag tracking and consolidate that to a bitset
2020-02-14 00:51:58 +00:00
Joshua Ashton
960d2bd158
[util] Add exchange helper to bitset
2020-02-14 00:51:58 +00:00
Joshua Ashton
cf6142e782
[d3d9] Don't expose formats with alpha as adapter formats
...
Impacts #1440
2020-02-14 00:46:14 +00:00
Joshua Ashton
acb3cda1dc
[d3d9] Hold a private reference to FVF-generated vertex decls
...
Otherwise the device will never be able to be destroyed as there will be a circular dependency.
Closes #1417
2020-02-13 18:42:49 +00:00
Philip Rebohle
313d46984d
[dxbc] Fix memory semantics for atomic operations
2020-02-13 01:15:44 +01:00
Philip Rebohle
4aa6800e95
[d3d11] Validate subresource index in copy operations
...
Rocket League tries to copy five subresources of a texture that only
has one single array layer and one single mip map, which causes GPU
hangs on Nvidia drivers.
2020-02-13 00:39:55 +01:00
Philip Rebohle
f12ddfa4d3
[dxbc] Fix line tessellation factor ordering
2020-02-12 12:00:46 +01:00
Joshua Ashton
51903d8348
[d3d9] Genericise video format conversion
2020-02-10 18:27:35 +00:00
Philip Rebohle
7567486668
[d3d9] Handle invalid alpha ref correctly
2020-02-10 15:20:13 +00:00
Philip Rebohle
bf03fd8732
[d3d9] Implment fixed-function clipping
2020-02-10 07:32:22 +01:00
Joshua Ashton
ba8dad3958
[d3d9] Fix multiplication order in D3D9StateBlock::MultiplyStateTransform
2020-02-10 06:22:58 +00:00
Joshua Ashton
c42d44a4c3
[d3d9] Mark vertex blend dirty in MultiplyTransform if needed
2020-02-10 06:17:05 +00:00
Joshua Ashton
14203761d9
[d3d9] Reverse multiplication order in MultiplyTransform
...
Closes https://github.com/Joshua-Ashton/d9vk/issues/295
2020-02-10 06:16:12 +00:00
Joshua Ashton
afeb4814c7
[d3d9] Remove SRGB variant from Q8W8V8U8
2020-02-10 04:57:45 +00:00
Philip Rebohle
07fee4a0e5
[util] Disable VR for Subnautica
2020-02-09 09:05:52 +01:00
Joshua Ashton
310ab6da64
[d3d9] Implement D3DTOP_BUMPENVMAPLUMINANCE
2020-02-08 23:08:48 +00:00
Joshua Ashton
302aed256b
[d3d9] Implement D3DTOP_BUMPENVMAP
2020-02-08 23:00:57 +00:00
Joshua Ashton
4291bc9dfb
[d3d9] Reupload fixed func ps data if stage constant changes
...
Closes #1420
2020-02-08 16:33:47 +00:00
Philip Rebohle
4738d12d73
[util] Enable forced TGSM barriers for F1 2019
...
Fixes visual issues on RADV.
2020-02-08 00:48:45 +01:00
Philip Rebohle
76a6f6eab9
[dxbc] Add option to force memory barriers after shared memory stores
2020-02-08 00:48:42 +01:00
Joshua Ashton
2f8fbf9114
[d3d9] Use linear sampler for upscaling if extents don't match on Present
2020-02-07 18:53:47 +00:00
Philip Rebohle
c780ed5da3
[util] Enable invariant position for Saint's Row III / IV
2020-02-07 17:40:55 +01:00
Philip Rebohle
2435c6369c
[meta] Release 1.5.4
2020-02-07 01:02:22 +01:00
Joshua Ashton
b9474cf787
[d3d9] Return D3D_OK in CreateTexture even if AUTOGENMIPMAP flag is stripped
...
D3DOK_NOAUTOGEN is only returned when querying format support, the flag is stripped away silently in CreateTexture if it has to be.
Fixes #1409
2020-02-06 23:48:01 +00:00
Joshua Ashton
1f67602b98
[d3d9] Check correct sampler bitfield when applying/capturing sampler state
2020-02-06 22:37:50 +00:00
Philip Rebohle
8020803340
[util] Disable OpenVR for Raft
2020-02-06 20:48:21 +01:00
Philip Rebohle
88147e19d2
[d3d9] Simplify dirty check for shader constants
2020-02-06 17:58:15 +01:00
Philip Rebohle
aa70369671
[d3d9] Store copy of shader metadata in constant set
...
Reduces pointer chasing when updating shader constants.
2020-02-06 17:58:15 +01:00
Philip Rebohle
69b04c609a
[dxso] Fix GCC warning for an unused variable
2020-02-06 17:50:28 +01:00
Philip Rebohle
2288dd924e
[d3d9] Fix GCC warnings for unsigned->signed comparisons
2020-02-06 17:50:28 +01:00
Philip Rebohle
06809587e8
[d3d9] Don't arbitrarily set fog scale to 0
...
The Witcher 1 sets FOGSTART == FOGEND together with LINEAR fog mode, in
which case we previously set fog_scale to 0 and therefore incorrectly
override the pixel color with the fog color.
Fixes #1401 .
2020-02-06 17:50:04 +01:00
Joshua Ashton
87dd8f0122
[d3d9] Validate blit regions are in range
...
Closes #1392
2020-02-04 23:45:32 +00:00
Joshua Ashton
92ee9c7ef1
[d3d9] Error on StretchRect when not D3DPOOL_DEFAULT
2020-02-04 22:37:44 +00:00
Joshua Ashton
08fc5342a9
[dxso] Initialize vPos in shaders if we have pixel fog
...
Fixes some fog related regressions since we deferred this
2020-02-04 21:43:16 +00:00
Philip Rebohle
ce51431860
[dxvk] Skip over adapters not supporting Vulkan 1.1
...
Even with a 1.1 instance it appears to be possible to retrieve 1.0
adapters, so we'll just ignore them.
2020-02-03 11:31:58 +01:00
František Zatloukal
976d3b5ee4
[util] Include ostream in util_rc_ptr.h
2020-01-31 15:17:18 +01:00
Joshua Ashton
1abacc947c
[dxso] Apply projection before bumpmapping in TexBem
...
Also fixes us to use the correct stage id for TexBem matrix indices...
What a truly terrible API this is. This literally makes 0 sense.
This function needs a massive cleanup later too.
Closes #1387
2020-01-31 00:33:47 +00:00
Philip Rebohle
6a5d472e60
[meta] Release 1.5.3
2020-01-30 16:17:31 +01:00
Joshua Ashton
3196fbc759
[d3d9] Unbind fragment shader for ProcessVertices
...
Fixes validation errors and potential UB on some drivers
2020-01-29 21:43:12 +00:00
Joshua Ashton
201d508626
[dxso] Handle writemask in TexKill op
...
Turns out this actually applies to what is tested, despite docs saying otherwise and never ever seeing this before!
Fixes some broken ENB shaders which I assume have some manual hand edits because I can't get FXC to generate this code at all.
2020-01-29 17:22:38 +00:00
Philip Rebohle
3ab675c233
Revert "[util] Disable float emulation for Hat in Time"
...
Turns out this breaks some levels (e.g. Chapter 1 Act 3).
Performance impact seems minimal on RADV+ACO.
This reverts commit 6f93d3bf22
.
2020-01-28 17:46:33 +00:00
Philip Rebohle
c560ec44b5
[d3d11] Re-introduce client API HUD item
2020-01-28 16:32:58 +00:00
Philip Rebohle
be16da37d7
[d3d11] Introduce COM interface to set and get API version
...
Allows us to identify DirectX 10 applications correctly.
2020-01-28 16:32:58 +00:00
Philip Rebohle
1e6ad0b372
[d3d9] Re-introduce client API HUD item
2020-01-28 16:32:58 +00:00
Philip Rebohle
38ad868214
[hud] Add parameter to allow placing HUD items
2020-01-28 16:32:58 +00:00
Philip Rebohle
588beb5b2f
[hud] Don't initialize client API HUD item by default
...
Removes the client API property from the DXVK device as well.
Instead, client APIs should create the HUD item manually.
2020-01-28 16:32:58 +00:00
Philip Rebohle
ca4c03284f
[dxvk] Don't oversubscribe memory heaps on UMA devices
...
Otherwise, we seem to suffer a major performance penalty
on setups with insufficient dedicated system memory.
2020-01-28 16:31:34 +00:00
Philip Rebohle
3beca254e2
[dxvk] Move UMA check to backend
2020-01-28 16:31:34 +00:00
Joshua Ashton
b1edf227f8
[d3d9] Enable depth bounds feature, if supported
...
Only expose it in format checks if the adapter supports the feature also
2020-01-28 01:51:04 +00:00
Joshua Ashton
6f93d3bf22
[util] Disable float emulation for Hat in Time
...
Squeezes out some extra performance in this title
2020-01-27 14:21:21 +01:00
Joshua Ashton
720cdf383e
[d3d9] Use spec constants for bool constants
2020-01-27 14:21:21 +01:00
Joshua Ashton
a43223256e
[d3d9] Fix GetTextureStageState using unmapped types
...
Closes #1378
2020-01-27 01:07:11 +00:00
Joshua Ashton
65f4437417
[dxso] Initialize vPos value at the start of the shader
...
Otherwise we can end up initializing it in a branch and that's no good.
Closes https://github.com/doitsujin/dxvk/issues/1294
2020-01-26 18:40:32 +00:00
Joshua Ashton
b4666ac044
[dxso] Count max constants after we pull out pre-defines
2020-01-26 18:13:45 +00:00
Philip Rebohle
c77a9e3bfe
[util] Unify Risen 1/2/3 app profiles
2020-01-25 12:10:05 +01:00
Philip Rebohle
fdb2b972e9
[util] Add more exe names to Gothic 3 app profile
...
Fixes #1372 .
2020-01-25 12:10:05 +01:00
Joshua Ashton
9b486515fa
[d3d9] Allow StretchRect BC -> BC format without stretch
2020-01-25 00:31:45 +00:00
Philip Rebohle
e242d7f312
[meta] Release 1.5.2
2020-01-25 00:32:25 +01:00
Philip Rebohle
5d2215e898
[d3d9] Don't try to blit to compressed images
...
Fixes Vulkan validation errors and potential driver crashes in
Dragon Age Origins.
2020-01-24 22:59:26 +00:00
Joshua Ashton
13792df4c5
[d3d9] Don't mark D3DUSAGE_AUTOGENMIPMAP as renderable
...
We can't access those mips via locking in D3D9 so it's a-okay! :)
2020-01-24 15:54:15 +00:00
Joshua Ashton
2004fba22c
[util] Disable d3d9.allowDoNotWait for RTHDRIBL
...
This app goes into an infinite loop if it gets D3DERR_WASSTILLDRAWING and the perf penalty of blocking on GetRenderTargetData in other apps is too high!
2020-01-24 15:54:15 +00:00
Joshua Ashton
f804c6364d
[d3d9] Implement d3d9.allowDoNotWait
2020-01-24 15:54:15 +00:00
Joshua Ashton
764cb5634f
[d3d9] Unmark resources as dirty if they get discarded
2020-01-24 15:54:15 +00:00
Joshua Ashton
6fa28bf937
[d3d9] Don't block on GetRenderTargetData
...
Fixes perf in #1363
2020-01-24 15:54:15 +00:00
Philip Rebohle
7469f5d4a0
[util] Disable supportDFFormats for Gothic 3
...
See #1367 .
2020-01-24 14:21:28 +01:00
Philip Rebohle
38a0d2c552
[d3d9] Don't check for sRGB formats when retrieving back buffer view
...
Turns out this is always false anyway.
2020-01-24 01:47:52 +01:00
Philip Rebohle
582b06a706
[d3d9] Rotate swap chain back buffers
...
Restores functionality removed in 81c3daa3d0
.
2020-01-24 00:27:09 +00:00
Philip Rebohle
6a6af16195
[d3d9] Retrieve back buffer view from the D3D9Surface
2020-01-24 00:27:09 +00: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
Florian Will
0b3f9718c9
[d3d9] Fix some off-by-one TSS types enum values
...
They are 0-based instead of 1-based, and therefore supposed to be
off-by-one compared to D3DTEXTURESTAGESTATETYPE, but three values in the
enum are actually off-by-two.
For me, this fixes some odd rail rendering in ZUSI 3.
Fixes: 7d0ddc4b
2020-01-23 17:26:51 +00:00
Joshua Ashton
792c74e1d9
[d3d9] Fix texture stage index in stateblocks
...
Fixes minimap transparency in FHX https://github.com/Joshua-Ashton/d9vk/issues/306
2020-01-23 02:19:43 +00:00
Joshua Ashton
9919ffe5ca
[util] Add simple [] operator to our bitset
2020-01-23 02:05:09 +00:00
Joshua Ashton
7d0ddc4b3b
[d3d9] Remap texture stage state types onto our own enum
...
Fits us nicely into a dword for captures while not exclusing D3DTSS_CONSTANT
2020-01-23 02:05:09 +00:00
Joshua Ashton
a1cad25a51
[d3d9] Remove unnecessary loops for some stateblocks applications
2020-01-23 02:05:09 +00:00
Philip Rebohle
21330497e0
[util] Add app profile for Entropia Universe
...
Fixes #1364 (again).
2020-01-23 01:31:57 +01:00
Philip Rebohle
9721938e57
[d3d11] Introduce d3d11.invariantPosition option
...
Apparently it's better to make app profiles than risk tanking
performance for all applications. Invariance rules in D3D11 are
undocumented so it's not clear what the correct solution is.
2020-01-23 01:28:19 +01:00
Philip Rebohle
11f08c7dea
[dxbc] Declare vertex positions as invariant
...
Otherwise, games relying on different vertex shaders to produce
the same numerical results may suffer from Z-fighting issues.
Fixes #1364 .
2020-01-22 23:59:51 +01:00
Joshua Ashton
ff2c6a076f
[d3d9] Fix opSelect condition vector size
...
Fixes invalid fixed function shaders
2020-01-22 22:54:27 +00:00
Joshua Ashton
7de15fe837
[util] Spoof AMD for Skyrim (nvapi)
2020-01-22 16:20:42 +00:00
Philip Rebohle
a57dc75247
[d3d11] Implicitly begin scoped queries in End if necessary
...
Matches (undocumented) D3D11 behaviour. Warriors Orochi 4 runs into
this because it does not begin some of its timestamp disjoint queries
before ending them and retrieving data.
2020-01-22 04:17:13 +01:00
Joshua Ashton
35a9934cde
[d3d9] Make unbound textures return (0, 0, 0, 1) (fixed func)
...
Fixes sky in Ferentus Herrcot Xiones
https://github.com/Joshua-Ashton/d9vk/issues/306
2020-01-18 03:10:47 +00:00
Joshua Ashton
4810a5dc72
[dxso] Make unbound textures return (0, 0, 0, 1)
...
Matches native behaviour
2020-01-18 03:10:47 +00:00
Philip Rebohle
eed57ed6c4
[util] Enable d3d9.deferSurfaceCreation for a ton of weeb games
2020-01-17 18:29:15 +01:00
Philip Rebohle
caae5d18ed
[d3d9] Remove unused variable
...
Fixes a compiler warning.
2020-01-17 18:04:09 +01:00
Philip Rebohle
609856db35
[d3d9] Create front buffer
2020-01-17 18:04:09 +01:00
Philip Rebohle
f20a3c07fb
[d3d9] Don't create sRGB views for non-sRGB compatible textures
...
Otherwise we end up creating views with VK_IMAGE_FORMAT_UNDEFINED.
2020-01-17 17:47:08 +01:00
Philip Rebohle
296aacb23e
[d3d9] Return specific image view from GetSampleView
...
Lets us have pick the sRGB-ness of the view in one place. Needed
for the next patch.
2020-01-17 17:47:08 +01:00
Philip Rebohle
905d69e77b
[d3d9] Don't pass format mapping to D3D9CommonTexture
...
Instead, infer it from the format. This is basically being done
already, however the mapping we pass in is not correct if the
image format is Unknown.
2020-01-17 17:47:08 +01:00
Philip Rebohle
7150d2b7fb
[dxvk] Don't enable VK_KHR_descriptor_update_template
...
Core in Vulkan 1.1.
2020-01-17 17:46:59 +01:00
Philip Rebohle
4923bc20f7
[dxvk] Don't enable VK_KHR_shader_draw_parameters
...
Core in Vulkan 1.1.
2020-01-17 17:46:59 +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
60145f0167
[dxvk] Don't enable VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2
...
Core in Vulkan 1.1.
2020-01-17 17:46:59 +01:00
Philip Rebohle
252ec9406d
[dxvk] Don't enable VK_KHR_get_physical_device_properties2
...
Core in Vulkan 1.1.
2020-01-17 17:46:59 +01:00
Philip Rebohle
6690a31d8d
[dxbc] Don't enable SPV_KHR_shader_draw_parameters
...
Core in SPIR-V 1.3.
2020-01-17 17:46:59 +01:00
Philip Rebohle
7e35a0687b
[d3d9] Don't enable DrawParameters capability
...
Not used in D3D9 shaders.
2020-01-17 17:46:59 +01:00
Joshua Ashton
b954ab886f
[d3d9] Implement GetFrontBufferData (currently with first backbuffer)
...
Fixes screenshots in ATi ToyShop demo
2020-01-17 06:01:48 +00:00
Joshua Ashton
e5df573292
[d3d9] Add AreFormatsSimilar helper
2020-01-17 05:55:47 +00:00
Joshua Ashton
9fce945b62
[d3d9] Don't create views if we are a null resource
2020-01-17 04:20:05 +00:00
Philip Rebohle
bafcaa0c07
[dxvk] don't try to fall back to Vulkan 1.0
...
Vulkan 1.1 came out in early 2018, everyone should be using a
compatible driver and ICD loader these days.
2020-01-16 19:48:10 +01:00
Philip Rebohle
eb37dfa8d2
[d3d9] Create multiple back buffers for GetBackBuffer API
...
Needed by Atelier Sophie.
2020-01-16 18:50:23 +01:00
Philip Rebohle
c911784bb8
[d3d9] Synchronize with presentation in D3D9SwapChainEx::Reset
...
Otherwise, the subsequent patches would break if Reset is called
while there's still a frame in flight.
2020-01-16 18:50:23 +01:00
Philip Rebohle
41a91cbae6
[dxvk] Implement image swapping
2020-01-16 18:50:23 +01:00
Philip Rebohle
5193e8ef24
[dxvk] Introduce DxvkPhysicalImage
2020-01-16 18:50:23 +01:00
Philip Rebohle
2c457e496a
[dxvk] Register image views with the parent image
...
Needed for image renaming.
2020-01-16 18:50:23 +01:00
Philip Rebohle
8770a14743
[dxvk] Use small_vector to store image view format compatibility list
...
Avoids some memory allocations, but increases the object size slightly.
2020-01-16 18:50:23 +01:00
Philip Rebohle
70e52aa6f2
[dxvk] Factor out image view creation
2020-01-16 18:50:23 +01:00
Philip Rebohle
e4215252df
[util] Add small_vector helper
...
A vector with a small fixed-size array, which changes to a dynamic
array as needed. Can be used to avoid memory allocations in some
scenarios.
2020-01-16 18:50:23 +01:00
Andrew Eikum
5706ec55e4
[dxgi] Don't check window validity in IDXGISwapchain::GetFullscreenState
...
This causes an error on exit in Jump King, which uses SharpDX.
2020-01-16 17:50:32 +01:00
Joshua Ashton
9e5e4c1cfc
[d3d9] Don't mark for hazards if we aren't rendering to mip 0
2020-01-16 03:04:58 +00:00
Joshua Ashton
7c53a997ef
[d3d9] Keep subresource views in subresources, defer creation until needed
...
Avoid creating a bunch of views that we probably don't need whenever a texture is created
2020-01-16 03:00:31 +00:00
Philip Rebohle
18450f4643
[d3d11] Lock immediate context when submitting presentation commands
...
Otherwise, a race condition occurs if a game submits rendering commands
at the same time as presenting the swap chain image. Only works if
multithreaded protection is enabled, but according to MSDN, it is
illegal to use DXGI commands and the immediate context in parallel.
Fixes stability issues in Tales of Vesperia.
2020-01-15 23:48:58 +01:00
Joshua Ashton
a7b4c29957
[dxso] Use m's id for bump matrix in TexBem
...
Fixes refractive windows in Vampire The Masquerade: Bloodlines
Was also a silly typo given my comment right above about it 🐸 !
2020-01-15 18:04:04 +00:00
Joshua Ashton
64ece36349
[d3d9] Implement d3d9.forceSwapchainMSAA
...
Works good enough for some titles like Vampire The Masquerade: Bloodlines.
2020-01-11 02:34:37 +00:00
Joshua Ashton
3ebd4b28a3
[d3d9] Defer dialog mode swapchain recreation decision to Present
...
Avoids unnecessary swapchain recreations if the game calls SetDialogBoxMode multiple times per frame
2020-01-10 04:30:55 +00:00
Joshua Ashton
9647e449d2
[d3d9] Remove redundant logging from SetDialogBoxMode
...
This path doesn't error anyway...
2020-01-10 04:30:02 +00:00
Philip Rebohle
4308d9b4b3
[meta] Release 1.5.1
2020-01-09 20:10:58 +01:00
Philip Rebohle
79fcaa9fba
[d3d9] Remove unused variable from D3D9DeviceEx::Clear
...
Fixes a compiler warning.
2020-01-09 18:06:58 +00:00
Philip Rebohle
cd00719122
[dxvk] Tweak number of pipeline compiler threads
...
Gives some 6-core and 8-core CPUs a bit more breathing room, while
also supporting up to 32 workers instead of just 16 to leverage
the new high core count Ryzen CPUs.
2020-01-09 18:04:25 +01:00
Joshua Ashton
47555f1dda
[d3d9] Add GetSurfaceExtent helper
2020-01-09 03:29:58 +00:00
Joshua Ashton
cd58b147a1
[d3d9] Respect mip != 0 for Clear fastpath
2020-01-09 03:24:50 +00:00
Joshua Ashton
ebcab68822
[d3d9] Respect specific mip size for implicit viewport in SetRenderTarget
...
Closes #1295
2020-01-09 03:19:37 +00:00
Joshua Ashton
3cfc16ea34
[d3d11] Move shader stage and buffer slot calc to inside lambda
...
Take advantage of the fact that template permutations transfer into lambdas inside of them.
Removes some unnecessary captures.
2020-01-08 23:09:53 +01:00
Joshua Ashton
b738c4220b
[d3d9] Scale depth bias value based on current format's r
value
2020-01-08 19:38:18 +00:00
Joshua Ashton
2d7f4b1a2c
[d3d9] Set depth bias values separately, optimize redundant rasterizer state changes
2020-01-08 19:38:18 +00:00
Philip Rebohle
b376417f20
[dxvk] Fix loading vkAcquireFullScreenExclusiveModeEXT etc.
...
We're not using those functions, but these are device functions, not
instance functions. vkGetPhysicalDeviceSurfacePresentModes2EXT appears
to be an instance function.
Found while investigating #1324 .
2020-01-08 04:10:10 +01:00
Philip Rebohle
8b9c03ce76
[util] Improve Spinlock implementation
...
Addresses two potential issues:
- Our spinlocks are almost never contested, however the code generated
is not ideal without the likely/unlikely hints.
- In the unlike event that a spinlock is in fact contested, we'd yield
immediately, even though most of the time we'd only have to wait for
a few hundred cycles at most.
Replacing our spinlocks with std::mutex is not an option due to much
higher locking overhead in the uncontested case; doing so reduces
performance significantly for the buffer slice and pipeline locks.
2020-01-07 17:28:33 +01:00
Joshua Ashton
9541aef0b8
[d3d9] Ensure D3DDISPLAYMODEEX we use to call the Ex funcs has its size set correctly
2020-01-06 04:14:02 +00:00
Joshua Ashton
61b6f8f297
[d3d9] Hook up GetAdapterDisplayMode to resp. adapter func
...
Fixes fullscreen at < native res in Vampire: The Masquerade Bloodlines 1/2
2020-01-06 04:07:02 +00:00
Joshua Ashton
91574993df
[d3d9] Return current display mode in GetAdapterDisplayModeEx rather than last mode
...
Fixes fullscreen at < native res in Vampire: The Masquerade Bloodlines 1/2
2020-01-06 04:06:45 +00:00
Joshua Ashton
845ab2b5af
[d3d9] Don't re-set dialogbox mode on swapchain Reset
...
There's no reason to do this now that we have no error path in SetDialogBoxMode...
2020-01-04 21:12:53 +00:00
Joshua Ashton
d53b3adaea
[d3d9] Remove incorrect error returns SetDialogBoxMode
...
The Microsoft docs for this are incorrect based on my tests of all the described edge-cases.
https://docs.microsoft.com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-setdialogboxmode
2020-01-04 21:10:26 +00:00
Philip Rebohle
ae01bd8bd4
[dxgi] Ignore sync interval if PRESENT_TEST is used
...
Otherwise, the following sequence leads to the Vulkan
swap chain being recreated once per frame:
swapchain->Present(0, DXGI_PRESENT_TEST);
swapchain->Present(1, 0);
Found while investigating #1314 .
2020-01-04 11:18:51 +01:00
Philip Rebohle
3db00a0f40
[d3d11] Increment transfer command counter when initializing UAV counter
...
Otherwise, we won't clear the counter before it is being used if there are
no other transfer commands recorded to the initializer command buffer.
2020-01-03 13:44:23 +01:00
Joshua Ashton
0343938c2e
[util] Enable d3d9.forceSamplerTypeSpecConstants for Halo [CE]
...
The game uses incorrect sampler types in the shaders for glass rendering which breaks it on native + us if we don't spec-constantly chose the sampler type automagically.
2020-01-01 20:58:42 +00:00
Joshua Ashton
c024b89171
[dxso] Implement d3d9.forceSamplerTypeSpecConstants
...
This option makes us always use a spec constant to determine sampler type (instead of just in PS 1.x)
which works around a game bug in Halo CE where it gives cube textures to 2d/volume samplers
2020-01-01 20:56:05 +00:00
Philip Rebohle
694d6c7f77
[util] Improve ticket lock implementation
...
Atomic fetch-and-add on unlock is not needed since no other thread can
modify the serving counter after the calling thread acquired the lock.
May slightly improve performance in games relying on ID3D10Multithread.
2020-01-01 13:59:46 +01:00
Joshua Ashton
ff129abaf0
[d3d9] Fix crash when trying to present with a currently invalid presenter
...
Closes #1304
2019-12-28 01:27:18 +00:00
Joshua Ashton
0993f6f25d
[dxso] Negate reflection in TexM3x3VSpec
2019-12-25 18:43:51 +00:00
Joshua Ashton
66fee8ff51
[dxso] Normalize eyeRay and normal before reflection in TexM3x3Spec
2019-12-25 18:36:34 +00:00
Joshua Ashton
e0b83b13b5
[dxso] Only track co-issue parent opcode rather than the full context
...
Tracking the full instruction ctx is slow and unnecessary
2019-12-25 18:00:46 +00:00
Joshua Ashton
724fe78ba1
[dxso] Don't emit a co-issue for CNDs parented to a CND
...
Closes #1309
2019-12-25 17:43:35 +00:00
Joshua Ashton
b4f2094c02
[d3d9] Enable bounds testing for D3DPOOL_SYSTEMMEM buffers
...
Improves performance in Halo CE.
2019-12-22 19:05:22 +00:00
Joshua Ashton
d39ff9020e
[dxso] Perform saturate after bitshift modifier
2019-12-22 18:14:46 +00:00
Joshua Ashton
3ff9c4cc43
[dxso] Track and prioritize co-issued CNDs above their parent ops
2019-12-22 17:46:57 +00:00
Joshua Ashton
4d6fbacd3a
[dxso] Keep track of the current instruction index in a decoding context
2019-12-22 17:44:30 +00:00
Joshua Ashton
abf74299e9
[dxso] Parse co-issue instruction modifier
2019-12-22 17:44:04 +00:00
Joshua Ashton
fb4d794412
[d3d9] Use VK_FORMAT_D24_UNORM_S8_UINT for D3DFMT_DF24
...
May improve performance in some instances
2019-12-22 01:46:50 +00:00
Joshua Ashton
05de0b20a0
[d3d9] Use VK_FORMAT_D24_UNORM_S8_UINT for D3DFMT_D24X8
...
May improve performance in some instances
2019-12-22 01:43:36 +00:00
Joshua Ashton
90ce37c8c9
[d3d9] Make ChangeReportedMemory actually atomic
...
Massive edge case that will never happen, but better to be safe than sorry.
Reduces the atomic ops too.
2019-12-20 18:07:35 +00:00
Joshua Ashton
fae99907da
[util] Add get to bitset
2019-12-18 23:18:01 +00:00
Joshua Ashton
5cc0fd5c25
[d3d9] Simplify SetViewport
...
pViewport == nullptr is illegal
2019-12-18 23:18:01 +00:00
Joshua Ashton
bab56433cb
[d3d9] Avoid rebinding scissor rects if the same one is re-set
2019-12-18 23:18:01 +00:00
Joshua Ashton
288a9dd547
[d3d9] Avoid rebinding viewports if the same one is re-set
2019-12-18 23:18:01 +00:00
Joshua Ashton
9ec0541b93
[d3d9] Still rebind viewport/scissor when setting the same RT
...
Closes #1290
2019-12-18 23:18:01 +00:00
Joshua Ashton
7b0723520a
[d3d9] Add operator overloads for RECT
2019-12-18 23:18:01 +00:00
Joshua Ashton
777cd4cd64
[d3d9] Add operator overloads for D3DVIEWPORT9
2019-12-18 23:01:16 +00:00
Alessandro Toia
3c8fdc2863
Report gpu vendor as Nvidia for Star Wars Battlefront II
2019-12-18 17:38:24 +01:00
Philip Rebohle
31948cae8c
[spirv] Allow specifying the SPIR-V version explicitly
...
We're going to use some SPIR-V 1.4 features for D3D11 if supported,
but 1.4 is not supported by all implementations.
2019-12-18 17:36:46 +01:00
Joshua Ashton
78e4816fc0
[d3d9] Avoid unnecessary state block constant bits when not SWVPing
2019-12-18 14:48:01 +01:00
Joshua Ashton
312905e8a3
[d3d9] Use new bitset helper + tzcnt for stateblocks
2019-12-18 14:48:01 +01:00
Joshua Ashton
b99b1d153a
[util] Add bitset helper
2019-12-18 14:48:01 +01:00
Joshua Ashton
784abe5cf4
[d3d9] Move auto depth stencil creation to after swapchain creation
...
If the app specifies w == 0 and/or h == 0 then this will be filled in by then in the presentation params.
Impacts #1278
2019-12-18 00:09:55 +00:00
Joshua Ashton
009e772fe8
[d3d9] Remove initial device reset outside of constructor
...
Allows us to funnel hresults from that to the response of CreateDevice
2019-12-17 23:59:37 +00:00
Joshua Ashton
3b119c0be6
[d3d9] Log unavailable backbuffer format if encountered when resetting swapchain
2019-12-17 22:36:27 +00:00
Joshua Ashton
3abd30bb96
[d3d9] Fix return value for invalid backbuffer formats
...
This got changed when I saw that the auto depth stencil when set to an unavailable returns D3DERR_NOTAVAILABLE.
Turns out if the backbuffer is unavailable it returns D3DERR_INVALIDCALL...
Consistent...
Closes #1278
2019-12-17 22:36:27 +00:00
Philip Rebohle
a265af74ed
[hud] Respect dxvk.hud configuration option again
...
This was accidentally dropped during the HUD refactor. Fixes #1279 .
2019-12-17 04:40:06 +01:00
Joshua Ashton
e527b963c4
[util] Handle undefined ratios in simplest ratio helper
...
Fixes division by zero error
Closes #1280
2019-12-17 03:16:56 +00:00
Joshua Ashton
91b5105db5
[d3d9] Move capture struct and enum to stateblock header
...
Makes more sense for it to be here.
2019-12-17 03:16:50 +00:00
Philip Rebohle
3cdae3ae1d
[meta] Release 1.5
2019-12-16 14:41:29 +01:00
Philip Rebohle
9be0bf95ca
[util] Defer D3D9 surface creation for Atelier Ryza
2019-12-16 14:41:29 +01:00
Joshie
54ed8f0bb0
[d3d9] Implement Direct3D9 Frontend ( #1275 )
...
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Co-authored-by: Robin Kertels <robin.kertels@gmail.com>
Co-authored-by: pchome <pchome@users.noreply.github.com>
Co-authored-by: Christopher Egert <cme3000@gmail.com>
Co-authored-by: Derek Lesho <dereklesho52@Gmail.com>
Co-authored-by: Luis Cáceres <lacaceres97@gmail.com>
Co-authored-by: Nelson Chen <crazysim@gmail.com>
Co-authored-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Co-authored-by: Riesi <riesi@opentrash.com>
Co-authored-by: gbMichelle <gbmichelle.dev@gmail.com>
2019-12-16 04:28:01 +01:00
Philip Rebohle
566fb84abd
[hud] Allocate vertex buffer in host-visible device memory if possible
2019-12-16 00:24:19 +01:00
Philip Rebohle
c6fb8fa5e8
[hud] Clean up HUD rendering
...
- Avoids rebinding the vertex buffer on every single draw.
- Avoids push constants. We could use MultiDrawIndirect in the future.
- Slightly reduces the vertex buffer size.
2019-12-16 00:03:21 +01:00
Philip Rebohle
13d2479ecf
[hud] Don't create uniform buffer
...
No longer used.
2019-12-15 23:17:23 +01:00
Philip Rebohle
9c6ff95bb6
[hud] Don't use vertex shader for scaling
...
Instead, do it on the CPU.
2019-12-15 23:13:59 +01:00
Philip Rebohle
aa40decc23
[d3d11] Don't present if the presenter has no swap chain.
...
Also fixes DXGI_PRESENT_TEST handling for zero-sized windows.
2019-12-15 11:38:57 +01:00
Philip Rebohle
2d0c9127f3
[vulkan] Don't create a swap chain if the window size is 0
...
This can actually happen on win32, and creating a zero-sized swap
chain is illegal.
2019-12-15 11:32:43 +01:00
Philip Rebohle
ae7189f9a4
[d3d11] Update HUD on CS thread
...
Otherwise, we may end up reading some bollocks since the CS thread
might not have finished processing the entire frame yet.
2019-12-13 15:02:45 +01:00
Philip Rebohle
2689204d74
[hud] Enable manual sRGB conversion for non-sRGB swap chains
...
We still blend in the wrong color space, but text should be a bit
more readable in some games now.
2019-12-13 14:03:00 +01:00
Philip Rebohle
08d5b4e0e7
[hud] Don't average the draw call count
...
Turns out this was a bad idea.
2019-12-13 13:14:23 +01:00
Philip Rebohle
ef99078fc4
[hud] Reduce update frequency of draw call display
2019-12-13 13:05:49 +01:00
Philip Rebohle
2c4879b58c
[hud] Reduce update frequency of queue submission display
...
Shows the maximum number of submissions encountered per frame
in the given time frame.
2019-12-13 13:01:44 +01:00
Philip Rebohle
3febca6863
[hud] Add colorful labels
2019-12-13 12:34:01 +01:00
Philip Rebohle
5da27a92f5
[hud] Fix letter spacing
2019-12-13 12:17:15 +01:00
Philip Rebohle
7a18cb1227
[dxvk] Remove unused memory stat counters
2019-12-13 12:08:36 +01:00
Philip Rebohle
ed69da0fff
[hud] Remove legacy code
2019-12-13 11:58:09 +01:00
Philip Rebohle
3415376984
[hud] Implement compiler activity display as a HUD item
2019-12-13 11:54:51 +01:00
Philip Rebohle
5d8ae8f988
[hud] Implement GPU load display as a HUD item
2019-12-13 11:54:51 +01:00
Philip Rebohle
936f22d2aa
[hud] Implement memory stats display as a HUD item
2019-12-13 11:54:50 +01:00
Philip Rebohle
3aff573bd4
[hud] Implement pipeline stat display as a HUD item
2019-12-13 11:54:26 +01:00
Philip Rebohle
3de8499697
[hud] Implement draw call stats display as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
0f2610010b
[hud] Implement queue submission counter as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
07a4504a9f
[hud] Implement frame time graph as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
2d5f44a7ff
[hud] Implement FPS display as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
0da5aac357
[hud] Implement Vulkan device info as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
e4bc5c2aee
[hud] Implement client API info as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
1c079a96e5
[hud] Implement DXVK version info as a HUD item
2019-12-13 11:54:13 +01:00
Philip Rebohle
6931f03120
[hud] Add new HUD item abstraction
...
Allows for a cleaner and more flexible implementation of new HUD elements.
The old implementation was not intended to support quite as many elements
as it does, and now there is some need for API-specific HUD elements.
2019-12-13 11:54:13 +01:00
Philip Rebohle
4346f82209
[hud] Don't pass DXVK context around in HUD modules
2019-12-13 11:54:13 +01:00
Philip Rebohle
8e587af0da
[dxvk] Add method to retrieve per-heap memory stats
2019-12-13 11:54:13 +01:00
Philip Rebohle
4fcf28f4dc
[util] Spoof Nvidia cards for Crysis 3
...
The game for some reason runs significantly slower in CPU-bound scenarios
when it recognizes an AMD GPU. On the other hand, there seems to be a small
performance hit on an actual Nvidia GPU (GTX 670) in GPU-bound scenarios when
doing this, but on most setups the tradeoff should be worth it.
2019-12-11 23:01:27 +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
Joshua Ashton
f5dd509429
[spirv] Implement constbReplicant
2019-12-11 03:18:39 +01:00
Joshua Ashton
8b6dd0544e
[spirv] Implement constvec4b32
2019-12-11 03:18:39 +01:00
Joshua Ashton
028c6198e4
[spirv] Implement opReflect
2019-12-11 03:18:39 +01:00
Joshua Ashton
3ce678b17d
[spirv] Implement opExp
2019-12-11 03:18:39 +01:00
Joshua Ashton
fdbfb2c92d
[spirv] Implement opInverse, opNormalize and opLength
2019-12-11 03:18:39 +01:00
Joshua Ashton
edf0661994
[spirv] Implement opTranspose
2019-12-11 03:18:39 +01:00
Joshua Ashton
e144c17363
[spirv] Implement constfReplicant helper
2019-12-11 03:18:39 +01:00
Joshua Ashton
7a956ef8c8
[dxvk] Expose ability to retrieve type from DxvkShaderKey
2019-12-11 03:18:39 +01:00
Joshua Ashton
7c8d03b3e1
[dxvk] Add helper to get size of memory/image in bytes
2019-12-11 03:18:39 +01:00
Philip Rebohle
3063d7fc7c
[dxvk] Improve DxvkImageView::handle()
...
Should fix a silly compiler warning and improves code gen, which
is important since this is *the* most frequently called function
in the backend.
2019-12-11 03:18:39 +01:00
Joshua Ashton
d5d6ae4fe1
[dxvk] Add support for implicit samplers
2019-12-11 03:18:39 +01:00
Joshua Ashton
3fa8691033
[util] Implement simplest ratio helper
2019-12-11 03:18:39 +01:00
Joshua Ashton
16dd1249b7
[util] Add alignDown helper
2019-12-11 03:18:39 +01:00
Joshua Ashton
57b2c02528
[util] Implement lzcnt
2019-12-11 03:18:39 +01:00
Joshua Ashton
aef12f7ee3
[util] Add countof helper
2019-12-11 03:18:39 +01:00
Joshua Ashton
d4cad9055c
[util] Implement a clamped version of ComObject, for D3D9
...
Satisfies a quirk in D3D9, solving an issue in SWTFU.
2019-12-11 03:18:39 +01:00
Joshua Ashton
511ed27733
[util] Add GetPrivateRefCount helper
2019-12-11 03:18:39 +01:00
Joshua Ashton
9280818a57
[util] Implement fclamp for fp special cases
2019-12-11 03:18:39 +01:00
Joshua Ashton
ec197b49f9
[util] Implement some basic vector and matrix math utils
2019-12-11 03:18:39 +01:00
Joshua Ashton
d44707e349
[util] Mark clamp & align as constexpr
2019-12-11 03:18:39 +01:00
Joshua Ashton
a3f74b5eda
[util] Implement bit cast.
2019-12-11 03:18:39 +01:00
Philip Rebohle
fc91fe1d34
[dxgi] Add fake implementation of DxgiFactory::EnumWarpAdapter
...
Apparently FIFA 19 needs this.
2019-12-09 23:27:56 +01:00
Philip Rebohle
945a64252d
[d3d11] Determine exclusive fullscreen mode based on swap chain flags
2019-12-05 13:11:06 +01:00
Philip Rebohle
575a267f07
[vulkan] Support exclusive fullscreen control in presenter
2019-12-05 13:10:11 +01:00
Philip Rebohle
9c26fad40e
[vulkan] Add feature bit for exclusive fullscreen control
2019-12-05 13:05:54 +01:00
Philip Rebohle
dc13f48318
[dxvk] Enable VK_EXT_full_screen_exclusive if available
...
Also pulls in VK_KHR_get_surface_capabilities2 as a dependency.
2019-12-05 13:05:51 +01:00
Philip Rebohle
07c2de62be
[d3d11] Silence some errors about invalid API usage on deferred contexts
...
Halo MCC apparently spams calls to GetData on deferred contexts, which
is obviously illegal.
2019-12-04 20:18:51 +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
0e44bc3068
[meta] Release 1.4.6
2019-12-03 14:52:22 +01:00
Philip Rebohle
27ea176295
[d3d11] Remove d3d11.strictDivision option
2019-11-30 20:39:32 +01:00
Philip Rebohle
3230cec3f3
[util] Enable d3d11.enableRtOutputNanFixup for FFXIV
...
And disable strict division. The previous workaround broke radial blur.
2019-11-30 20:39:32 +01:00
Philip Rebohle
3b030d9569
[dxbc] Implement workaround to replace NaN render target outputs by zero
2019-11-30 20:39:32 +01:00
Philip Rebohle
2e51e28849
[spirv] Implement opIsNan
2019-11-30 20:39:28 +01:00
Luis Cáceres
abff2afeaf
[dxvk] Fix multiple inclusion of dxvk_platform_exts.h
...
This fixes build failures when using `--unity on` meson parameter
2019-11-28 17:43:08 +01:00
Philip Rebohle
5fe8d823a0
[dxvk] Disable VK_EXT_conditional_rendering
...
We're currently not using it, and it prevents sharing RenderDoc captures
between different AMD drivers.
2019-11-28 15:41:02 +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
49e7df96ec
[dxbc] Emit a spec constant for uniform buffers
...
This partially reverts commit fd547b666e
.
For some reason, not doing so breaks Overwatch (because of course it does).
2019-11-28 00:55:38 +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
32ac8a8d51
[util] Make Fence and Win32Fence final
...
Otherwise, Josh will keep complaining about this until the end of time.
2019-11-27 12:31:17 +01:00
Philip Rebohle
c9c6b1886b
[d3d11] Synchronize presentation when destroying swap chain
...
Otherwise, we might destroy the presenter before the CS thread
actually issues the present operation, and the waitForIdle has
not the desired effect.
2019-11-26 23:51:31 +01:00
Philip Rebohle
9ccad0d197
[dxvk] Use waitForIdle when destroying DXVK device
...
Otherwise, we might call vkDeviceWaitIdle before all command buffers
have been submitted to the Vulkan queue. Found by inspection.
2019-11-26 22:06:13 +01:00
Philip Rebohle
7446d3c58a
[dxgi] Don't allow changing the FRAME_LATENCY_WAITABLE_OBJECT flag
2019-11-26 16:54:52 +01:00
Philip Rebohle
9785fba66e
[dxgi] Implement IDXGISwapChain2::GetFrameLatencyWaitableObject
2019-11-26 16:54:52 +01:00
Philip Rebohle
65cc8c2b31
[d3d11] Create frame latency event for swap chain
...
Needed in order to support the DXGI 1.3 frame latency API.
2019-11-26 16:54:52 +01:00
Philip Rebohle
6ebf3e1656
[util] Implement fence capable of signaling win32 events
2019-11-26 16:11:46 +01:00
Philip Rebohle
ef37b5fed6
[dxgi] Implement IDXGISwapChain2::SetFrameLatency
2019-11-26 16:11:46 +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
69bad7bf8c
[d3d11] Move frame latency handling into D3D11SwapChain
2019-11-26 16:11:46 +01:00
Philip Rebohle
a0651392c4
[dxvk] Fix include awfulness
2019-11-26 16:10:58 +01:00
Philip Rebohle
e648d59a10
[util] Fix winelib build
...
Fixes #1256 .
2019-11-26 16:09:35 +01:00
Joshua Ashton
bf14371f9e
[util] Wide character conversion changes
...
Replaces tows with an easier helper that fits in nicer with fixed-size arrays in DXGI, etc.
Prefer UTF8 in tows/fromws.
2019-11-26 01:53:49 +01:00
Joshua Ashton
7e3142b2ed
[d3d11] Hook up platform-specific clock
...
See 89dfa2bc22
2019-11-26 01:52:58 +01:00
Joshua Ashton
c39c3e8dcc
[dxvk] Hook up platform-specific clock
...
See 89dfa2bc22
2019-11-26 01:52:58 +01:00
Joshua Ashton
38f945bf0b
[util] Add platform-specific clock implementation
...
MinGW calls to GetSystemTimeAsFileTime via gettimeofday for std::chrono::high_resolution_clock::now,
This is horribly slow and inaccurate.
There are also issues if MinGW is not built with libstdc++ at the same time that can cause the precision to be bad enough to cause massive hangs.
This effectively works around that as well.
Relevant: ValveSoftware/Proton#3198
2019-11-26 01:52:58 +01:00
Philip Rebohle
25a1e0d355
[d3d11] Actually fix subresources discarded by DiscardView1
2019-11-24 00:34:15 +01:00
Philip Rebohle
53fca5143f
[d3d11] Ignore D3D11_COPY_DISCARD
...
Various truck simulations are broken and set this on every
CopySubresourceRegion call, which, if we were to implement
DiscardBuffer for non-mappable resources again, would break
them. This flag seemingly has no effect on native D3D11.
2019-11-24 00:08:06 +01:00
Philip Rebohle
a7c21a617c
[d3d11] Overhaul DiscardResource and DiscardView implementations
...
For host-visible resources, these behave like MAP_DISCARD.
Euro Truck Simulator 2 and friends relies on this (see #1250 ).
2019-11-23 23:57:07 +01:00
Philip Rebohle
1211bb5e5f
[dxvk] Sort buffer slices before returning them to the buffer
...
Buffer slices often get shuffled over time due to timing and thread
synchronization, which makes it less and less likely for the dynamic
uniform buffer binding optimization to be effective. Sorting the
slices beforehand addresses the issue and may help CPU performance.
2019-11-23 00:42:54 +01:00
Philip Rebohle
596001c37e
[dxvk] Enable shader-based depth-stencil copies for AMDVLK
...
Turns out to be slightly faster in practice.
2019-11-22 02:12:02 +01:00
Philip Rebohle
9e965546fc
[meta] Release 1.4.5
2019-11-19 23:36:01 +01:00
Philip Rebohle
6b3d60ab25
[dxvk] Enable asynchronous presentation on all hardware
...
...and remove the dxvk.asyncPresent option.
2019-11-19 23:34:24 +01:00
Philip Rebohle
ceddbaf7c4
[dxvk] Fix synchronization around vkDeviceWaitIdle
...
From the spec:
"Host access to all VkQueue objects created
from device must be externally synchronized"
We were not doing that, which could cause hangs and
all sorts of issues when recreating the swap chain
on Nvidia GPUs.
2019-11-19 23:34:14 +01:00
Philip Rebohle
4fff2343c1
[dxvk] Fix handling of undefined shader inputs
...
If the previous stage or the input layout does not define an input,
D3D11 will read zeroes wheras the result is undefined in Vulkan.
Fixes performance degradation and rendering issue in Final Fantasy XV
with the "Geomapping" (terrain tessellation) option enabled.
2019-11-19 15:34:29 +01:00
Philip Rebohle
a1f55330ee
[dxvk] Implement pass to eliminate undefined shader input variables
2019-11-19 15:26:32 +01:00
Philip Rebohle
5a2fd7c71b
[spirv] Add method to retrieve literal string from instruction
2019-11-19 12:49:07 +01:00
Philip Rebohle
8252d1ccd5
[spirv] Add method to erase data from code buffer
2019-11-19 12:17:11 +01:00
Philip Rebohle
9f88249b91
[spirv] Add method to allocate new ID from code buffer.
2019-11-19 12:12:05 +01:00
Philip Rebohle
014798161c
[dxvk] Avoid some unnecessary barriers around render target clears
2019-11-18 19:36:19 +01:00
Philip Rebohle
c7718e5952
[d3d11] Zero-initialize UAV counters
...
Fixes a hang in Dirt Rally on RADV.
2019-11-18 18:40:39 +01:00
Philip Rebohle
cee7db1c57
[dxvk] Always align texel buffers to at least 16 bytes
...
Since we don't know the view format in advance, and some
drivers require single-texel alignment.
2019-11-18 13:45:35 +01:00
Philip Rebohle
73a5b33375
[d3d11] Also fix reset counter memory order for deferred context queries
2019-11-15 19:48:41 +01:00
Philip Rebohle
e787077554
[util] Remove traces of the allowMapFlagNoWait option
2019-11-15 19:45:40 +01:00
Philip Rebohle
c24dad75dc
[d3d11] Remove allowMapFlagNoWait option
2019-11-15 11:09:11 +01:00
Philip Rebohle
dbc14fe65c
[d3d11] Fix memory order for query reset counter
...
Probably doesn't change anything, but let's fix it anyway.
2019-11-14 23:43:58 +01:00
Philip Rebohle
a6483e02fe
[d3d11] Submit stalling event queries before flushing
...
Otherwise, instead of preventing syncs, this would actually
have the opposite effect.
2019-11-14 22:57:30 +01:00
Philip Rebohle
3457e312b0
[dxvk] Always align index buffer slices to 256 Bytes
...
To be on the safe side.
2019-11-14 14:32:01 +01:00
Philip Rebohle
420d95e396
[dxvk] Store shader capability information in separate set of flags
2019-11-12 18:05:03 +01:00
Philip Rebohle
1ca235d186
[util] Disable strict DC mode for MGSV again
...
Not necessary since the resubmitted contexts don't contain mapped buffers.
2019-11-12 00:59:33 +01:00
Philip Rebohle
4f7e7979e3
[util] Add app profile for Metal Gear Solid 5
2019-11-11 23:31:14 +01:00
Philip Rebohle
cc18730967
[dxvk] Enable option to disable OpenVR integration
2019-11-11 23:30:35 +01:00
Philip Rebohle
9f66351b82
[dxvk] Move extension provider list to DxvkInstance
2019-11-11 23:30:07 +01:00
Philip Rebohle
6948d18f5f
[dxvk] Always align vertex buffer slices to 256 bytes
...
Works around an unknown geometry rendering isssue in Warhammer Chaosbane.
Should probably be investigated at some point.
2019-11-10 22:37:11 +01:00
Philip Rebohle
31baf3529a
[d3d11] Fix uninitialized DSV flags
...
Fixes #1242 .
2019-11-10 15:02:21 +01:00
Philip Rebohle
4b199ef60d
[dxvk] Remove option to disable transfer queue
2019-11-08 11:29:22 +01:00
Philip Rebohle
a74449c367
[dxvk] Remove ability to query instance from adapter
...
Adapters don't hold a reference to the instance.
2019-11-08 11:28:08 +01:00
Philip Rebohle
77574d9970
[d3d11] Don't query DXVK instance from adapter
2019-11-08 11:25:58 +01:00
Philip Rebohle
b2317cad4d
[dxvk] Pass DXVK instance to DXVK device directly, not through the adapter
2019-11-08 11:17:02 +01:00
Philip Rebohle
212f5ba1f3
[dxgi] Query DXVK instance from DXGI factory, not the adapter
2019-11-08 11:06:15 +01:00
Philip Rebohle
ed8af3ccc4
[dxvk] Document wonky DxvkAdapter ref count behaviour
2019-11-07 21:08:20 +01:00
Philip Rebohle
a0dba6bbf9
[d3d11] Hold reference to DxvkInstance
...
Hack to keep the instance alive which owns the adapters. Should
fix #1240 for now, but we should fix this properly later on.
2019-11-07 20:21:27 +01:00
Philip Rebohle
b18c50d5ab
[dxvk] Use static variables for extension provider instances
...
Also, remove redundant interface documentation.
2019-11-07 01:35:10 +01:00
Joshua Ashton
dbf2407fd3
[dxvk] Implement extension provider system
...
This change introduces a new system for providing extra instance/device extensions.
This consolidates platform-specific and vr-related to its' own thing for potential future cross-platform/native Linux work.
2019-11-07 01:24:52 +01:00
Joshua Ashton
27898ebbfc
[build] Simplify and correct errors in options handling
...
Fix some typos...
D3D10 is dependent on D3D11 therefore DXGI is always dependent on D3D11
2019-11-07 01:24:52 +01:00
Joshua Ashton
4ad99feb73
[build] Demote no frontends/tests to a warning
2019-11-07 01:24:52 +01:00
Philip Rebohle
1d961b7dc3
[d3d11] 'a' is not a very good name for a variable
2019-11-04 13:46:18 +01:00
Philip Rebohle
77a0cb2b19
[d3d11] Don't synchronize with CS thread on present
...
Instead, submit from the CS thread in order to prevent out-of-order
submissions. Improves minimum FPS in Final Fantasy XIV by 5-10%.
2019-11-02 17:53:17 +01:00
Philip Rebohle
e6c3f0479d
[dxvk] Let device know that async presentation is enabled
2019-11-02 17:53:17 +01:00
Philip Rebohle
d96c22be05
[d3d11] Do not synchronize with CS thread in GetData
...
Instead, use a counter to determine whether there are any
pending operation for the query on the CS thread.
2019-11-02 17:53:17 +01:00
Philip Rebohle
0924bb469c
[d3d11] Move query state tracking to immediate context implementation
2019-11-02 17:53:17 +01:00
Philip Rebohle
be5dc234c1
[d3d11] Move common Begin/End implementation to immediate context
2019-11-02 13:48:03 +01:00
Philip Rebohle
63dbca82e7
[d3d11] Track used queries in deferred contexts and command lists
2019-11-02 13:48:03 +01:00
Philip Rebohle
0671007437
[d3d11] Only execute Begin for scoped queries
2019-11-02 13:48:03 +01:00
Philip Rebohle
1459f0e852
[util] Fix != and == operator for private/public COM pointers
2019-11-02 13:48:00 +01:00
Philip Rebohle
1780c549e5
[d3d11] Only add storage buffer usage flag to constant buffers if needed
...
Otherwise, the backend optimization for dynamic uniform buffers will not
kick in.
2019-10-30 10:58:05 +01:00
Philip Rebohle
e95bc3256f
[d3d11] Move handling of constantBufferRangeCheck option to D3D11Options
2019-10-30 10:57:36 +01:00
Philip Rebohle
9e084e63ca
[d3d11] Remove useless members from D3D11DeferredContextMapEntry
2019-10-30 00:44:17 +01:00
Philip Rebohle
9e69a610cb
[dxgi] Use 64-bit integers for refresh rate matching math
...
Otherwise, there may be integer overflows for certain parameter values.
2019-10-29 08:42:53 +01:00
Philip Rebohle
c4e5323e0e
[dxbc] Remove old constant buffer range check
2019-10-28 17:52:50 +01:00
Philip Rebohle
fd547b666e
[dxbc] Don't emit a spec constant for uniform buffers
2019-10-28 15:44:02 +01:00
Philip Rebohle
3d213efe53
[dxbc] Use SSBOs for dynamically indexed constant buffers if needed
...
SSBOs are tightly bound-checked on all Nvidia GPUs, so this allows for
a more accurate workaround for games relying on OOB access behaviour.
2019-10-28 15:42:46 +01:00
Philip Rebohle
68760f5b20
[dxbc] Parse dynamically indexed flag for constant buffers
2019-10-28 14:15:44 +01:00
Philip Rebohle
7db98a1aa4
[meta] Release 1.4.4
2019-10-27 17:56:31 +01:00
Alexandr
dacf1ab4d6
[util] Enable constant buffer range check for Saints Row games
...
Fixes character flickering on Nvidia.
2019-10-27 11:55:48 +01:00
Philip Rebohle
a2b629415e
Revert "[d3d11] Fix ref counting for D3D11CommandList"
...
This reverts commit 55bae45915
.
2019-10-27 11:10:49 +01:00
Philip Rebohle
fc0ede0657
Revert "[d3d11] Recycle command lists from deferred contexts"
...
This reverts commit 4e3da45fde
.
For some reason this caused crashes.
2019-10-27 11:00:59 +01:00
Philip Rebohle
8c34f4ff8a
[dxvk] Validate image layouts in render pass formats read from cache
...
This will discard invalid cache entries generated by DXVK 1.4.3.
2019-10-27 00:04:57 +02:00
Philip Rebohle
03dc59ef39
[dxvk] Write correct depth-stencil attachment layout to state cache
...
Fixes a dumb issue where we'd compress layouts with high enum values
to a single byte and incorrectly interpret the result as PREINITIALIZED.
2019-10-26 23:59:11 +02:00
Philip Rebohle
9361f19da6
[dxvk] Fix uninitialized depth attachment reference
...
Also don't redundantly null color attachment refs for cosmetic reasons.
2019-10-26 23:37:46 +02:00
Philip Rebohle
6888a98c89
[dxbc] Always set geometry shader invocation count
...
Fixes validation errors when the DXBC shader does not specify
the invocation count itself.
2019-10-26 23:19:59 +02:00
Philip Rebohle
144f4badef
[dxbc] Always allocate at least one input array element
...
Turns out that shaders with no inputs can still have an input signature,
in which case we were generating a zero-length array which is illegal.
2019-10-26 23:13:59 +02:00
Philip Rebohle
20f79a754b
[d3d11] Adjust buffer memory flags if apitrace is attached
...
Using cached memory speeds up apitrace significantly as it
reads back mapped memory regions.
2019-10-26 22:56:47 +02: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
0683f4f2c0
[d3d11] Remove D3D11 counter buffer class
2019-10-26 17:44:29 +02:00
Philip Rebohle
e967c52ff7
[d3d11] Allocate predicate buffer per query
...
Allows us to get rid of the D3D11 counter buffer class.
2019-10-26 17:44:29 +02:00
Philip Rebohle
09f507c284
[d3d11] Allocate xfb counter buffer per buffer
...
Same idea as with UAV counters, allows for more efficient updates.
2019-10-26 17:44:29 +02:00
Philip Rebohle
191c9644af
[d3d11] Allocate counter buffer per UAV
...
Might slightly increase memory overhead, however this allows
the backend to execute UAV counter updates more efficiently.
2019-10-26 17:44:29 +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
d1e9e1392d
[dxvk] Lazily allocate slices of small buffers
...
Reduces memory overhead in case games create small static
buffers. This is somewhat common for index buffers used
to render fullscreen quads or triangles.
2019-10-26 15:24:55 +02:00
Philip Rebohle
7751541662
[dxvk] Don't lock swap lock if not necessary
...
The swap lock only protects the 'next' free list, which
is not accessed at all when creating a new buffer.
2019-10-26 15:24:54 +02:00
Philip Rebohle
e868f829b5
[dxvk] Pad buffers more tightly
...
This will allow for smaller buffers to be laid out more efficiently.
2019-10-26 15:24:54 +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
4e3da45fde
[d3d11] Recycle command lists from deferred contexts
...
Can save a few memory allocations and deallocations at runtime.
2019-10-25 23:09:21 +02:00
Philip Rebohle
7f66373a69
[util] Add virtual destructor to NoWrapper
2019-10-25 22:08:00 +02:00
Philip Rebohle
55bae45915
[d3d11] Fix ref counting for D3D11CommandList
2019-10-25 21:37:18 +02:00
Philip Rebohle
41f04ffb61
[d3d11] Fix incorrect AddRef return value
2019-10-25 21:36:21 +02:00
Philip Rebohle
f9c2e43ffc
[d3d11] Don't set HOST pipeline stage and access flags for resources
...
The backend does not and will not use that information at all.
2019-10-24 16:57:06 +02:00
Philip Rebohle
2d6a3396dd
[dxbc] Declare length of shader input array late
...
Otherwise, we generate out-of-bounds array reads and writes
in broken ENB shaders.
2019-10-23 16:36:52 +02:00
Philip Rebohle
df61a479a2
[spirv] Add 'late' constants
...
Late constants can be used to reserve a placeholder ID for a constant
before the constant's value is known. The value can be changed later.
Only scalar 32-bit integer and floating point types are supported
as of right now.
2019-10-23 16:09:28 +02:00
Philip Rebohle
59d4556641
[dxbc] Extend scalar constants to vectors if required
...
Needed for ENB. Fixes #865 .
2019-10-23 15:26:22 +02:00
Philip Rebohle
ec8ca8a403
[dxbc] Assume vec4 type for i/o vars not declared in signature
...
Works around an ENB bug.
2019-10-23 15:26:22 +02:00
Philip Rebohle
3e12a116bb
[dxbc] Declare temp registers on demand
...
And ignore dcl_temps. Needed to successfully compile some broken
ENB shaders (this does work on Windows too). See #865 .
2019-10-23 13:55:04 +02:00
Philip Rebohle
ee77afb6af
[d3d11] Validate shader module capabilities
...
Only create a shader module if the device actually supports
the required features. Apparently this is needed for some
Unity Engine games.
2019-10-21 12:10:05 +02:00
Philip Rebohle
ddf010479d
[d3d11] Refactor shader module creation
2019-10-21 12:09:53 +02:00
Philip Rebohle
9444162ca6
[util] Enable constant buffer range check for Titan Quest
...
Reportedly flickers on Nvidia GPUs otherwise.
2019-10-20 13:27:12 +02:00
Philip Rebohle
7a0360d7c2
[dxgi] Remove useless d3d10.enable option
2019-10-19 00:34:51 +02:00
Philip Rebohle
ad3542f4fc
[meta] Release 1.4.3
2019-10-18 17:50:38 +02:00
Philip Rebohle
8211225ad4
[dxbc] Swap OpSelect arguments for Ne/Dne, don't use OpLogicalNot
...
Saves one instruction.
2019-10-18 03:22:20 +02:00
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
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