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

4160 Commits

Author SHA1 Message Date
Philip Rebohle
c590736fec
[dxbc] Generate smallest possible vectors for local arrays
FXC is buggy and always emits vec4 in the array declaration,
so we'll have to analyze the used components ourselves.
2022-03-24 12:47:40 +01:00
Robin Kertels
b2f22d5719 [d3d9] UpdateTexture: Handle automatic mip gen properly 2022-03-24 02:31:42 +00:00
Philip Rebohle
119c1ececb
[util] Set frame latency to 1 for God of War
Frame pacing is horrible otherwise, as of the 1.0.9 update.
2022-03-24 03:05:29 +01:00
Philip Rebohle
6b8e8afd5b
[dxvk] Zero-initialize newly allocated buffer slices on creation
Fixes random flicker in God of War. Since patch 1.0.9, the game's lighting
system relies on MAP_DISCARD returning a zero-initialized memory slices for
its constant buffers, or some lights would get skipped in various compute
passes. Changing the memset to e.g. write 0xFF instead of 0 shows this issue.
2022-03-24 02:46:25 +01:00
Philip Rebohle
e440fa26ab
[dxbc] Handle fallthrough around default properly 2022-03-23 15:32:45 +01:00
Philip Rebohle
8823e4bb3d
[dxgi] Work around swapchain use-after-free bugs
Affects Divinity: Original Sin Enhanced Edition. Requires Wine hack to
delay memory deallocation to not crash during resolution changes.
2022-03-23 15:09:39 +01:00
Philip Rebohle
586948df1e
[d3d11] Get strong reference to swap chain in swap chain back buffers 2022-03-22 19:48:13 +01:00
Philip Rebohle
42edb62df8
[d3d11] Use smart pointer for swap chain back buffer 2022-03-22 19:28:49 +01:00
Philip Rebohle
b015cf0bb2
[dxbc] Support switch-case fallthrough
Apparently this is a thing in Shader Model 4, although FXC cannot emit it.
2022-03-22 17:32:43 +01:00
Philip Rebohle
0d54f7161c
[util] Enable cached dynamic resources for AC3 and AC4
Without it, AC3 chugs along at 40 FPS on my 5950X.
2022-03-19 20:12:20 +01:00
Oleg Kuznetsov
b36ca2c758 [d3d9] Fix Visual Studio build to resolve 'operator !=' is ambiguous error for RECT 2022-03-17 11:35:19 +01:00
Oleg Kuznetsov
5156994440 [dxvk] Add a config option to enable debug utils in addition to DXVK_PERF_EVENTS=1 2022-03-17 11:35:19 +01:00
Joshua Ashton
cf1cee04b8 [d3d11] Register annotation interfaces with D3D9
Some apps try use the D3DPERF_ functions for debug markers/annotations.

This utilizes the DXVK_RegisterAnnotation hidden functions to share the interfaces.

Co-authored-by: Oleg Kuznetsov <okouznetsov@nvidia.com>
2022-03-17 11:35:19 +01:00
Joshua Ashton
937a60c882 [d3d9] Add hidden exports for registering annotations
Adds DXVK_RegisterAnnotation at ordinal 28257 and DXVK_UnRegisterAnnotation at ordinal 28258.
2022-03-17 11:35:19 +01:00
Joshua Ashton
787a979514 [d3d9] Implement D3D9UserDefinedAnnotation 2022-03-17 11:35:19 +01:00
Joshua Ashton
47b1ab52ce [d3d9] Implement D3D9GlobalAnnotationList 2022-03-17 11:35:19 +01:00
Joshua Ashton
5d54d79865 [d3d11] Use IDXVKUserDefinedAnnotation 2022-03-17 11:35:19 +01:00
Joshua Ashton
a010397f34 [util] Move DecodeD3DColor to util
This will be used in the D3D11UserDefinedAnnotation implementation to handle PIX calls which contain a color.
2022-03-17 11:35:19 +01:00
Joshua Ashton
d5d5c1a8bc [dxvk] Define IDXVKUserDefinedAnnotation
Something common to share for perf markers between D3D9 and D3D11.

Inherits from the public D3D11 interface.
2022-03-17 11:35:19 +01:00
Joshua Ashton
0bc972697b [d3d11] Fix D3D11UserDefinedAnnotation declaration
Mark it as final too.
2022-03-17 11:35:19 +01:00
Georg Lehmann
2550cff149 [build] Cleanup build system.
No changes except dropping support for msvc before 15.3.
2022-03-17 01:38:58 +00:00
Georg Lehmann
f1efc9dc9f [dxso] Emit spirv OpCross if we can. 2022-03-16 19:13:09 +00:00
Georg Lehmann
630fee59fc [dxso] Implement zerowins for Lerp.
Fixes #2545.
2022-03-16 19:13:09 +00:00
Joshua Ashton
1f88ee595f [d3d9] Don't expose D32 format
Not supported anywhere except REF device it seems... *sigh*

