1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 07:08:50 +01:00
Commit Graph

924 Commits

Author SHA1 Message Date
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
Philip Rebohle
4ed50ec6be [d3d9] Fix UP buffer allocation 2024-09-27 12:55:59 +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
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
6f6e75b4b8 [d3d9] Use DxvkBufferAllocation where appropriate 2024-09-26 17:37:50 +02:00
Robin Kertels
f5ca3cf5df [d3d9] ResolveZ: Only copy aspects that both images support 2024-09-25 00:32:13 +01:00
Robin Kertels
d7c2e3ac76 [d3d9] Use correct aspect mask when blitting depth stencil textures
We don't want to blit stencil when the D3D9 format doesn't have
stencil.
2024-09-25 00:32:13 +01:00
Robin Kertels
ca3aa2014b [d3d9] Improve comment about synchronization with ProcessVertices 2024-09-22 22:53:55 +02:00
Robin Kertels
1d49f247ac [d3d9] Remove incorrect early-exit
The same texture could be bound to
multiple slots and if the shader doesn't
use the lower index texture, we'd never
end up uploading it.
2024-09-22 22:53:55 +02:00
Robin Kertels
ef8bad33a5 [d3d9] Optimize late buffer uploads
... similar to what we're doing for textures.
2024-09-22 22:53:55 +02:00
Robin Kertels
04ad98690b [d3d9] Add SWVP HUD item 2024-09-22 21:03:23 +02:00
Robin Kertels
033104f335 [d3d9] Cleanup buffer memory flag selection 2024-09-22 21:03:23 +02:00
Robin Kertels
5bb8d09a96 [d3d9] Always use per-draw buffer uploads on pure SWVP devices 2024-09-22 21:03:23 +02:00
WinterSnowfall
97fb6e4f6d [d3d9] Clean up supported formats from GetUnsupportedFormatInfo 2024-09-22 20:51:15 +02:00
WinterSnowfall
7985ac9cdb [d3d9] Add R16 and AL16 as known unsupported formats 2024-09-22 20:51:15 +02:00
Robin Kertels
07e7781c0b [d3d9] Only add meta image usage after determining layout 2024-09-22 15:48:18 +02:00
WinterSnowfall
c7cf0a7368 [d3d8] Respect D3DCREATE_MULTITHREADED and make d3d8 thread safe 2024-09-21 16:05:25 +02:00
Robin Kertels
c8791a6ba5 [d3d9] Don't emit 1-sized vector type in SWVP Emu
Fixes a validation error.
2024-09-20 12:57:11 +02:00
Robin Kertels
900edf55b5 [d3d9] Only create sampling image views if the image supports sampling
Fixes validation error
2024-09-20 12:57:11 +02:00
Robin Kertels
46e8161649 [d3d9] Enable shaderInt8 for ProcessVertices 2024-09-20 12:57:11 +02:00
Robin Kertels
828aaa5cdd [d3d9] Add missing TRANSFER_SRC usage for swapchain helper images 2024-09-20 12:57:11 +02:00
Philip Rebohle
ddb59ae394 [dxvk] Add usage property to buffer views
And pass it to the Vulkan driver depending on maintenance5 support.
2024-09-18 15:55:57 +02:00
Robin Kertels
010738c107 [d3d9] Add HUD item for FF shaders 2024-09-17 18:30:27 +02:00
Robin Kertels
903f1af176 [d3d9] Fix PresentGDI 2024-09-12 15:39:21 +02:00
llyyr
1a1c3a4202 [d3d9,d3d11] recreate swapchain on VK_SUBOPTIMAL_KHR
The vulkan wayland wsi returns suboptimal when the window is
fullscreened and not directly scanned out, and there are modifiers
available that would allow the window to be directly scanned out.
Recreate the swapchain if we receive suboptimal result.

