1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-14 09:23:53 +01:00
Commit Graph

353 Commits

Author SHA1 Message Date
Robin Kertels
7873bebaf2 [d3d9] Only check range overlap if the buffer is not directly mapped 2021-07-28 16:57:02 +00:00
Joshua Ashton
b8a4b85c48
[d3d9] Fix clearing render targets on device reset 2021-07-26 14:35:48 +02:00
Robin Kertels
b4e6f81cb5 [d3d9] Respect aligned pitch when using initial data 2021-07-24 19:41:59 +00:00
Robin Kertels
6ba3d2f9d4 [d3d9] Set correct usage flags for large temporary staging buffers 2021-07-23 13:36:21 +00:00
Robin Kertels
fa279eb8ad [d3d9] Ignore NO_DIRTY_UPDATE for POOL_DEFAULT resources
Respecting it breaks Senren Banka because we never upload the texture.
2021-07-23 13:36:21 +00:00
Robin Kertels
584e1515b1 [d3d9] Fix pitch when copying straight from mapping buffer 2021-07-23 13:36:21 +00:00
Robin Kertels
34101dcf26 [d3d9] Fix UpdateTexture extent
Same as 5f1629f2cb
2021-07-23 13:36:21 +00:00
Joshua Ashton
d3112c320b [d3d9] Add dirty texture tracking
Reduces overhead from re-binding and unnecessary binding (srgb changes) in L4D2.

I go from about 750 -> 850-900 fps in c1m2_streets with this change.
2021-07-14 20:38:49 +00:00
Robin Kertels
8eeff90e0a [d3d9] Only use staging buffers for uploads once we've stalled on the resource 2021-07-14 19:26:25 +00:00
Robin Kertels
b83261b759 [d3d9] Adjust waiting in LockBuffer to staging buffer upload
Now that we're uploading using a staging buffer,
we don't need to wait for non default buffers.

We should also respect READONLY for WRITEONLY buffers
(yes, it sounds dumb) because Nostale relies on that.
2021-07-14 19:26:25 +00:00
Robin Kertels
ed24c17d53 [d3d9] Validate srcRect and dstPoint in UpdateSurface 2021-07-14 18:33:38 +00:00
Georg Lehmann
b3b2f0921c [d3d9] Never init pSharedHandle.
This parameter has three different meanings if it's non NULL:
- if Pool is D3DPOOL_SYSTEMMEM it's a host pointer for inital data
- if it points to a nullptr it's a output handle
- if it's a pointer to non NULL pointer it's an import handle
2021-07-14 15:29:46 +00:00
Robin Kertels
5f1629f2cb [d3d9] Fix FlushImage extent for smaller mip maps 2021-07-10 16:23:56 +00:00
Robin Kertels
9f0775b1ac [d3d9] Always use cached memory for texture mapping buffers
We read from that memory when uploading the texture.
Fixes performance in Oblivion.
2021-07-08 21:42:12 +00:00
Joshua Ashton
c7f8267f98 [d3d9] Fix NV12 conversion
Froggy is the right color now
2021-07-08 22:36:59 -07:00
Connor Abbott
9579132942
[d3d9] Remove extra spaces in def file
wrc is pickier about this than windres and refuses to accept it.
2021-07-03 14:28:28 +02:00
Connor Abbott
aae0e57a46
Don't add def file as an object
This is unnecessary even on mingw, and leads to duplicating the .def
file on the linking command line which winegcc complains about.
2021-07-03 14:28:28 +02:00
Robin Kertels
309284e7dc [d3d9] Respect 4 byte pitch when reading back texture 2021-07-01 05:47:44 -07:00
Robin Kertels
c43618d19f [d3d9] Fix texture dirty box clearing
- Fix interleaved locks with evictManagedOnUnlock
We need to make sure there are no other subresources of a texture locked
before clearing the dirty box. Otherwise the data for those other subresources
won't get copied into VRAM.

- Clear dirty box regardless of texture pool
Otherwise we keep repacking and copying the whole texture
for every single lock. This causes performance problems
in Star Wars: The Old Republic.
2021-07-01 05:47:44 -07:00
Philip Rebohle
2ff8b42fff [d3d9] Enable robustBufferAccess2 feature if available
Tightens some out-of-bound rules around vertex attributes.
2021-06-29 18:35:47 -07:00
Philip Rebohle
96f5641a7e [d3d9] Ensure that the bound UP vertex buffer region is large enough
If the buffer size is less than (vertexCount * stride), the last vertex
may be considered out-of-bounds, even if all attributes are included in
the vertex.

