Derek Lesho
6640cc350c
[d3d9] Add support for shared IDirect3DTexture9 resources.
2022-03-12 16:23:06 +01:00
Robin Kertels
b42c07253e
[d3d9] Fix sysmem readback
2022-02-24 07:49:55 +00:00
Robin Kertels
29d8812709
[d3d9] Don't set NeedsReadback for POOL_SYSMEM textures
...
... or in SetRenderTarget because we always do readback for render targets.
2022-02-21 13:43:04 +00:00
Robin Kertels
dde83717f1
[d3d9] Rename WrittenByGPU to NeedsReadback
2022-02-21 00:08:41 +00:00
Robin Kertels
917a8d00a2
[d3d9] Track last staging resource usage with a sequence number
2022-02-20 03:29:31 +00:00
Robin Kertels
b220c8989b
[d3d9] Only enable FETCH4 for single channel formats
2022-01-28 21:34:18 +00:00
Robin Kertels
4cdee69bc9
[d3d9] Always upload all managed texture mips after AddDirtyBox call
...
Co-authored-by: Paul Gofman <gofmanp@gmail.com>
2022-01-10 18:55:08 +00:00
Joshua Ashton
4a569918c0
[d3d9] Track NULL state per-subresource
2021-08-08 02:14:11 +00:00
Joshua Ashton
d922e261e8
[d3d9] Make D3D9_COMMON_TEXTURE_DESC smaller
2021-08-08 02:14:11 +00:00
Joshua Ashton
3cbac8923f
[d3d9] Return const refs for image/buffers + format mapping in CommonTexture
...
Avoids needless Rc ref counts and copies of that fairly large structure.
2021-08-08 02:14:11 +00:00
Robin Kertels
b4e6f81cb5
[d3d9] Respect aligned pitch when using initial data
2021-07-24 19:41:59 +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
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
Robin Kertels
8159e87331
[d3d9] Fix some issues with dirty box handling
...
- The dst texture in UpdateSurface must be in D3DPOOL_DEFAULT
which doesn't do dirty tracking. So we don't need to
call AddDirtyBox there.
- Clear DirtyBox when we flush managed textures with EvictManagedOnUnlock.
- Do nothing in AddDirtyBox for D3DPOOL_DEFAULT textures
2021-03-22 17:43:07 +00:00
Robin Kertels
4f45e74d96
[d3d9] Improve naming of texture dirty flag and dirty boxes
2021-03-22 17:43:07 +00:00
Philip Rebohle
dcf4599c98
[d3d9] Use ATTACHMENT_OPTIMAL layout for render targets
...
Significantly improves GPU-bound performance on RADV in a number of games.
2021-02-26 05:02:32 +00:00
Robin Kertels
338f6dfb0e
[d3d9] Track dirty regions for UpdateTexture
2021-02-14 23:55:00 +00:00
Philip Rebohle
4f184b3424
[d3d9] Mark images as shared if necessary
2021-02-14 04:00:02 +01:00
Joshua Ashton
9fe1b9d03f
[d3d9] Replace macropixel size with plane count
2020-08-07 10:56:26 +01:00
Robin Kertels
5d5ec2aa77
[d3d9] Remove IsUploading from CommonTexture
...
This was always true on subsequent Lock calls.
The first lock was handled by the 'freshly allocated fast path' anyway.
2020-06-11 05:53:33 +01:00
Joshua Ashton
b1bd3597a4
[d3d9] Implement PreLoad for buffers + textures
2020-06-11 05:53:33 +01:00
Joshua Ashton
86e8315416
[d3d9] Revert Nekopara hacks
2020-06-05 23:15:10 +01:00
Joshua Ashton
fa988be4aa
[d3d9] Improve MarkAllForUpload implementation
...
Only mark the bits we are actually using.
2020-06-05 02:40:41 +01:00
Joshua Ashton
d39cf31189
[d3d9] Implement uploadAllManagedSubresources option
...
Nekopara locks mip 1, then unlocks mip 0 and expects it to upload all the mips.
2020-06-05 02:34:44 +01:00
Joshua Ashton
5558460853
[d3d9] Don't mark lock on DONOTWAIT path
...
Fixes some issues in some games using this feature.
2020-06-01 15:52:25 +01:00
Joshua Ashton
3825d16a31
[d3d9] Move mip filter into common texture
2020-05-27 10:12:43 +02:00
Joshua Ashton
e57aea5749
[d3d9] Track and defer mipmap generations
...
Turns out we need to track this crap and generate at draw time and handle a bunch of other wacky cases for it...
Bah.
Fixes #1642
(The funky water.)
2020-05-26 18:42:53 +01:00
Joshua Ashton
4c1deabcd3
[d3d9] Don't expose surfaces for autogenned mips
2020-05-26 13:11:24 +01:00
Joshua Ashton
a9339ae832
[d3d9] Fix depth hazard case for write + read
...
Closes #1519
2020-03-20 14:23:29 +01:00
Philip Rebohle
1150121606
[d3d9] Fix depth-stencil layouts
...
Otherwise we're always using GENERAL for depth buffers.
2020-03-20 04:04:53 +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
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
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
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
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
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