This allows us recreate the swapchain to use a modifier that allows
direct scan-out under winewayland on wayland compositors.
2024-09-11 16:38:26 +02:00
Robin Kertels
daccde7643 [d3d9] Don't set IMAGE_USAGE_SAMPLED_BIT for non-msaa depth stencil surfaces 2024-09-04 22:17:10 +00:00
Robin Kertels
7f8cfec46f [d3d9] Always set IsAttachmentOnly for CreateOffscreenPlainSurfaceEx
Surfaces cannot be bound as textures.
2024-09-04 22:17:10 +00:00
Robin Kertels
1b172344eb [d3d9] Remove redundant scene check in StretchRect 2024-09-04 22:17:10 +00:00
Robin Kertels
11efd5092e [d3d9] Handle remaining edge cases of Discard & Lockable 2024-09-04 22:17:10 +00:00
Philip Rebohle
04d558cf2e [util] Make frame rate limiter enablement heuristic more robust
Allow for more buffering to happen in order to not enable the limiter
too eagerly.
2024-09-02 17:50:47 +02:00
ericzlmd
38308d443e [build] added <algorithm> header for failed subcommand fix - remove_if 2024-08-31 13:23:26 +02:00
Philip Rebohle
1e5b78e8ea [d3d9] Enable longMad behaviour by default
And remove the respective config option.
2024-08-14 22:15:50 +02:00
Blisto91
6308266a0f [d3d9] Default to Strict floatEmulation for amdvlk 2024.Q3.1
The AMD Linux open source driver now optimizes for the Strict floatEmulation path.
2024-08-13 17:18:34 +02:00
Paul Gofman
5c987ea3d1 [d3d9] Handle map failure in texture initializer 2024-08-08 21:42:04 +02:00
Jeff
e38693cdbc [d3d9] Allow querying ID3D9VkInteropTexture from surfaces 2024-08-08 05:25:41 +01:00
Robin Kertels
031a98c232 [d3d9] Allow fourcc formats as the source in CheckFormatConversion
The docs say:
"The source format must be a FOURCC format or a valid back buffer format."
2024-07-19 19:25:31 +00:00
Robin Kertels
b7d61b70c1 [d3d9] Use converted format for multiplane formats in CheckFormat 2024-07-19 19:25:31 +00:00
Robin Kertels
af1ba1b205 [d3d9] FF: Fix return type for lighting op 2024-07-16 16:08:33 +02:00
Robin Kertels
d456d0b437 [d3d9] StretchRect: Allow using an offscreen surface as dst when stretching 2024-07-09 13:54:59 +00:00
Robin Kertels
cc87870be1 [d3d9] Relax stretch rect check in D3D8 mode 2024-07-09 13:54:59 +00:00
Robin Kertels
a7ae5999a9 [d3d8] Slightly clean up CopyRects 2024-07-09 13:54:59 +00:00
WinterSnowfall
ef0c6b6f6f [d3d9] Hardware cursor fixes 2024-07-07 01:32:40 -07:00
Robin Kertels
9b504b506e [d3d9] Rework FF texcoord processing to be more accurate 2024-07-07 01:28:44 -07:00
Robin Kertels
bbe851f6a2 [d3d9] Reduce data copied for SWVP vertex decls 2024-07-05 00:44:28 -07:00
Robin Kertels
ab12ffa0da [d3d9] Use max point size of Vulkan device
The default render state value has to match what we report in the device caps.
Fixes a Wine stateblock test.
2024-07-05 00:44:28 -07:00
Robin Kertels
dc3dd0f88c [d3d9] Ignore the vertex stream offset in StateBlock::Capture
Fixes a Wine test and matches further testing on Windows.
2024-07-05 00:44:28 -07:00
Robin Kertels
da814668bc [d3d9] FF: Prevent specular highlights on the back of geometry
Fixes the Wine test "test_specular_lighting".
2024-07-05 00:44:28 -07:00
Robin Kertels
9e422a2b63 [d3d9] Fix default light
Fixes the diffuse alpha and the direction.
2024-07-05 00:44:28 -07:00
Robin Kertels
11db6d691c [d3d9] Fix reference leak in ProcessVertices
Also fixes a Wine test.
2024-07-05 00:44:28 -07:00
Robin Kertels
9c898bd269 [d3d9] Skip presenting if D3D9Swapchain has no associated window 2024-07-05 00:44:28 -07:00
Robin Kertels
175772944c [d3d9] Fix Wine test failures in StretchRect 2024-07-05 00:44:28 -07:00
WinterSnowfall
5ae3cfe402 [d3d9] Fix DF Formats selection logic 2024-07-05 00:43:09 -07:00
WinterSnowfall
b03de97f1b [d3d9] Expose support for D16_LOCKABLE only on AMD 2024-07-05 00:43:09 -07:00
WinterSnowfall
18035820de [d3d9] Remove vestigial D32 support 2024-07-05 00:43:09 -07:00
Philip Rebohle
86f04a2da3 Revert "[util] Consolidate maxFrameRate options"
This reverts commit 1811f4b995.