Supercedes: #2547
2022-03-16 19:11:16 +00:00
Philip Rebohle
4f8da62c34
[dxvk] Fix color write mask normalization
Previously we'd set too many bits by accident here. Also, we should
not modify partial write masks to include unnecessary bits. Only do
this if we can actually promote to a full write mask for consistency.
2022-03-16 19:31:37 +01:00
Liam Middlebrook
f92c6ae859 [dxgi] Add DXVK_ENABLE_NVAPI envvar
Add a new environment variable DXVK_ENABLE_NVAPI as an environment-level
override for 'nvapiHack'. This will allow for DLSS (and other
NvAPI-backed features) to be available without the user manually writing
a configuration file, allowing for more seamless integration with
Proton's launch script.
2022-03-16 13:06:25 +01:00
Robin Kertels
115385d1d9 [d3d9] Update buffer seq number in FlushBuffer
How did I miss this?!
2022-03-15 01:24:54 +00:00
Robin Kertels
5f4fc56226 [d3d9] Update texture sequence number AFTER using it 2022-03-13 17:13:00 +00:00
Robin Kertels
a6357a254d [d3d9] Fix CS thread synchronization for directly mapped buffers 2022-03-13 17:13:00 +00:00
Philip Rebohle
9eb2393d44
[dxvk] Normalize color write masks for non-RGBA formats 2022-03-13 16:24:53 +01:00
Philip Rebohle
4c429f044f
[util] Add another weeb game to the list of workarounds
Sophie is apparently D3D9 an we already have Lydie and Suelle in there,
so it's just this on missing from that series.
2022-03-13 05:38:06 +01:00
Philip Rebohle
caa83247d9
[d3d9] Mark backend image as shared for shared resources
Otherwise, the backend may not transition the image to the correct
layout after each submission.
2022-03-13 02:32:56 +01:00
Robin Kertels
bd1a2aa5a1 [dxvk] Force dedicated allocation for exportable images
The Nvidia driver does not set prefers-/requiresDedicatedAllocation
for exportable images on its own.

This makes DXVK ignore the dedicated allocation struct ptr
which also contains VkExportMemoryAllocateInfo or
VkImportMemoryWin32HandleInfoKHR.
2022-03-13 00:43:41 +01:00
Philip Rebohle
59e3c96976
[d3d9] Fix texture formats that can be exported 2022-03-12 22:24:05 +01:00
Derek Lesho
1d1d8adee6
[d3d9] Fix shared handle check for exporting images
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2022-03-12 21:35:42 +01:00
Philip Rebohle
c87660480d
[d3d11] Reimplement R11G11B10 UAV clears without R32 views 2022-03-12 16:23:42 +01:00
Philip Rebohle
ee28f145dc
[d3d11] Explicitly handle R32-compatible UAV formats 2022-03-12 16:23:39 +01:00
Derek Lesho
6640cc350c
[d3d9] Add support for shared IDirect3DTexture9 resources. 2022-03-12 16:23:06 +01:00
Derek Lesho
48046e009c
[d3d11] Add support for shared ID3D11Texture2D resources. 2022-03-12 16:23:06 +01:00
Derek Lesho
f9d94c82a5
[util] Add helpers for shared resource metadata access. 2022-03-12 16:23:06 +01:00
Derek Lesho
02d3e0d31f
[dxvk] Add shared handle access to DxvkImage memory.
Based off preliminary work from Josh.
2022-03-12 16:23:06 +01:00
Derek Lesho
b5014401e7
[dxvk] Enable VK_KHR_EXTERNAL_MEMORY_WIN32 if available. 2022-03-12 16:23:03 +01:00
Philip Rebohle
5d4c8a6b51 [dxso] Fix ExpP instruction on Shader Model 2+ 2022-03-11 22:44:18 +00:00
Joshua Ashton
7151fbd598 [dxvk] Use new [[fallthrough]] attribute 2022-03-10 00:47:38 +01:00
Joshua Ashton
b96f65be31 [dxbc] Use new [[fallthrough]] attribute 2022-03-10 00:47:38 +01:00
Joshua Ashton
63bd41f785 [d3d11] Add fallthrough comment to PickFormats
Silences a warning
2022-03-10 00:47:38 +01:00
Joshua Ashton
dc6c350cf2 [d3d9] Add fallthrough comment to SetRenderState
Silences a warning
2022-03-10 00:47:38 +01:00
Joshua Ashton
f4ab14cafa [dxso] Fix potential fallthrough in RasterizerOut 2022-03-10 00:47:38 +01:00
Joshua Ashton
a5b0f2898a [dxso] Fix ExpP fallthrough 2022-03-10 00:47:38 +01:00
Joshua Ashton
b2d96ee087 [d3d9] Fix fallthroughs in PickFormats 2022-03-10 00:47:38 +01:00