Philip Rebohle
a9b6421f60
[d3d11] Support signaling event in Flush1
2020-03-19 23:38:28 +01:00
Philip Rebohle
76fd9013d4
[util] Add missing include
2020-03-19 23:22:13 +01:00
Philip Rebohle
3697583f71
[d3d10] Separate d3d10core from d3d10
...
This way we skip compiling and linking unnecessary garbage
into the core library.
2020-03-18 22:01:11 +01:00
Joshua Ashton
7a134e49be
[d3d10] Implement D3D10[Core]GetVersion and D3D10[Core]RegisterLayers
2020-03-18 20:49:17 +01:00
Joshua Ashton
021c593ad8
[d3d9] Use all heaps when determining initial texture memory
...
Matches behaviour on Windows 10
Merges #1436
2020-03-18 19:40:01 +00:00
Florian Will
ba41a5219a
[util] Disable explicit frontbuffer for ZUSI 3
...
Fixes flickering when parts of the screen are not redrawn in a frame.
Closes #1368
Merges #1437
2020-03-18 19:32:45 +00:00
Florian Will
1a4b15a82d
[d3d9] Add option to disable the explicit frontbuffer
...
The Vulkan swapchain is unaffected by this, but we don't create an
"internal" frontbuffer in D3D9SwapChainEx if this option is set. This
breaks GetFrontBufferData (which returns backbuffer data if the option
is enabled), but it disables front/backbuffer flipping.
Most windows drivers apparently always use the same backbuffer for all
frames in windowed mode. At least one game (ZUSI 3) seems to rely on
this behavior, and only redraws dirty regions for each frame instead of
redrawing everything. With buffer flips, this leads to flickering. When
enabling this new noExplicitFrontBuffer option, the flickering
disappears.
2020-03-18 19:31:00 +00:00
Joshua Ashton
6a8933cf31
[d3d9] Allow arbitrary backbuffer/adapter formats
...
It seems these aren't linked in the way the docs made out, this fixes a crash when starting some titles.
Closes #1508
2020-03-18 06:00:28 +00:00
Joshua Ashton
a9040c5cce
[d3d9] Allow multisampled depth stencil resolves in StretchRect
...
Fixes a crash in some Source 2 titles
2020-03-18 04:59:27 +00:00
Philip Rebohle
bf480ce659
[d3d11] Initialize all D3D11ContextState members
...
Otherwise, SwapDeviceContextState may swap in some uninitialized data.
Closes #1512 .
Reported-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2020-03-16 18:42:57 +01:00
Philip Rebohle
26798eb312
[util] Use SwitchToThread for yield
...
According to MSDN, this doesn't interfere with scheduling of other threads,
unlike Sleep(0).
2020-03-15 03:43:04 +01:00
Philip Rebohle
ba213c1fa0
[dxvk] Factor out waiting for resource to become idle
...
And use the new generic spin function to reduce syscall spam.
2020-03-15 03:43:04 +01:00
Philip Rebohle
da506f5932
[util] Add generic recursive spinlock
2020-03-15 03:43:04 +01:00
Philip Rebohle
55e3240479
[util] Add generic spin function
2020-03-15 03:43:04 +01:00
Philip Rebohle
33b0d4c991
[d3d10] Create type reflection objects on demand
...
See previous commits for details. Fixes #1507 .
2020-03-12 21:03:31 +01:00
Philip Rebohle
3d81b3eb82
[d3d10] Create variable reflection objects on demand
2020-03-12 21:03:30 +01:00
Philip Rebohle
21fe6a3405
[d3d10] Create constant buffer reflection objects on demand
...
The reported constant buffer count does not necessarily match the
number of constant buffers that can be retrieved from reflection.
2020-03-12 21:03:30 +01:00
Rémi Bernon
14946c599f
[d3d9] Hook WM_NCCALCSIZE to get rid of fullscreen non-client areas.
2020-03-11 17:46:08 +00:00
Joshua Ashton
64e649ae18
[d3d9] Don't check IsNull for depth stencil views
...
We don't need to do this. Depth stencils can never be D3DFMT_NULL.
2020-03-09 01:13:54 +00:00
Joshua Ashton
e33627cfdc
[d3d9] Optimize unnecessary loops in hazard tracking
...
We only want to update specific indices of bitfields at a time, so pass through that information and mask it off.
2020-03-09 01:03:18 +00:00
Joshua Ashton
812a113a85
[d3d9] Avoid multiple tzcnts per loop in hazard tracking
2020-03-09 00:53:50 +00:00
Joshua Ashton
f6b26b302d
[d3d9] Handle depth stencil hazards
...
Track depth stencil textures being used and whether we have any active hazards.
Rebind the framebuffer with VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL if we encounter a depth stencil hazard.
Fixes black squares in Mass Effect and validation errors in some titles.
Closes #1484
2020-03-09 00:53:19 +00:00
Joshua Ashton
102d97db02
[d3d9] Add IsDepthStencil helper to D3D9CommonTexture
2020-03-09 00:24:56 +00:00
Joshua Ashton
a432befa8d
[d3d9] Add RT suffix to current hazard tracking
...
We can have DS hazards...
2020-03-09 00:23:22 +00:00
Joshua Ashton
eaa599bf9a
[d3d9] Implement A2W10V10U10 format via conversion
2020-03-08 23:32:33 +00:00
Joshua Ashton
60ec7e8208
[d3d9] Implement X8L8V8U8 format via conversion
2020-03-08 23:22:52 +00:00
Joshua Ashton
afd4e6e457
[d3d9] Use a common header for cs conversion helpers
2020-03-08 22:29:41 +00:00
Philip Rebohle
304dad2d2e
[dxvk] Fix dumb typo in changeImageLayout
2020-03-08 03:18:34 +01:00
Philip Rebohle
7b760800b4
[d3d11] Fix buffer view compatibility check
2020-03-08 01:28:51 +01:00
Philip Rebohle
2291484696
[d3d11] Fix texture view compatibility check
2020-03-08 01:28:51 +01:00
Joshua Ashton
45c8b09104
[d3d9] Don't update present region in Reset
...
Fixes a regression in A Hat in Time when changing resolutions
2020-03-06 18:23:08 +00:00
Philip Rebohle
245007daba
[d3d9] Don't use m_monitor in GetDisplayModeEx
...
Should fix #1495 .
2020-03-05 15:25:05 +00:00
Philip Rebohle
3a1243b05e
[util] Don't set display mode if the desired mode is already set
...
See #1489 .
Co-authored-by: zvova7890 <zvova7890@gmail.com>
2020-03-04 23:06:15 +00:00
Philip Rebohle
5e41e00456
[d3d9] Use new common monitor functions
2020-03-04 23:06:15 +00:00
Philip Rebohle
a623e8e7d6
[dxgi] Use new common monitor functions
2020-03-04 23:06:15 +00:00
Philip Rebohle
4e16d65bb8
[util] Introduce common functions to set, get and restore display modes
2020-03-04 23:06:15 +00:00
Philip Rebohle
66503aeaa0
[util] Factor out common monitor-related functions
2020-03-04 23:06:15 +00:00
Joshua Ashton
8c68cf1551
[d3d9] Fix alignment of SubresourceData
...
This should match SubresourceType...
2020-03-02 16:11:07 +00:00
Joshua Ashton
27d7af65a1
[d3d9] Consolidate format helper code
2020-03-02 04:37:20 +00:00
Joshua Ashton
1b26fabc6e
[d3d9] Use uniform texel buffers for conversion
2020-03-02 04:37:20 +00:00
Joshua Ashton
077f48b4ef
[d3d9] Flush format converter in device after init
...
Otherwise we can be overwritten if its a new resource we just created by the initializer.
2020-03-02 04:37:20 +00:00
Joshua Ashton
58316ebe4c
[d3d9] Add missing breaks to format helper switch
2020-03-02 04:37:20 +00:00
Joshua Ashton
7743276e1d
[d3d9] Implement L6V5U5 format via conversion
2020-03-02 04:37:20 +00:00
Joshua Ashton
b67f4974be
[d3d9] Fix view formats for conversion formats
2020-03-02 04:03:27 +00:00
Philip Rebohle
1e426cdb08
[meta] Release 1.5.5
2020-02-29 15:45:57 +01:00
Joshua Ashton
36d3e8e83d
[d3d9] Don't InitReturnPtr in CreateQuery
...
Matches native behaviour
Fixes a Wine test
2020-02-28 21:51:34 +00:00
Joshua Ashton
5548493fad
[d3d9] Don't update device state for offset/stride if the buffer is nullptr
...
May also avoid some redundant rebinds here too...
Fixes a Wine test
2020-02-28 21:40:19 +00:00
Joshua Ashton
722520a9f7
[d3d9] Don't rebind user's vertex buffer/indices in DrawPrimitive[Indexed]UP
...
D3D9 doesn't do this, it instead sets them to NULL so we can simplify this logic a fair bit.
Found via a Wine test.
2020-02-28 21:37:00 +00:00
Joshua Ashton
3587bcdb9f
[d3d9] Disallow creating additional swapchains if we are fullscreen
...
From Wine tests...
2020-02-28 01:43:07 +00:00
Joshua Ashton
632812b88f
[d3d9] Disallow additional fullscreen swapchains
...
From Wine tests...
2020-02-28 01:39:52 +00:00
Joshua Ashton
0757097fa0
[d3d9] Initialize return ptr in device's GetBackBuffer
...
The swapchain's function does not do this, but this one does.
2020-02-28 01:37:23 +00:00
Joshua Ashton
528cacca5f
[d3d9] Only have a single implicit swapchain
...
I am naive to think that this API is in any way sane, and that iSwapChains actually does what you would expect.
Swapchains created by CreateAdditionalSwapchain[Ex] are not tracked in that figure... There can only ever be one.
Great API. Very cool.
This also adds and consolidates some missing thread synchronization on the swapchain functions (that should have already had it).
(note: m_implicitSwapchain always exists, so we don't need to lock if that's all we call.)
2020-02-28 01:29:38 +00:00
Joshua Ashton
e41640dcde
[d3d9] Make nullptr/oob checks in GetBackBuffer unlikely
2020-02-28 01:03:34 +00:00
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