Commit Graph

3485 Commits

Author SHA1 Message Date
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
Jens Peters f85be773aa [meta] Remove D3D10 HUD restriction in the README
D3D10 in the HUD api option is identified correctly since be16da37d7
2020-03-07 22:58:30 +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 419083f126 [tests] Add a test for L6V5U5 format 2020-03-02 04:03:27 +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
Philip Rebohle d424fb87aa
[tests] Enable d3dcompiler option for unbounded descriptor tables
Makes compiling SM5.1 shaders for D3D12 a bit less painful.
2020-02-21 10:29:10 +01: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