Philip Rebohle
45da7d6678
[d3d11] Fix rectangle check in ClearView
...
It is legal to pass a potentially invalid pointer if NumRects is 0.
Fixes validation errors in TopSpin 2k25.
2024-12-09 17:43:53 +01:00
Philip Rebohle
15db475edf
[dxvk] Always disable exclusive fullscreen
2024-11-25 11:54:55 +01:00
Philip Rebohle
4fb6403b8f
[d3d11] Store map mode as raw integer
...
Fixes some annoying error with clang, hopefully.
2024-11-16 16:58:17 +01:00
Philip Rebohle
8584fc7722
[d3d11] Simplify mapped resource tracking on deferred context
2024-11-08 11:19:21 +01:00
Philip Rebohle
bdd4956dd3
[d3d11] Properly validate map parameters for images
2024-11-08 11:19:21 +01:00
Philip Rebohle
2db10b0af8
[d3d11] Use D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC where possible
2024-11-08 11:19:21 +01:00
Philip Rebohle
da406133f1
[d3d11] Add D3D11_COMMON_TEXTURE_MAP_MODE_DYNAMIC
2024-11-08 11:19:21 +01:00
Philip Rebohle
1d2d05dde0
[d3d11] Clean up some texture map mode checks
2024-11-08 11:19:21 +01:00
Philip Rebohle
bd6b7aedc1
[d3d11] Clean up image staging buffer creation
2024-11-08 11:19:21 +01:00
Philip Rebohle
9e316b8c71
[d3d11] Disallow MAP_WRITE_NO_OVERWRITE on dynamic images
...
D3D11 explicitly bans this, so we shouldn't pretend to support it.
2024-11-08 11:19:21 +01:00
Philip Rebohle
1dfb869df2
[d3d11] Tie mapped image memory type to map mode selection
...
Allows us to keep video images in system memory in order to avoid
wasting precious HVV.
2024-11-08 11:19:21 +01:00
Philip Rebohle
ae67c026aa
[d3d11] Implement image MAP_WRITE_DISCARD on immediate context
2024-11-08 11:19:21 +01:00
Philip Rebohle
789e8db699
[d3d11] Fix MAP_WRITE_DISCARD for mapped images on deferred contexts
...
The previous implementation was straight-up broken since it would use the
wrong subresource layout. We can discard the image now so let's just do that.
2024-11-08 11:19:21 +01:00
Philip Rebohle
30f2a8c26b
[d3d11] Add methods to discard direct-mapped images
2024-11-08 11:19:21 +01:00
Philip Rebohle
64e32d4ee1
[d3d11] Clean up InitHostVisibleTexture
...
Also fixes a potential crash if pSysMem of any initial data structs is null.
2024-11-08 11:19:21 +01:00
Philip Rebohle
f5241d187c
[d3d11] Use GetMapPtr when initializing mapped image buffer
2024-11-08 11:19:21 +01:00
Philip Rebohle
1832332d6d
[d3d11] Add GetMapPtr method to D3D11CommonTexture
...
Fixes a bug in Read/WriteSubresource where discards result in the wrong
pointer being passed to the app.
2024-11-08 11:19:21 +01:00
Philip Rebohle
c5d776c3b8
[d3d11] Cache subresource layouts for mapped images
...
Also adjust the way we expose certain direct-mapped images in order
to be as consistent with staging buffer behaviour as possible.
2024-11-08 11:19:21 +01:00
Philip Rebohle
a5e8a42288
[d3d11] Properly initialize optons struct
...
No bug, but it's good practice either way.
2024-11-08 11:19:21 +01:00
Philip Rebohle
bdf4cb765a
[d3d11] Remove d3d11.maxDynamicImageBufferSize option
2024-11-08 11:19:21 +01:00
Philip Rebohle
116d488faa
[d3d11] Use direct mapping for images in more situations
2024-11-08 11:19:21 +01:00
Philip Rebohle
35d94ae057
[d3d11] Improve memory type selection for direct-mapped images
2024-11-08 11:19:21 +01:00
Philip Rebohle
d4f25c81be
[d3d11] Remove d3d11.maxImplicitDiscardSize option
2024-10-31 12:13:27 +01:00
Philip Rebohle
f9bb8f0ad5
[d3d11] Consider discards when throttling immediate context
2024-10-31 12:13:26 +01:00
Philip Rebohle
a91afc3a2f
[d3d11] Do not touch row/depth pitch on failed map
...
Fixes a wine test.
2024-10-30 23:37:54 +01:00
Philip Rebohle
f0e9138886
[d3d11] Fix error return on MAP_WRITE_NO_OVERWRITE on deferred context
...
Fixes a wine test.
2024-10-30 23:37:54 +01:00
Philip Rebohle
67c5ab87f9
[d3d11] Add missing fragment shader stage to mapped image buffers
...
Relevant when uploading depth-stencil images.
2024-10-30 23:37:54 +01:00
Philip Rebohle
8ee7031742
[d3d11] Simplify InitHostVisibleBuffer
2024-10-30 23:37:54 +01:00
Philip Rebohle
223691b7aa
[d3d11] Use device fence wait in ThrottleAllocation
2024-10-30 23:37:54 +01:00
Philip Rebohle
e499f2e081
[d3d11] Fix potential crash when mapping a default image fails
...
This also marginally shortens common code paths.
2024-10-29 18:05:14 +01:00
Philip Rebohle
80fbaed291
Revert "[d3d11] Use existing MD5 hash to look up shader objects"
...
This reverts commit 800f71c4f53bb13276571b09fecf8c878eb7b9bd.
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
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
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
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
d72346f2cb
[dxvk] Rename various storage-related functions
2024-10-18 12:42:33 +02:00
Philip Rebohle
f8b9efd11e
[dxvk] Fix misaligned image uploads on transfer queue
2024-10-16 11:38:42 +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
b2598906ca
[d3d11] Prefer GENERAL layout for read-only textures
2024-10-16 11:32:55 +02:00
Philip Rebohle
35ead85929
[d3d11] Manually free all view objects in view destructor
2024-10-15 11:48:51 +02:00
Philip Rebohle
d00669cb52
[dxvk] Rename DxvkGpu{Event,Query} to Dxvk{Event,Query}
...
The old name only ever existed because DXVK had two separate implementations
of these prior to version 1.1. Let's name them back so that more sensible
names are available for internal use.
2024-10-13 12:08:35 +02:00
Philip Rebohle
a30fdc466b
[d3d11] Remove initializer context
...
This moves all initialization commands to the CS thread and the regular
context in such a way that resource initialization is processed before
any context commands can use the resource.
2024-10-08 17:46:18 +02:00
Philip Rebohle
df60a061a4
[d3d11] Throttle resource uploads via UpdateSubresource
...
Otherwise, some games (e.g. Frostpunk, New World) end up allocating over
a gigabyte of staging memory.
2024-10-08 17:46:18 +02:00
Philip Rebohle
ec18dd7846
[d3d11] Throttle resource uploads through staging buffer
2024-10-08 17:46:18 +02:00
Philip Rebohle
ad1f70beea
[dxvk] Support format conversion in copyImageToBuffer
2024-10-08 17:46:18 +02:00
Philip Rebohle
f67c8dd1da
[dxvk] Support format conversion in copyBufferToImage
2024-10-08 17:46:18 +02:00
Philip Rebohle
725a04b954
[dxvk,d3d11] Refactor uploadImage to consume a staging buffer
...
And also handle format differences.
2024-10-08 17:46:18 +02:00