Fixes #2131.
2021-06-29 18:35:47 -07:00
Philip Rebohle
cd8a2bcfcd [dxvk] Use custom sync primitives 2021-06-29 00:51:20 +02:00
Philip Rebohle
a14884c652
[dxvk] Add destination offset/extent to copyDepthStencilImageToPackedBuffer
Needed to support partial copies between buffers and depth-stencil images.
2021-06-24 21:07:47 +02:00
Philip Rebohle
ba4938e201
[dxvk] Add slice alignment to copyImageToBuffer 2021-06-24 21:07:47 +02:00
Philip Rebohle
4840cdaf8c
[dxvk] Add slice alignment to copyBufferToImage 2021-06-24 21:07:45 +02:00
Robin Kertels
8a93bbd8fa [d3d9] Make sure clear extent does not exceed rt size 2021-06-19 16:11:11 -07:00
Robin Kertels
d7c4afbeba [d3d9] Pass correct element size to texture converter 2021-06-19 10:43:31 -07:00
Philip Rebohle
4f5f85925b [d3d9] Add frame rate limiter and d3d9.maxFrameRate option 2021-06-12 13:50:08 +02:00
Robin Kertels
6f468ec5e0 [d3d9] Fix texture converter 2021-06-12 03:48:01 -07:00
Joshua Ashton
f1a9d72d38 [d3d9] Don't scale z to [0, 1] for POSITIONT
I originally thought the depth clipping region was always [0, 1] when I first implemented this nearly 2 years ago.

The depth clipping region is already in the viewport's depth range, so just don't do anything here if we are z-testing.

( We still need to keep the flattening around for when ztest is disabled though :( )

Fixes: #2056
2021-06-06 09:31:01 -07:00
Joshua Ashton
747834e9b0 [d3d9] Bump frame id before presentation 2021-06-01 18:31:29 +02:00
Joshua Ashton
fcb7639106 [d3d9] Synchronize frame latency on latency change 2021-06-01 18:16:35 +02:00
Joshua Ashton
787de33022 [d3d9] Sync frame latency after presentation 2021-06-01 18:16:35 +02:00
Philip Rebohle
0b88d0deab
[vulkan] Remove getSyncSemaphores from presenter
Instead, return the semaphores in acquireNextImage.
2021-06-01 04:32:50 +02:00
Philip Rebohle
253884a8c7
[vulkan] Remove fence from presenter
We don't use these anywhere.
2021-06-01 03:51:16 +02:00
Philip Rebohle
0af7229b8e
[util] Restore display modes of all monitors in RestoreMonitorDisplayMode
Fixes #2064.
2021-06-01 01:48:12 +02:00
Philip Rebohle
6462174c13
[dxvk] Support multi-plane formats in copyImageToBuffer 2021-05-30 19:42:43 +02:00
Philip Rebohle
86542248df
[dxvk] Support multi-plane formats in copyBufferToImage 2021-05-30 19:42:43 +02:00
Joshua Ashton
0520ce9448
[d3d9] Treat largest element in Stream 0 as vertex decl size
Closes #2059
2021-05-13 01:32:56 +01:00
Joshua Ashton
f0c1e89443 [d3d9] Handle zero-sized draws
These return S_OK, because ofc they do.
2021-05-05 19:25:46 +01:00
Joshua Ashton
0f52c85d21 [d3d9] Account for vertex declaration size for UP draws
The stride may not give us the full picture here as the stride
may not encompass the vertex declaration entirely.

Consider a vertex declaration of size 20, and a stride of 12,
we may not have covered the whole range of space the draw wants with
VertexCount * Stride.

Some games such as FF13 Lightning Returns have two float3s in the vertex decl
and draw two triangles with the last float being out of bounds. This causes
the whole vertex element to be set to 0 on NVIDIA which breaks their fullscreen passes.

Instead, take (VertexCount - 1) * Stride + VertexDeclSize for the buffer size
and pad with 0s outside of the VertexCount * Stride range.

Closes: #2046
Closes: #1908
2021-05-05 19:25:46 +01:00
Joshua Ashton
4a4b96611d
[d3d9] Only log WaitForVBlank stub once 2021-04-30 19:33:24 +01:00
Robin Kertels
525fd53bbc [d3d9] Fix FlushBuffer
Use stored mapped slice and use correct dst offset.
2021-04-23 18:06:29 +01:00
Robin Kertels
da23771df4 [d3d9] Remove unused variable 2021-04-23 18:06:29 +01:00
Robin Kertels
13f53531e5 [d3d9] Fix offset in UpdateSurface 2021-04-22 20:18:50 +01:00
Robin Kertels
0bc8b0b33a [d3d9] Align pitch to 4 2021-04-22 17:44:58 +01:00
Robin Kertels
2ba433bbd8 [d3d9+util] Remove option to disable implicit discard 2021-04-22 17:44:58 +01:00
Robin Kertels
03f5893011 [d3d9] Remove implicit discard 2021-04-22 17:44:58 +01:00
Robin Kertels
b9512a4063 [d3d9] Only copy dirty parts of managed/sysmem resources 2021-04-22 17:44:58 +01:00
Robin Kertels
4261ff6ec1 [d3d9] Use staging buffer for managed copies 2021-04-22 17:44:58 +01:00