1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00
Commit Graph

6126 Commits

Author SHA1 Message Date
Philip Rebohle
58dab7e8c6 [dxvk] Refactor mip generation 2024-09-30 10:29:27 +02:00
Philip Rebohle
8c67af680c [dxvk] Refactor meta resolves 2024-09-30 10:29:27 +02:00
Philip Rebohle
2c176f4950 [dxvk] Refactor meta image copies 2024-09-30 10:29:27 +02:00
Philip Rebohle
ae90e74a5a [dxvk] Introduce concept of transfer-only views 2024-09-30 10:29:27 +02:00
Philip Rebohle
fd439c3e54 [dxvk] Ensure image compatibility for packed depth-stencil copies 2024-09-30 10:29:27 +02:00
Philip Rebohle
56a07b5bd0 [dxvk] Add function to recreate image views with guaranteed compatibility 2024-09-30 10:29:27 +02:00
Philip Rebohle
bfbb7987b2 [dxvk] Add functions to recreate images with additional usage info
Useful when we don't know in advance which usage flags are required
and don't want to set them preemptively for performance reasons.
2024-09-30 10:29:27 +02:00
Philip Rebohle
53f14e2914 [dxvk] Add functions to move resources to a different allocation
Basically a batched copy to use when one or more resources are being
recreated for any reason.
2024-09-30 10:29:27 +02:00
Philip Rebohle
ae3a9f595e [dxvk] Allow larger chunks on small heaps
Effectively doubles the size of HVV chunks to 32 MiB on systems that
do not have ReBAR enabled. 16 MiB is too small for some use cases.
2024-09-29 22:07:30 +02:00
Philip Rebohle
e6f89062f5 [d3d9] Ensure that we stay below the maximum sampler count 2024-09-28 20:21:06 +02:00
Philip Rebohle
07dfeeb319 [d3d9] Move building sampler key to CS thread
All this bit twiddling is a bit slow. Introduces another structure
containing a minimal amount of sampler parameters taken from the
raw D3D9 state.
2024-09-28 20:21:06 +02:00
Philip Rebohle
543b5c7af8 [d3d9] Optimize sampler state decoding
This code is rather hot now, so make sure it's fast.
2024-09-28 20:21:06 +02:00
Philip Rebohle
c7dab6a442 [d3d9] Remove internal sampler pool
We have a sampler pool in the backend now, let's use it.
2024-09-28 20:21:06 +02:00
Philip Rebohle
707ddd63a1 [dxvk] Add stat counter for samplers 2024-09-28 20:21:06 +02:00
Philip Rebohle
4635397bb1 [dxvk] Implement sampler pool
Deduplicates redundant sampler objects and makes sampler creation
as well as lifetime tracking a bit more efficient.
2024-09-28 20:21:06 +02:00
Philip Rebohle
5f9f43e658 [util] Add helpers to encode or decode fixed-point numbers 2024-09-28 20:21:06 +02:00
Philip Rebohle
b4e69dce76 [dxvk] Remove DxvkImageViewCreateInfo 2024-09-28 01:50:23 +02:00
Philip Rebohle
8195bea63e [dxvk] Remove DxvkBufferViewCreateInfo
Use the new key struct directly to avoid unnecessary struct conversion.
2024-09-28 01:21:07 +02:00
Philip Rebohle
b0d0959329 [dxvk] Remove DxvkDataBuffer
Unused.
2024-09-28 01:06:57 +02:00
Philip Rebohle
1cefe90ce7 [d3d11] Don't use data buffer for small buffer updates
Embed an array instead and lower the size threshold.
2024-09-28 01:05:40 +02:00
Philip Rebohle
01a7457a6f [dxvk] Remove createImageView function
Use the image's method instead, like we already do for buffers.
2024-09-28 00:03:56 +02:00
Paul Gofman
a172cab34f [dxgi] Delay qualifying foreground loss as occlusion 2024-09-27 18:15:24 +02:00
Philip Rebohle
4ed50ec6be [d3d9] Fix UP buffer allocation 2024-09-27 12:55:59 +02:00
Philip Rebohle
78f5136fde [dxvk] Fix image view swizzling 2024-09-26 17:42:02 +02:00
Philip Rebohle
5e5c283149 [d3d11] Always use fast MAP_WRITE_DISCARD path on deferred contexts
... but keep the SingleUse option as-is anyway because games do not release
their command lists after submission and end up wasting massive amounts of
memory.
2024-09-26 17:37:50 +02:00
Philip Rebohle
39f50999a3 [d3d11] Cache raw mapped pointer rather than allocation object
Reduces ref counting overhead again and matches previous behaviour.

