Philip Rebohle
263865cf28
[d3d9] Enable custom border color features if available
2020-05-04 19:46:57 +02:00
Joshua Ashton
4699d4162a
[d3d9] Implement swapchain containers for surfaces
...
Fixes a crash in L.A. Noire.
Closes #1564
2020-04-13 01:42:30 +01:00
Joshua Ashton
6e5e50c359
[d3d9] Optimize hazard tracking in the SetTexture case
...
We don't need to perform DS/RT hazard tracking updates if the texture we replaced and ourselves do not have those usages.
2020-04-09 15:29:41 +01:00
Joshua Ashton
9b4cd8aa87
[d3d9] Remove texMask from UpdateActiveHazardsRT
...
This is an invalid optimization and leads to render hazards being dropped
Our hazard tracking for render targets is done in render target indices as opposed to texture indices for depth stencil tracking so `texMask` doesn't work for that reason, and the fact that even if it did, there is no relationship to an individual texture and a render target index that has a hazard.
2020-04-09 15:29:41 +01:00
Joshua Ashton
83e03ac9d8
[d3d9] Make COPM render state unlikely
...
This is only ever called once per game and we don't support it anyway
2020-04-05 06:27:14 +01:00
Joshua Ashton
92031a7bac
[d3d9] Fix dumb typo in ATOC handling
2020-04-03 21:13:15 +01:00
Joshua Ashton
457c0c3021
[d3d9] Fix state sometimes not being set in SetRenderState
...
Previously this prevented us disabling AlphaToCoverage once the application enabled it.
2020-04-03 07:52:35 +01:00
Joshua Ashton
bb2e88ee06
[d3d9] Fix crash when calling ColorFill with NULL format
...
Impacts #1528
2020-03-25 07:23:17 +00:00
Joshua Ashton
a9339ae832
[d3d9] Fix depth hazard case for write + read
...
Closes #1519
2020-03-20 14:23:29 +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
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
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
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
a432befa8d
[d3d9] Add RT suffix to current hazard tracking
...
We can have DS hazards...
2020-03-09 00:23:22 +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
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
c07f8c941c
[d3d9] Delegate VCACHE check to QuerySupported
...
Fixes a failing Wine test
2020-02-28 00:59:44 +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
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
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
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
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
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
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
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
4291bc9dfb
[d3d9] Reupload fixed func ps data if stage constant changes
...
Closes #1420
2020-02-08 16:33:47 +00: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
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
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