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

5963 Commits

Author SHA1 Message Date
WinterSnowfall
7ffe77f7c4 [d3d9] Validate pBox dimensions with LockBox 2024-10-27 12:36:33 +01:00
WinterSnowfall
a0d48cd2a2 [d3d9] Adjust pLockedRect/pLockedBox clearing and return behavior 2024-10-27 12:36:33 +01:00
WinterSnowfall
63d9affdcb [d3d9] Add volume texture creation and locking validations 2024-10-27 12:36:33 +01:00
WinterSnowfall
a323abe085 [d3d9] Validate alignment for block aligned formats 2024-10-27 12:36:33 +01:00
WinterSnowfall
678ccc721d [d3d9] Validate pRect dimensions with LockRect 2024-10-27 12:36:33 +01:00
Philip Rebohle
80fbaed291 Revert "[d3d11] Use existing MD5 hash to look up shader objects"
This reverts commit 800f71c4f5.

We can't do this without breaking fossilize DBs because we compile the
SHA1 hash into the shader binary.
2024-10-27 12:53:11 +01:00
Philip Rebohle
4709d429ed [dxbc] Fix EvalSnapped offset interpretation 2024-10-27 12:52:15 +01:00
Philip Rebohle
640758afcf [util] Enable mapped memory clearing for Vindictus 2024-10-27 02:43:58 +02:00
Philip Rebohle
ed83534970 [dxvk] Add option to clear mapped memory regions to zero 2024-10-27 02:43:58 +02:00
Philip Rebohle
e9574a4155 [dxvk] Add utility function to clear large regions of memory 2024-10-27 02:43:58 +02:00
Philip Rebohle
d535e2964f [dxvk] Remove obsolete comments 2024-10-25 19:22:58 +02:00
Philip Rebohle
3268bda4a2 [dxvk] Fix potential issues in invalidateImageWithUsage
Relevant for image recreation in D3D9, not so much for defrag
since we do everything late in the command list anyway.
2024-10-25 19:22:58 +02:00
Philip Rebohle
1a4ac219ed [dxvk] Properly flush everything before recording defrag commands 2024-10-25 19:22:58 +02:00
Philip Rebohle
7df58de815 [dxvk] Do not emit useless image barriers in relocateResources
Instead, fold barriers with no layout transition into a simple memory
barrier to bring this in line with the usual barrier logic.
2024-10-25 19:22:58 +02:00
Philip Rebohle
763780fb4c [dxvk] Remove obsolete fence code from command submissions
Unused since the timeline semaphore rework.
2024-10-25 11:31:01 +02:00
Philip Rebohle
662cfd49f5 [dxvk] Fix nonsensical pipeline stages when relocating resources 2024-10-24 15:19:43 +02:00
Philip Rebohle
640379e54b [dxvk] Remove obsolete DxvkDeviceOptions structure
This hasn't been used since 2.0.
2024-10-24 12:31:18 +02:00
Philip Rebohle
ec62551412 [dxvk] Add option to disable memory defragmentation 2024-10-24 12:31:18 +02:00
Philip Rebohle
9977313c32 [dxvk] Do not defragment chunks with immovable resources 2024-10-24 12:31:18 +02:00
Philip Rebohle
62f266098e [dxvk] Consider driver allocations when computing memory budget 2024-10-24 12:31:18 +02:00
Philip Rebohle
de400ae8a9 [dxvk] Increase memory task tick rate to 0.5s
Makes cleanup a bit quicker in some cases.
2024-10-24 12:31:18 +02:00
Philip Rebohle
7a09ab6c83 [dxvk] Limit amount of memory to relocate per submission
If the resources we're moving around are in slow memory, moving a full
chunk at once can already take several milliseconds. Try to avoid that.
2024-10-24 12:31:18 +02:00
Philip Rebohle
787671ef62 [dxvk] Limit number of allocations to move per submissions 2024-10-24 12:31:18 +02:00
Philip Rebohle
899f48bc43 [dxvk] Periodically defragment VRAM chunks 2024-10-24 12:31:18 +02:00
Philip Rebohle
c4cddebb89 [hud] Visualize inactive chunks 2024-10-24 12:31:18 +02:00
Philip Rebohle
2c8fe59924 [dxvk] Sort chunks by allocation time for statistics 2024-10-24 12:31:18 +02:00
Philip Rebohle
69437c2fea [dxvk] Include chunk status in statistics 2024-10-24 12:31:18 +02:00
Philip Rebohle
7a693ed41a [dxvk] Implement per-submission resource relocation 2024-10-24 12:31:18 +02:00
Philip Rebohle
9cbd45b8cf [dxvk] Add helper class for resource relocation 2024-10-24 12:31:18 +02:00
Philip Rebohle
0723250c12 [dxvk] Introduce flag to synchronize transfer queue
Also, get rid of superfluous binary semaphores since we have
a straight per-submission timeline anyway.
2024-10-24 12:31:18 +02:00
Philip Rebohle
13da763f9b [dxvk] Use small_vector in submission code 2024-10-24 12:31:18 +02:00
Philip Rebohle
800792a67d [dxvk] Add function to safely acquire a resource 2024-10-24 12:31:18 +02:00
Philip Rebohle
c7a9c626f5 [dxvk] Handle dead chunks in pool allocator 2024-10-24 12:31:18 +02:00
Philip Rebohle
a9bcb40655 [dxvk] Add concept of disabled chunks to allocator 2024-10-24 12:31:18 +02:00
Philip Rebohle
bfcfcab60f [dxvk] Add method to allocate backing storage with constraints 2024-10-24 12:31:18 +02:00
Philip Rebohle
a3c8c88222 [dxvk] Fix race condition in relocation check
The storage pointer is not safe to dereference outside the CS thread
for relocatable resources since the storage object may change.
2024-10-24 12:31:18 +02:00
Philip Rebohle
3a1de271cb [dxvk] Introduce allocation modes
Will be useful when relocating resources for defragmentation purposes.
2024-10-24 12:31:18 +02:00
Philip Rebohle
9a8406f28a [dxvk] Add global resource map to memory allocator 2024-10-24 12:31:18 +02:00
Philip Rebohle
8e94a8bcc6 [dxvk] Add per-chunk allocation list 2024-10-24 12:31:18 +02:00
Philip Rebohle
4e40d0b939 [dxvk] Add allocation flag for moveable resources 2024-10-24 12:31:18 +02:00
Philip Rebohle
bb05f123db [dxvk] Pass resource cookie to allocation objects 2024-10-24 12:31:18 +02:00
Philip Rebohle
efebceecbe [dxvk] Introduce DxvkAllocationInfo
Useful when more properties are added in the future.
2024-10-24 12:31:18 +02:00
Philip Rebohle
7ccfb57d57 [dxvk] Reintroduce resource cookies 2024-10-24 12:31:18 +02:00
Philip Rebohle
809257051b [dxvk] Rename unspecific "next" member in DxvkResourceAllocation 2024-10-24 12:31:18 +02:00
Philip Rebohle
3befea6516 [dxvk] Actually count barriers from resource relocation 2024-10-24 12:31:18 +02:00
Philip Rebohle
90f32d76ff [dxvk] Ignore uninitialized image subresources during relocation 2024-10-24 12:31:18 +02:00
Philip Rebohle
77a1164d1b [dxvk] Track initialization of internally managed images
Otherwise, these will not be relocated properly during defragmentation.
2024-10-24 12:31:18 +02:00
Philip Rebohle
1c157d1a63 [util] Properly return reference from small_vector emplace_back 2024-10-24 12:31:18 +02:00
Philip Rebohle
4af31a9d64 [dxvk] Remove context type concept
We only have a single context per device now.
2024-10-24 12:30:54 +02:00
Philip Rebohle
b4ed108105 [d3d9] Remove format conversion context 2024-10-24 12:30:54 +02:00
Philip Rebohle
f9a99e81f4 [dxvk] Bump state cache format to v18
All D3D11 shader keys change, so we should invalidte existing caches.
2024-10-23 16:56:32 +02:00
Philip Rebohle
f3fa2535e8 [d3d11] Validate shader creation parameters 2024-10-23 16:56:32 +02:00
Philip Rebohle
800f71c4f5 [d3d11] Use existing MD5 hash to look up shader objects
Skips the expensive SHA-1 pass.
2024-10-23 16:56:32 +02:00
Philip Rebohle
ae9024492b [d3d11] Devirtualize context method forwarding 2024-10-23 16:56:22 +02:00
Philip Rebohle
d10df6353b [d3d11] Devirtualize resource and view creation method forwarding 2024-10-23 16:56:22 +02:00
Philip Rebohle
565af8c311 [dxvk] Add important assert to object tracker 2024-10-23 11:30:37 +02:00
Blisto91
24e0440043 [util] Remove The Old Republic config
Looks fine without since dxvk 2.0
2024-10-23 11:19:01 +02:00
Philip Rebohle
01300bb884 [dxvk] Improve some descriptor setup code
Help the compiler out since it cannot fully prove that two consecutive
calls to DxvkImageView::handle with the same argument return the same result.
2024-10-23 10:26:24 +02:00
Philip Rebohle
cd4d68244d [dxvk] Use real shader access types for writeable descriptor types
Mostly relevant for storage buffers since those are often read-only.
2024-10-23 10:08:03 +02:00
Blisto91
f813549ced [util] Set forceSamplerTypeSpecConstants for Alpha Protocol
Some objects like metal containers will have unwanted reflection when they shouldn't otherwise.
2024-10-22 11:34:02 +02:00
Philip Rebohle
ce42ce2f3f [dxvk] Remove memory worker thread 2024-10-21 17:29:38 +02:00
Philip Rebohle
a5dc3400bd [dxvk] Use swap chain fences to synchronize WSI semaphores
Requires EXT_swapchain_maintenance1 to work, otherwise we won't use this.
2024-10-21 12:02:44 +02:00
Philip Rebohle
27539fc838 [dxvk] Use timeline semaphores for GPU synchronization
Ditches the old fence and binary semaphore code.
2024-10-21 12:02:44 +02:00
Philip Rebohle
1ee60048c0 [dxvk] Create timeline semaphores in submission queue 2024-10-21 12:02:44 +02:00
Philip Rebohle
4c0cbbef6a [dxvk] Factor DxvkResource code into DxvkPagedResource
And remove the now obsolete code.
2024-10-18 12:42:33 +02:00
Philip Rebohle
6540ab4f3e [dxvk] Use DxvkPagedResource for CPU synchronization 2024-10-18 12:42:33 +02:00
Philip Rebohle
3a587c5116 [dxvk] Remove old lifetime tracking code 2024-10-18 12:42:33 +02:00
Philip Rebohle
cc22ccfc5c [dxvk] Use new lifetime tracking for resources 2024-10-18 12:42:33 +02:00
Philip Rebohle
8389734e9f [dxvk] Use new lifetime tracking for raw allocations 2024-10-18 12:42:33 +02:00
Philip Rebohle
b011e22406 [dxvk] Use new lifetime tracking for samplers 2024-10-18 12:42:33 +02:00
Philip Rebohle
7fef97dae0 [dxvk] Use new lifetime tracking for events 2024-10-18 12:42:33 +02:00
Philip Rebohle
50d8e3933a [dxvk] Use new lifetime tracking for queries 2024-10-18 12:42:33 +02:00
Philip Rebohle
4a00623c40 [dxvk] Introduce DxvkTrackingRef and new tracking functions
The intention here is to clean up the code significantly while also
paving a way to perform more complex operations on resource release.
2024-10-18 12:42:33 +02:00
Philip Rebohle
56e8d55830 [dxvk] Remove direct resource allocation tracking
Track the containing virtual resources instead and only explicitly
keep allocations alive through invalidations.
2024-10-18 12:42:33 +02:00
Philip Rebohle
863ce5f117 [dxvk] Move DxvkAccess{Flags} to separate file 2024-10-18 12:42:33 +02:00
Philip Rebohle
d72346f2cb [dxvk] Rename various storage-related functions 2024-10-18 12:42:33 +02:00
Philip Rebohle
43355ecd73 [dxvk] Optimize small_vector reallocation code 2024-10-18 12:42:33 +02:00
Philip Rebohle
e2b4060d43 [dxvk] Properly dirty multisample state when binding linked pipelines
Fixes a validation error in GTA V in very specific circumstances.
2024-10-17 19:40:17 +02:00
Philip Rebohle
990c7f562a [dxvk] Rework HUD to use a GPU query directly
Allows us to leverage the global timestamp query pool now that queries
are reference-counted properly.
2024-10-17 14:27:09 +02:00
Philip Rebohle
fb6e0ad6c1 [dxvk] Remove useless DxvkMarker class 2024-10-16 20:57:50 +02:00
Philip Rebohle
500c86c054 [d3d9] Replace staging buffer marker with monotonic fence
Brings this in line with D3D11.
2024-10-16 20:57:50 +02:00
Philip Rebohle
0249193403 [util] Avoid locking fence objects on wait if target value was reached 2024-10-16 20:57:50 +02:00
Philip Rebohle
bdec26b442 [dxvk] Actually flush layout transition in clearImageViewCs
Fixes 2864a5e474.
2024-10-16 20:55:59 +02:00
Philip Rebohle
f8b9efd11e [dxvk] Fix misaligned image uploads on transfer queue 2024-10-16 11:38:42 +02:00
Philip Rebohle
d2155c7f8c [dxvk] End transform feedback when changing the active graphics pipeline 2024-10-16 11:33:40 +02:00
Philip Rebohle
f69dc96c24 [dxvk] Sanitize multisample state for fragment output libraries
Validation complains about MS state being different between fragment shader
pipeline libraries and fragment output libraries on the EDS3 path.
2024-10-16 11:33:29 +02:00
Philip Rebohle
8ab6b8616b [dxvk] Track image initialization 2024-10-16 11:32:55 +02:00
Philip Rebohle
255e7b7d7a [dxvk] Add functions for image subresource initialization tracking 2024-10-16 11:32:55 +02:00
Philip Rebohle
af4ec3c63d [dxvk] Normalize render target layouts when binding framebuffer
No reason to use ATTACHMENT_OPTIMAL when the default layout is GENERAL.
2024-10-16 11:32:55 +02:00
Philip Rebohle
f76fb75956 [d3d9] Prefer GENERAL layout for read-only textures 2024-10-16 11:32:55 +02:00
Philip Rebohle
b2598906ca [d3d11] Prefer GENERAL layout for read-only textures 2024-10-16 11:32:55 +02:00
Philip Rebohle
6301b9d23d [dxvk] Remove old barrier tracking code 2024-10-16 11:32:55 +02:00
Philip Rebohle
708d23ca4b [dxvk] Use new barrier batch and barrier tracker for main command buffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
4d2799f0d4 [dxvk] Add helper to determine pending barriers 2024-10-16 11:32:55 +02:00
Philip Rebohle
56a58095fe [dxvk] Use new barrier helpers for shader execution barriers 2024-10-16 11:32:55 +02:00
Philip Rebohle
4b94b8989d [dxvk] Use new barrier helpers in transition*Attachment 2024-10-16 11:32:55 +02:00
Philip Rebohle
0388f20cd3 [dxvk] Use new barrier helpers in updateGraphicsPipelineState 2024-10-16 11:32:55 +02:00
Philip Rebohle
7c274d0852 [dxvk] Use new barrier helpers in renderPassEmitPostBarriers 2024-10-16 11:32:55 +02:00
Philip Rebohle
3d12c1aea5 [dxvk] Use new barrier helpers in renderPassEmitInitBarriers 2024-10-16 11:32:55 +02:00
Philip Rebohle
d00d0a39ce [dxvk] Use new barrier helpers in spillRenderPass 2024-10-16 11:32:55 +02:00
Philip Rebohle
c2edd0f9bb [dxvk] Use new barrier helpers in resolveImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
7b65ee00d9 [dxvk] Use new barrier helpers in resolveImageDs 2024-10-16 11:32:55 +02:00
Philip Rebohle
7b436a63fb [dxvk] Use new barrier helpers in resolveImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
63347b5fce [dxvk] Use new barrier helpers in copySparsePages 2024-10-16 11:32:55 +02:00
Philip Rebohle
706d6cbc1c [dxvk] Use new barrier helpers in copyImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
42da4348bf [dxvk] Use new barrier helpers in copyImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
2864a5e474 [dxvk] Use new barrier helpers in clearImageViewCs
And ensure we're in GENERAL layout. We generally (pun intended) should
be, but there may be a universe where that is not the case.
2024-10-16 11:32:55 +02:00
Philip Rebohle
793f9b3d38 [dxvk] Use new barrier helpers in clearImageViewFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
856a84e6fd [dxvk] Use new barrier helpers in copyImageToBufferCs
And actually rename that function to make sense.
2024-10-16 11:32:55 +02:00
Philip Rebohle
59d37757b0 [dxvk] Use new barrier helpers in copyImageToBufferHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
e21c2977df [dxvk] Use new barrier helpers in copyBufferToImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
d7dd80b62f [dxvk] Use new barrier helpers in copyBufferToImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
389e40be67 [dxvk] Use new barrier helpers in blitImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
82c2f5d5d1 [dxvk] Use new barrier helpers in blitImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
a4daa63d2b [dxvk] Use new barrier helpers in launchCuKernelNVX 2024-10-16 11:32:55 +02:00
Philip Rebohle
ab9ade76d7 [dxvk] Use new barrier helpers in emitGraphicsBarrier 2024-10-16 11:32:55 +02:00
Philip Rebohle
e70e72f109 [dxvk] Use new barrier helpers in updateBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
ab300dce2f [dxvk] Use new barrier helpers in performClear 2024-10-16 11:32:55 +02:00
Philip Rebohle
a1a9cd5bb6 [dxvk] Use new barrier helpers in transformImage 2024-10-16 11:32:55 +02:00
Philip Rebohle
7edfad763a [dxvk] Use new barrier helpers in ensureImageCompatibility 2024-10-16 11:32:55 +02:00
Philip Rebohle
33b146467a [dxvk] USe new barrier helpers in generateMipmaps 2024-10-16 11:32:55 +02:00
Philip Rebohle
03a716e308 [dxvk] Use new barrier helpers in emit*Barrier 2024-10-16 11:32:55 +02:00
Philip Rebohle
ee9d09c2e2 [dxvk] Use new barrier helpers in dispatchIndirect 2024-10-16 11:32:55 +02:00
Philip Rebohle
826114f612 [dxvk] Use new barrier helpers in copyPackedBufferImage 2024-10-16 11:32:55 +02:00
Philip Rebohle
3ecca3d171 [dxvk] Use new barrier helpers in copyBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
6ef6cb3b45 [dxvk] Use new barrier helpers in clearBufferView 2024-10-16 11:32:55 +02:00
Philip Rebohle
5dfc4d6300 [dxvk] Use new barrier helpers in clearBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
cc3dd31a5f [dxvk] Use new barrier helpers in changeImageLayout 2024-10-16 11:32:55 +02:00
Philip Rebohle
bbe7767475 [dxvk] Add helpers to flush pending execution barriers if needed 2024-10-16 11:32:55 +02:00
Philip Rebohle
318e79c2ad [dxvk] Use new barrier batch for init and sdma barriers
No tracking needed here.
2024-10-16 11:32:55 +02:00
Philip Rebohle
50b1932aea [dxvk] Use new barrier helper in uploadBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
b33f0c3d30 [dxvk] Use new barrier helper in updateBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
e6c0903600 [dxvk] Use new barrier helper in initSparseImage 2024-10-16 11:32:55 +02:00
Philip Rebohle
9698653055 [dxvk] Use new barrier helper in initImage 2024-10-16 11:32:55 +02:00
Philip Rebohle
94915fcbe3 [dxvk] Use new barrier helper in initBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
6b01203ddf [dxvk] Use new barrier helper in copyBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
6e6ee35587 [dxvk] Use new barrier helper in clearBuffer 2024-10-16 11:32:55 +02:00
Philip Rebohle
b771bef837 [dxvk] Add helper functions to record pending barriers 2024-10-16 11:32:55 +02:00
Philip Rebohle
d154a684ad [dxvk] Remove acquire barrier set 2024-10-16 11:32:55 +02:00
Philip Rebohle
3de0f27dd9 [dxvk] Use new layout transition helper in resolveImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
801ef39895 [dxvk] Use new layout transition helper in resolveImageDs 2024-10-16 11:32:55 +02:00
Philip Rebohle
154eee96a0 [dxvk] Use new layout transition helper in resolveImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
704fc4eaa7 [dxvk] Use new layout transition helper in copySparseImagePages 2024-10-16 11:32:55 +02:00
Philip Rebohle
4d19e58f51 [dxvk] Use new layout transition helper for copyImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
7ffde27551 [dxvk] Use new layout transition helper in copyImageHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
bbd041194b [dxvk] Use new layout transition helper in clearImageViewFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
18cdc25773 [dxvk] Use new layout transition helper in copyImageToBufferFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
e8a5583562 [dxvk] Use new layout transition helper in copyImageToBufferHw 2024-10-16 11:32:55 +02:00
Philip Rebohle
088e4024f5 [dxvk] Use new layout transition helper in copyBufferToImageFb 2024-10-16 11:32:55 +02:00
Philip Rebohle
ebd067f098 [dxvk] Use new layout transition helper in copyBufferToImageHw 2024-10-16 11:32:55 +02:00