We should probably do something about the possible case of deferred context
execution with MAP_WRITE_DISCARD followed by MAP_WRITE_NO_OVERWRITE on the
immediate context, but we haven't seen a game rely on this yet.
2024-09-26 17:37:50 +02:00
Philip Rebohle
50878f2846 [dxvk] Add function to invalidate images 2024-09-26 17:37:50 +02:00
Philip Rebohle
347925c8b7 [dxvk] Remove legacy DxvkMemory class 2024-09-26 17:37:50 +02:00
Philip Rebohle
25076d9220 [dxvk] Rework image view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
713b76bea5 [dxvk] Rework image creation
Uses DxvkResourceAllocation to manage image backing storage,
which will allow invalidating images in the future.
2024-09-26 17:37:50 +02:00
Philip Rebohle
d7e1794e29 [dxvk] Add function to import existing Vulkan image 2024-09-26 17:37:50 +02:00
Philip Rebohle
eec4f0fb35 [dxvk] Implement sparse image creation in allocator 2024-09-26 17:37:50 +02:00
Philip Rebohle
bcd12a5b56 [dxvk] Refactor sparse page table initialization for images 2024-09-26 17:37:50 +02:00
Philip Rebohle
0f23a17d8f [dxvk] Refactor sparse page allocation
Uses the new allocator directly.
2024-09-26 17:37:50 +02:00
Philip Rebohle
af4a2f7973 [dxvk] Introduce DxvkResourceMemoryInfo
And replace the old sparse thing.
2024-09-26 17:37:50 +02:00
Philip Rebohle
bbd2461c8f [dxvk] Reimplement sparse buffer support 2024-09-26 17:37:50 +02:00
Philip Rebohle
1ba6b81901 [dxvk] Reimplement imported buffers 2024-09-26 17:37:50 +02:00
Philip Rebohle
5263307c4a [dxvk] Improve lifetime tracking logic
Reduces ref counting overhead on the CS thread a bit.
2024-09-26 17:37:50 +02:00
Philip Rebohle
7ac9918b39 [hud] Add cache statistics to detailed memory item 2024-09-26 17:37:50 +02:00
Philip Rebohle
9cf72b5b19 [dxvk] Implement basic pool balancing for shared allocation cache
This makes the entire cache available to all allocation sizes rather than
having fixed-size pools for every allocation size. Improves hit rate in
games that primarily use one constant buffer size.
2024-09-26 17:37:50 +02:00
Philip Rebohle
428b1087a0 [dxvk] Implement shared cache statistics 2024-09-26 17:37:50 +02:00
Philip Rebohle
2722a41675 [dxvk] Implement shared allocation cache
Allows refilling local caches in constant time.
2024-09-26 17:37:50 +02:00
Philip Rebohle
9a51849920 [d3d11] Use allocation cache for dynamic buffers 2024-09-26 17:37:50 +02:00
Philip Rebohle
4db0007af3 [dxvk] Implement local allocation cache 2024-09-26 17:37:50 +02:00
Philip Rebohle
93547aec8d [dxvk] Do not track buffer view objects
No longer necessary as they have the same lifetime as the
parent buffer now. Only track the buffers themselves.
2024-09-26 17:37:50 +02:00
Philip Rebohle
088ba404a6 [dxvk] Rework buffer view creation 2024-09-26 17:37:50 +02:00
Philip Rebohle
1fd3c8040d [dxvk] Remove DxvkBufferAllocation 2024-09-26 17:37:50 +02:00
Philip Rebohle
14990dbb49 [dxvk] Rework buffer slice allocation
Temporary solution that hits the allocator on every single invalidation,
which isn't great but will do for now.
2024-09-26 17:37:50 +02:00
Philip Rebohle
ec2f43e5e3 [dxvk] Make DxvkResource manage its own destruction
Necessary for actual resource refactors. We want view objects
to use the resource's reference count wehenever possible.
2024-09-26 17:37:50 +02:00
Philip Rebohle
10164fdf4d [dxvk] Store GPU address for allocated chunk memory 2024-09-26 17:37:50 +02:00