The D3D12 Beyond Good and Evil remaster uses the same exe name as the
original D3D9 game, so it turns out the separation was useful after all.
2024-06-26 00:42:31 +02:00
Robin Kertels
3145020a62 [d3d9] Only change vertex offset draw parameters when necessary
... Only change it when the vertex data is actually dynamically uploaded.
2024-06-21 13:18:39 +02:00
WinterSnowfall
e9fc071d95 [d3d9] Validate D3DCREATE_PUREDEVICE usage 2024-06-20 03:34:45 +00:00
Jeff
3e5eb1660f
[d3d8] Implement Dref scaling and fixed-function depth textures (#3565) 2024-06-14 12:10:49 +02:00
Philip Rebohle
1811f4b995 [util] Consolidate maxFrameRate options 2024-06-11 15:45:17 +02:00
Philip Rebohle
5674abe483 [d3d9] Limit frame rate to display refresh as necessary 2024-06-11 15:45:17 +02:00
Robin Kertels
7df8017e46 [d3d9] FF: Apply transform flags count to generated texture coords
... and fix cases where projection doesn't get applied.
2024-05-27 20:52:32 +00:00
WinterSnowfall
c98152683f [d3d9] Tweak VCache query results 2024-05-27 19:53:19 +02:00
Robin Kertels
60cfafe027 [d3d9] Fix strange type in dynamic vertex upload 2024-05-26 04:58:47 +00:00
Robin Kertels
889802887f [d3d9] Rework uploading dynamic sysmem buffers at draw time
... and handle mismatching vertex sizes and vertex strides.
2024-05-23 16:44:49 +02:00
WinterSnowfall
a1ce690c5c [d3d9] Determine DF format support in the options parser 2024-05-23 16:37:09 +02:00
WinterSnowfall
07d007c642 [d3d9] Use customVendorId to determine the options vendorId 2024-05-23 16:37:09 +02:00
Danylo Piliaiev
58d8ea2d31 [d3d11,d3d9,util] Add a config option for reproducible VK output
It ensures that for the same D3D commands the output VK commands
don't change between runs.

Useful for comparative benchmarking, can negatively affect performance.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
2024-05-23 15:20:28 +02:00
Simon McVittie
2ff2c826a5 [build] Generate pkg-config metadata to link to DXVK libraries
This allows dependent projects to query the version and location of DXVK
via the pkg-config interface.

The include directories aren't yet set, because the headers aren't
installed; that will follow in a subsequent commit.

The naming of these pkg-config files is based on proposed Fedora packages
for DXVK 2.0, and is not compatible with older Fedora packages for DXVK
1.x (which used the naming convention dxvk-native-d3d9 and so on).
Packagers can create symlinks such as dxvk-native-d3d9.pc -> dxvk-d3d9.pc
if they want to retain compatibility with older names.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-21 19:18:12 +00:00
Simon McVittie
83436a97f2 [meson] Set the stem of library names instead of the name_prefix
This is necessary for compatibility with Meson's pkg module, which
generates pkg-config metadata containing "-lNAME" where NAME is the
first argument to shared_library(). Changing the name_prefix parameter
would break that.

Conversely, including .dll or .so in the first parameter would also
break that, so remove the `+dll_ext` part (in practice this is not a
functional change, because `dll_ext` is always set to an empty string).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-21 19:18:12 +00:00
Ethan Lee
f33453afbb [build] Add soversion to dxvk-native binaries 2024-05-21 19:18:12 +00:00
Robin Kertels
65dd3c7df3 [d3d9] Always enable STORAGE_BUFFER usage
Fixes a validation error. Drivers don't care about buffer usage bits anyway.
2024-05-21 20:32:13 +02:00
Robin Kertels
dfc3776b24 [d3d9] FF: Fix a bunch of wine tests with FF texture coordinates 2024-05-21 20:32:13 +02:00
Philip Rebohle
3420cd78ac [dxvk] Use new Version helper to deal with driver version numbers 2024-05-20 18:30:36 +02:00
WinterSnowfall
20185a5309 [d3d9] Do not enable support for DF formats on Nvidia 2024-05-18 16:16:34 +00:00
Philip Rebohle
611dc60018 [d3d9] Do not support cube textures with depth formats 2024-05-08 17:05:48 +00:00
WinterSnowfall
b2789ab894 [d3d9] Validate DS format support during CheckDepthStencilMatch 2024-05-06 20:26:09 +00:00
Philip Rebohle
2970645f33 [dxvk] Fix push constant compatibility for pipeline libraries
When linking pipelines, all pipeline libraries are required to declare
the exact same set of push constants, even for stages not part of the
respective libraries.

This invalidates all fossilize databases.
2024-04-26 19:54:52 +02:00
WinterSnowfall
571948cfc0 [d3d9] Remove support for VERTEXSTATS queries 2024-04-13 19:11:00 +01:00
Joshua Ashton
0beb18ef73 [d3d9] Wait for submission when calling ReturnUnderlyingResource 2024-03-16 19:11:11 +00:00
Joshua Ashton
ef4428ab8c [d3d9] Improve ReturnUnderlyingResource stub for 9on12 2024-03-16 18:59:03 +00:00
Robin Kertels
8b8be7c2bf [d3d9] Fix stream count in Reset 2024-03-10 17:12:22 +01:00
Billy Laws
0776d764a4
build: Support building for ARM64EC
When targeting ARM64EC, both __x86_64__ and _M_X86_64 are defined but
not all x86 intrinsics are present, treat EC as regular ARM64 so the
native intrinsics are used instead.
2024-03-09 05:43:46 +00:00
Robin Kertels
15ddadc4de [d3d9] Fix number of streams 2024-03-08 18:42:15 +01:00
Robin Kertels
72c86b8229 [d3d9] Only unbind in EndScene if the game cleared the binding 2024-03-06 22:58:48 +01:00
Robin Kertels
85215b10d6 [d3d9] Respect vertex buffer offset when dynamically uploading geometry 2024-03-06 18:13:26 +01:00
Robin Kertels
20490b678f [d3d9] Fix missing else brackets in ResetSwapchain 2024-03-06 12:08:45 +01:00
Robin Kertels
a0e39e94fa [d3d9] Use most recently used swapchain for GetFrontBufferData 2024-03-05 13:54:15 +00:00
Robin Kertels
eaa732d0b3 [d3d9] Place GetFrontBufferData screenshot at window position 2024-03-05 13:54:15 +00:00
Robin Kertels
49b18f03fe [d3d9] Unbind buffers in EndScene & Reset 2024-03-05 13:52:51 +00:00
Robin Kertels
c5a37d443a [d3d9] Handle null IBO when uploading data for draw 2024-02-20 13:04:01 -08:00
Robin Kertels
39c19e9299 [d3d9] End scene on reset 2024-02-20 12:58:03 -08:00
Robin Kertels
738fd4f895 [d3d9] Don't actually unbind buffers 2024-02-20 12:58:03 -08:00
Robin Kertels
ab3593185f [d3d9] Fail GetRTData if src and dst have mismatching sizes
MySims tries to do this and needs this to fail,
otherwise mouse picking is off.
2024-02-06 11:02:43 +01:00
Echo J
fae78407a2 d3d9: Remove an unused variable
This fixes a gcc warning (originally reported by Saancreed)
2024-02-06 10:19:28 +01:00
Robin Kertels
5312ef1cf9 [d3d9] Upload DYNAMIC+SYSMEM vertex and index data for each draw 2024-02-05 13:13:18 +00:00
Robin Kertels
62d64bd63a [d3d9] Don't upload buffers before Up draws 2024-02-05 13:13:18 +00:00
Tatsuyuki Ishi
e2a46a347d [meta] Declare bool conversion operators as explicit
Non-explicit conversion operators in general can participate in very
surprising conversion chains. Explicit bool operator is a good place to
start with, because even with explicit they do get automatic contextual
conversion in a lot of places, e.g., if conditions.
2024-01-27 11:44:51 +01:00
Robin Kertels
0841f5faf4 [d3d9] Implement config option to disable rejecting reset 2024-01-26 18:11:25 +00:00