Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
f016f9c
[include] Update Vulkan headers to version 1.4.363
chrismile Oct 6, 2026
56bac6b
[dxvk] Restrict sin/cos workaround to pre-Xe3 Intel GPUs
chrismile Oct 6, 2026
0e10259
[d3d11] Support converting d3d12 texture info in D3D11Device::Convert…
gofman Oct 7, 2026
852d454
[dxvk] Improve hang detection
doitsujin Oct 8, 2026
1cad6cd
[dxvk] Rework submission synchronization
doitsujin Oct 9, 2026
b6b8062
[dxvk] Always compute absolute frame target time
doitsujin Oct 9, 2026
290c803
[dxvk] Prefer absolute timing for present timing
doitsujin Oct 9, 2026
c7bc784
[dxvk] Explicitly pass time domain ID around to handle frame reports
doitsujin Oct 9, 2026
ca53d54
[dxvk] Be more robust against broken QPC calibration
doitsujin Oct 9, 2026
74b557a
[dxvk] Re-enable present timing by default
doitsujin Oct 9, 2026
081ee5c
[meta] Update dxbc-spirv
doitsujin Oct 8, 2026
71ec7b5
[dxvk] Fix broken negative timeout for keyed mutex
doitsujin Oct 10, 2026
2c94c5f
[util] Only spoof vendor id in New Vegas
Blisto91 Aug 21, 2026
822a7fc
[dxvk] Use COM instead of dynamic_cast for D3D11 Views
gamingdoom Oct 11, 2026
434e2ce
[d3d8] Properly handle X1R5G5B5 in CheckDeviceType
WinterSnowfall Oct 3, 2026
b2c2622
[d3d9] Fix window handle device resets in fullscreen mode
WinterSnowfall Oct 3, 2026
496d635
[d3d8] Use static casts for DWORD backed enum conversions
WinterSnowfall Oct 3, 2026
3c9e4c3
[d3d8] Use switch statements in all format helpers
WinterSnowfall Oct 3, 2026
17a85e6
[d3d9] Fix POSTBLENDSRGBCONVERT cap reporting and RS placement
WinterSnowfall Oct 3, 2026
a57923a
[d3d9] Leave device in a not reset state on validation failure
WinterSnowfall Oct 3, 2026
098e41a
[d3d9] Ignore SetLOD calls on non-MANAGED textures
WinterSnowfall Oct 3, 2026
66f252f
[d3d9] Report full constant set when in SWVP mode
WinterSnowfall Oct 3, 2026
6753e0c
[d3d9] Slightly clean StretchRect
K0bin Sep 30, 2026
44d1e38
[d3d9] Remove automatic resolving in LockImage
K0bin Sep 30, 2026
d263e09
[d3d9] Stretch rect merge fast path EmitCs calls
K0bin Oct 1, 2026
2ebe9a6
[d3d9] Improve GetMipSize naming
K0bin Oct 1, 2026
9692a69
[d3d9] Move size padding to Getter
K0bin Oct 1, 2026
39e5367
[d3d9] Improve naming of late mapping buffer creation function
K0bin Oct 1, 2026
7bcd023
[d3d9] Prevent creation of MANAGED surfaces
K0bin Oct 1, 2026
67fc6eb
[d3d9] Correct typo
K0bin Oct 1, 2026
40b2ed2
[d3d9] Validate texture dimensions
K0bin Oct 2, 2026
89e9eca
[d3d9] Align cubemap face mapping data to 16 bytes
K0bin Oct 2, 2026
649c4bc
[meta] Workaround a crash in EA anti cheat code signing checks.
Mailaender Oct 10, 2026
a78a467
[dxvk] Avoid requiring "" Vulkan extension in VR interop for empty ex…
gofman Oct 14, 2026
eae53c4
[dxvk] Add option to zero-initialize shader scratch variables
doitsujin Oct 15, 2026
f12a434
[util] Enable scratch zero-initialization for Call of Duty Ghosts
doitsujin Oct 15, 2026
569f40e
[meta] Update dxbc-spirv
doitsujin Oct 15, 2026
e8c80a8
[d3d9] Don't enable point scaling with weird projection matrices
doitsujin Oct 15, 2026
dc94817
[meta] Update dxbc-spirv
doitsujin Oct 16, 2026
6689ca9
[dxvk] Bump engine version to 3.2
doitsujin Oct 16, 2026
8c8937d
[dxvk] Fix inverted check when freeing shader cache instance
chapelsoftware Oct 16, 2026
0847af3
[dxvk] Lock allocator when creating imported and sparse allocations
chapelsoftware Oct 16, 2026
89b5490
[d3d9] Mark texture as uploaded in FlushImage
K0bin Oct 12, 2026
6cd3cbc
[d3d9] Add warning for stalls in UpdateTextureFromBuffer
K0bin Oct 11, 2026
3a71f3c
[d3d9] Switch texture map data to buffers early
K0bin Oct 13, 2026
2d0499f
[util] Fix building memory mapped file code for 64bit
K0bin Oct 13, 2026
227b83b
[d3d8] Reimplement CopyRects in the d3d8<->d3d9 bridge directly
K0bin Oct 1, 2026
2f0a0f6
[d3d8] Clean up CopyRects related helpers
WinterSnowfall Oct 16, 2026
1197650
[dxvk] Rework shader cache instance creation
doitsujin Oct 16, 2026
e2d619f
[dxvk] Rename method to create allocation for sparse page table
doitsujin Oct 16, 2026
8e73761
[vulkan] Add logging capabilities for present stage flags
doitsujin Oct 16, 2026
cb0eabc
[dxvk] Log present stage for present timing
doitsujin Oct 16, 2026
f94ab2e
[dxvk] Don't wait for present if timing is enabled
doitsujin Oct 16, 2026
c8679a5
[dxvk] Pass null timeout to D3DKMTAcquireKeyedMutex on INFINITE wait
ErenYeager1836 Oct 17, 2026
7d24881
Revert "[d3d9] Return null vector when sampling null texture in fixed…
doitsujin Oct 17, 2026
d744290
[dxvk] Fix native build issues
doitsujin Oct 17, 2026
8907e06
[dxvk] Fix scratch memory suballocation
K0bin Oct 18, 2026
d7e283b
[dxvk] Fix counter memory when generating mipmaps
K0bin Oct 18, 2026
e0fa1bc
[dxvk] Don't attach color RT if we're not resolving stencil
K0bin Oct 18, 2026
d3d57f4
[dxvk] Fix spec constant dirty mask comparison
K0bin Oct 18, 2026
0ae0003
[dxvk] Only draw one instance for copies
K0bin Oct 18, 2026
b17c967
[dxvk] Fix R5G6B5 bit shifts in meta copy shader
K0bin Oct 18, 2026
ac400e4
[dxvk] Fix aspect mask check when performing deferred clears
K0bin Oct 18, 2026
14260d1
[dxvk] Use 2D_ARRAY views for clears
K0bin Oct 18, 2026
1de51b9
[dxvk] Pop smallest item from fence queue first instead of largest
K0bin Oct 18, 2026
d213771
[dxvk] Fix derived types in SPIRV input elimination
K0bin Oct 18, 2026
0a6363e
[dxvk] Fix skipping name in SPIRV entry point patching
K0bin Oct 18, 2026
7e03c54
[dxvk] Notify all threads waiting for the CS thread
K0bin Oct 18, 2026
a5250d4
[dxvk] Clear shader cache LUT before re-initializing all files
K0bin Oct 18, 2026
224969e
D3D11Device::SetExceptionMode fake success.
alesliehughes Oct 17, 2026
2cb4018
[util] Allow AVX builds with clang
FireBurn Oct 18, 2026
b930112
[d3d11] Actually expose buffer interop interface
doitsujin Oct 20, 2026
ef3ef87
[d3d11] Fix losing D3D11_RASTERIZER_DESC1 ForcedSampleCount
K0bin Oct 20, 2026
6820e92
[dxvk] Make submission timeout configurable
doitsujin Oct 20, 2026
879fdc8
[d3d11,d3d9] Set infinite submission timeout for reproducibleCommandS…
doitsujin Oct 20, 2026
c640935
[util] Revive ticket lock implementation
doitsujin Oct 20, 2026
1c27dd4
[dxvk] Handle Nvidia not signaling fence if timing report queue is full
doitsujin Oct 20, 2026
87d5a68
[dxvk] Only query present timing feedback for FIFO modes
doitsujin Oct 20, 2026
7279c52
[dxvk] Also update timing reports on feedback query
doitsujin Oct 20, 2026
31cc010
[dxvk] Do not query timing reports if report queue is full
doitsujin Oct 20, 2026
0536663
[dxvk] Remove dynamically sized present timing queue
doitsujin Oct 20, 2026
67e1e58
[dxvk] Only track frames with actual timing query for the present queue
doitsujin Oct 20, 2026
80ea5f6
[dxvk] Pass full shader metadata when adding shader stage
doitsujin Oct 19, 2026
b77e0c5
[dxvk] Remove xfb-specific jank from shader key
doitsujin Oct 19, 2026
3c40ca3
[meta] Update dxbc-spirv
doitsujin Oct 20, 2026
cb253e0
[dxvk] Fix command buffer splitting
doitsujin Oct 20, 2026
65883aa
[dxvk] Be more robust against broken present timing reports
doitsujin Oct 20, 2026
d713ef8
[dxvk] Remove double lock from queryPresentTiming
doitsujin Oct 21, 2026
29dd21b
[dxvk] Don't use 0.0 memory priority for HVV allocations
doitsujin Oct 21, 2026
02e2028
[dxgi] Advertize fake nonlocal heap on integrated graphics
doitsujin Oct 21, 2026
ed73f1f
[util] Remove textureMemory config from Dark Sector
Blisto91 Oct 23, 2026
cbd2206
[native] Find the executable and the Vulkan loader on macOS
jm2 Oct 9, 2026
9c51dd8
[dxvk] Change eviction strategy to keep one chunk free
doitsujin Oct 27, 2026
884835c
[dxvk] Deprioritize HVV when freeing unused memory chunks
doitsujin Oct 27, 2026
534f0a1
[dxvk] Only free small chunks when actually allocating memory
doitsujin Oct 27, 2026
f4c7433
[dxvk] Introduce "promoted" residency status for resources
doitsujin Oct 27, 2026
e197a8a
[dxvk] Traverse relocation list in order
doitsujin Oct 27, 2026
bd395bf
[dxvk] Also consider dead chunks for eviction
doitsujin Oct 27, 2026
9c5551c
[d3d9] Fix integer divisions in YUV conversion
doitsujin Oct 27, 2026
0cfe089
[dxvk] Fix DxvkGraphicsPipelineVertexInputState::eq
werman Oct 28, 2026
bdd99c8
[dxvk] Log dynamic present mode changes
doitsujin Oct 29, 2026
2b804af
[dxvk] Check actual frame's present mode to decide whether to wait
doitsujin Oct 29, 2026
5d9b9ca
[dxvk] Fix misleading comment
doitsujin Oct 29, 2026
0ac7e28
[dxvk] Reset reference timings when presenting with a non-FIFO mode
doitsujin Oct 29, 2026
78cdf8f
[dxvk] Sanitize wait duration for frame target time
doitsujin Oct 29, 2026
d5df6b7
[meta] Update dxbc-spirv
doitsujin Oct 29, 2026
21fda8f
[meta] Update dxbc-spirv
doitsujin Oct 30, 2026
23b07e9
[meta] Add LLM checkbox to issue templates
Blisto91 Oct 31, 2026
c555cc9
[dxvk] Simplify command list ring buffer
doitsujin Oct 31, 2026
508ad04
[dxvk] Throttle CS chunk submission
doitsujin Oct 31, 2026
f863776
[d3d11] Limit number of command submissions in flight
doitsujin Oct 31, 2026
5c582a0
[util] Use CLOCK_MONOTONIC for dxvk-native on Linux
doitsujin Oct 30, 2026
0b8460f
[dxvk] Support non-QPC host time domains for present timing
doitsujin Oct 30, 2026
577a3ef
[dxvk] Clarify that present time feedback is in host domain
doitsujin Nov 1, 2026
8ad9b14
[util] Add helper to convert durations to raw clock ticks
doitsujin Nov 1, 2026
835bce7
[dxvk] Factor out function to query frame entry
doitsujin Nov 1, 2026
e58459d
[dxvk] Always wait for frame target time in host domain
doitsujin Nov 1, 2026
e716235
[dxvk] Remove legacy frame rate limiter
doitsujin Nov 2, 2026
24ab05c
[dxvk] Remove broken logic around old reference frame data
doitsujin Nov 2, 2026
93f2446
[dxvk] Factor HUD instance out of swapchain blitter
doitsujin Nov 1, 2026
bcfab0c
[hud] Explicitly pass presenter to HUD
doitsujin Nov 1, 2026
884298d
[hud] Use present timing feedback to determine frame rate
doitsujin Nov 1, 2026
988c488
[meta] Update dxbc-spirv
doitsujin Nov 2, 2026
99f1179
[dxvk] Fix FPS limiter on non-timing path
doitsujin Nov 2, 2026
cf0a0d9
[dxvk] Don't pass shared handle type for images that aren't shared
doitsujin Nov 2, 2026
a248e21
[dxvk] Remove latency trackers
doitsujin Nov 2, 2026
f214814
[dxvk] Simplify Reflex code in presenter
doitsujin Nov 2, 2026
4f1781c
[dxvk] Pass latency frame ID through to presenter
doitsujin Nov 2, 2026
bf621af
[d3d11] Re-implement Reflex device
doitsujin Nov 2, 2026
db9f494
[dxvk] Add Reflex latency statistics to presenter
doitsujin Nov 3, 2026
4b0df68
[dxvk] Reimplement latency HUD item
doitsujin Nov 3, 2026
a7e278a
[dxvk] Fix config option to enable NV_low_latency2
doitsujin Nov 3, 2026
a1aca15
[dxvk] Forward frame interval to Reflex
doitsujin Nov 4, 2026
86a2a2e
[dxvk] Restore missing check to skip over present_wait
doitsujin Nov 6, 2026
829e377
[meta] Update dxbc-spirv
doitsujin Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bug report
description: Report crashes, rendering issues etc.
body:
- type: checkboxes
attributes:
label: "By opening this issue, I confirm that:"
options:
- label: "I have not copy-pasted an LLM-generated response into the description."
required: true
- type: textarea
attributes:
label: Description
value: |
Please describe your issue as accurately as possible. Include screenshots or videos when relevant.
If you use Windows, please check the following page: https://github.com/doitsujin/dxvk/wiki/Windows
### Software information
Name of the game, settings used etc. Include any mods or add-ons if applicable.
### System information
- GPU:
- Driver:
- Wine version:
- DXVK version:
### Apitrace file(s)
- Put a link here
For instructions on how to use apitrace, see: https://github.com/doitsujin/dxvk/wiki/Using-Apitrace
### Log files
Please attach Proton or Wine logs as a text file:
- When using Proton, set the Steam launch options for your game to `PROTON_LOG=1 %command%` and attach the corresponding `steam-xxxxx.log` file in your home directory.
- When using regular Wine, use `wine game.exe > game.log 2>&1` and attach the resulting `game.log` file.
- On Windows, DXVK log files will usually appear next to the games exe or in its base folder.
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/other.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/other.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Other
description: Questions, feature requests etc.
body:
- type: checkboxes
attributes:
label: "By opening this issue, I confirm that:"
options:
- label: "I have not copy-pasted an LLM-generated response into the description."
required: true
- type: textarea
attributes:
label: Description
value: |
<!--
Not for reporting bugs. Please use the Bug report template instead
-->
39 changes: 4 additions & 35 deletions dxvk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,44 +96,13 @@
# dxvk.maxFrameRate = 0


# Controls latency sleep and Nvidia Reflex support.
#
# Supported values:
# - Auto: By default, DXVK only supports latency sleep in D3D11 games that
# use Reflex if the graphics driver supports VK_NV_low_latency2,
# and if dxvk-nvapi is enabled in Proton.
# - True: Enables built-in latency reduction based on internal timings.
# This assumes that input sampling for any given frame happens after
# the D3D9 or DXGI Present call returns; games that render and present
# asynchronously will not behave as intended.
# Similarly, this will not have any effect in games with built-in frame
# rate limiters, or if an external limiter (such as MangoHud) is used.
# In some games, enabling this may reduce performance or lead to less
# consistent frame pacing.
# The implementation will either use VK_NV_low_latency2 if supported
# by the driver, or a custom algorithm.
# - False: Disable Reflex support as well as built-in latency reduction.

# dxvk.latencySleep = Auto


# Tolerance for the latency sleep heuristic, in microseconds. Higher values
# increase latency, but may lead to better frame pacing in some cases. Does
# not have any effect if NV_low_latency2 is used.
#
# Supported values: Any non-negative number

# dxvk.latencyTolerance = 1000


# Disables the use of VK_NV_low_latency2. This will make Reflex unavailable
# in games, and if dxvk.latencySleep is set to True, a custom algorithm will
# be used for latency control. By default, the extension will not be used in
# 32-bit applications due to driver issues.
# Whether to enable VK_NV_low_latency2 for the Reflex implementation.
# On 32-bit, this is disabled by default due to massive frame pacing
# issues.
#
# Supported values: Auto, True, False

# dxvk.disableNvLowLatency2 = Auto
# dxvk.enableNvLowLatency2 = Auto


# Override PCI vendor and device IDs reported to the application. Can
Expand Down
2 changes: 2 additions & 0 deletions include/native/windows/windows_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ typedef struct RGNDATA {
#define WAIT_OBJECT_0 0
#define WAIT_ABANDONED 0x00000080

#define INFINITE 0xffffffff

#define interface struct
#define MIDL_INTERFACE(x) struct

Expand Down
2 changes: 1 addition & 1 deletion include/vulkan
Submodule vulkan updated 65 files
+1 −0 .github/ISSUE_TEMPLATE/bug_report.md
+1 −0 .github/pull_request_template.md
+6 −6 .github/workflows/ci.yml
+0 −15 .reuse/dep5
+18 −0 CONTRIBUTING.md
+4 −3 LICENSE.md
+21 −0 REUSE.toml
+1 −1 include/vk_video/vulkan_video_codec_av1std.h
+1 −1 include/vk_video/vulkan_video_codec_av1std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_av1std_encode.h
+3 −1 include/vk_video/vulkan_video_codec_h264std.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_decode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_vp9std.h
+1 −1 include/vk_video/vulkan_video_codec_vp9std_decode.h
+1 −1 include/vk_video/vulkan_video_codecs_common.h
+1 −2 include/vulkan/vk_icd.h
+1 −2 include/vulkan/vk_layer.h
+1 −2 include/vulkan/vk_platform.h
+35 −10 include/vulkan/vulkan.cppm
+1 −2 include/vulkan/vulkan.h
+1,183 −100 include/vulkan/vulkan.hpp
+1 −1 include/vulkan/vulkan_android.h
+1 −1 include/vulkan/vulkan_beta.h
+958 −52 include/vulkan/vulkan_core.h
+1 −1 include/vulkan/vulkan_directfb.h
+603 −167 include/vulkan/vulkan_enums.hpp
+235 −51 include/vulkan/vulkan_extension_inspection.hpp
+0 −1 include/vulkan/vulkan_format_traits.hpp
+1 −1 include/vulkan/vulkan_fuchsia.h
+14,390 −3,791 include/vulkan/vulkan_funcs.hpp
+1 −1 include/vulkan/vulkan_ggp.h
+10,104 −12 include/vulkan/vulkan_handles.hpp
+718 −12 include/vulkan/vulkan_hash.hpp
+1 −2 include/vulkan/vulkan_hpp_macros.hpp
+1 −1 include/vulkan/vulkan_ios.h
+1 −1 include/vulkan/vulkan_macos.h
+1 −1 include/vulkan/vulkan_metal.h
+1 −1 include/vulkan/vulkan_ohos.h
+2,259 −1,679 include/vulkan/vulkan_raii.hpp
+1 −1 include/vulkan/vulkan_screen.h
+11 −1 include/vulkan/vulkan_shared.hpp
+371 −16 include/vulkan/vulkan_static_assertions.hpp
+6,550 −71 include/vulkan/vulkan_structs.hpp
+660 −121 include/vulkan/vulkan_to_string.hpp
+59 −0 include/vulkan/vulkan_ubm.h
+1 −1 include/vulkan/vulkan_vi.h
+8 −7 include/vulkan/vulkan_video.cppm
+333 −749 include/vulkan/vulkan_video.hpp
+1 −1 include/vulkan/vulkan_wayland.h
+1 −1 include/vulkan/vulkan_win32.h
+1 −1 include/vulkan/vulkan_xcb.h
+1 −1 include/vulkan/vulkan_xlib.h
+1 −1 include/vulkan/vulkan_xlib_xrandr.h
+24 −7 registry/base_generator.py
+303 −31 registry/profiles/VP_KHR_roadmap.json
+27 −18 registry/reg.py
+6,036 −4,215 registry/validusage.json
+2 −0 registry/video.xml
+14,711 −13,488 registry/vk.xml
+34 −0 registry/vulkan_object.py
+2 −2 tests/vk_hpp_module.cpp
9 changes: 9 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ if platform == 'windows'
'-Wl,--file-alignment=4096',
]

# Follow PE standards with 8 character name sections, some software that
# inspects our DLLs may otherwise crash. For dwarf2 symbols to work we
# need to keep the mingw defaults.
if not get_option('debug')
link_args += [
'-Wl,--disable-long-section-names',
]
endif

# Wine's built-in back traces only work with dwarf4 symbols
if get_option('debug')
compiler_args += [
Expand Down
6 changes: 6 additions & 0 deletions src/d3d11/d3d11_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace dxvk {
m_desc (*pDesc),
m_resource (this, pDevice),
m_d3d10 (this),
m_interop (this),
m_destructionNotifier(this) {
DxvkBufferCreateInfo info;
info.flags = 0;
Expand Down Expand Up @@ -158,6 +159,11 @@ namespace dxvk {
return S_OK;
}

if (riid == __uuidof(IDXGIVkInteropBuffer)) {
*ppvObject = ref(&m_interop);
return S_OK;
}

if (riid == __uuidof(ID3DDestructionNotifier)) {
*ppvObject = ref(&m_destructionNotifier);
return S_OK;
Expand Down
77 changes: 39 additions & 38 deletions src/d3d11/d3d11_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,44 @@ namespace dxvk {
uint32_t byteOffset;
};



/**
* \brief Interop interface for buffers
*/
class D3D11VkInteropBuffer : public IDXGIVkInteropBuffer {

public:

D3D11VkInteropBuffer(D3D11Buffer* pBuffer);

~D3D11VkInteropBuffer();

ULONG STDMETHODCALLTYPE AddRef();

ULONG STDMETHODCALLTYPE Release();

HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject);

HRESULT STDMETHODCALLTYPE GetDevice(
IDXGIVkInteropDevice** ppDevice);

HRESULT STDMETHODCALLTYPE GetVulkanBufferInfo(
VkDeviceAddress* pGpuAddress,
VkBuffer* pHandle,
VkDeviceSize* pOffset,
VkBufferCreateInfo* pInfo);

private:

D3D11Buffer* m_buffer = nullptr;

std::atomic<bool> m_locked = { false };

};


class D3D11Buffer : public D3D11DeviceChild<ID3D11Buffer> {
static constexpr VkDeviceSize BufferSliceAlignment = 64;
public:
Expand Down Expand Up @@ -199,6 +236,7 @@ namespace dxvk {

D3D11DXGIResource m_resource;
D3D10Buffer m_d3d10;
D3D11VkInteropBuffer m_interop;

D3DDestructionNotifier m_destructionNotifier;

Expand All @@ -216,43 +254,6 @@ namespace dxvk {
};


/**
* \brief Interop i
*/
class D3D11VkInteropBuffer : public IDXGIVkInteropBuffer {

public:

D3D11VkInteropBuffer(D3D11Buffer* pBuffer);

~D3D11VkInteropBuffer();

ULONG STDMETHODCALLTYPE AddRef();

ULONG STDMETHODCALLTYPE Release();

HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject);

HRESULT STDMETHODCALLTYPE GetDevice(
IDXGIVkInteropDevice** ppDevice);

HRESULT STDMETHODCALLTYPE GetVulkanBufferInfo(
VkDeviceAddress* pGpuAddress,
VkBuffer* pHandle,
VkDeviceSize* pOffset,
VkBufferCreateInfo* pInfo);

private:

D3D11Buffer* m_buffer = nullptr;

std::atomic<bool> m_locked = { false };

};


/**
* \brief Retrieves buffer from resource pointer
*
Expand Down
47 changes: 36 additions & 11 deletions src/d3d11/d3d11_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,25 @@ namespace dxvk {
if (!pResourceView || (NumRects && pRects))
return;

// ID3D11View has no methods to query the exact type of
// the view, so we'll have to check each possible class
auto dsv = dynamic_cast<D3D11DepthStencilView*>(pResourceView);
auto rtv = dynamic_cast<D3D11RenderTargetView*>(pResourceView);
auto uav = dynamic_cast<D3D11UnorderedAccessView*>(pResourceView);
// ID3D11View has no methods to query the exact type of the view,
// so we'll have to check each possible class. Query through COM
// rather than dynamic_cast: dynamic_cast relies on RTTI metadata
// stored just before the object's vtable, which third-party
// vtable-swapping hooks (e.g. overlay/injector DLLs that clone
// only the visible function-pointer table) do not preserve, even
// though they preserve the table itself well enough for ordinary
// virtual calls like QueryInterface to keep working correctly.
Com<ID3D11DepthStencilView> qiDsv;
Com<ID3D11RenderTargetView> qiRtv;
Com<ID3D11UnorderedAccessView> qiUav;

pResourceView->QueryInterface(IID_PPV_ARGS(&qiDsv));
pResourceView->QueryInterface(IID_PPV_ARGS(&qiRtv));
pResourceView->QueryInterface(IID_PPV_ARGS(&qiUav));

auto dsv = static_cast<D3D11DepthStencilView*>(qiDsv.ptr());
auto rtv = static_cast<D3D11RenderTargetView*>(qiRtv.ptr());
auto uav = static_cast<D3D11UnorderedAccessView*>(qiUav.ptr());

if (rtv && rtv->GetBufferView())
return;
Expand Down Expand Up @@ -725,12 +739,23 @@ namespace dxvk {

AddCost(GpuCostEstimate::Transfer);

// ID3D11View has no methods to query the exact type of
// the view, so we'll have to check each possible class
auto dsv = dynamic_cast<D3D11DepthStencilView*>(pView);
auto rtv = dynamic_cast<D3D11RenderTargetView*>(pView);
auto uav = dynamic_cast<D3D11UnorderedAccessView*>(pView);
auto vov = dynamic_cast<D3D11VideoProcessorOutputView*>(pView);
// ID3D11View has no methods to query the exact type of the view,
// so we'll have to check each possible class. Query through COM
// rather than dynamic_cast; see DiscardViewBase for why.
Com<ID3D11DepthStencilView> qiDsv;
Com<ID3D11RenderTargetView> qiRtv;
Com<ID3D11UnorderedAccessView> qiUav;
Com<ID3D11VideoProcessorOutputView> qiVov;

pView->QueryInterface(IID_PPV_ARGS(&qiDsv));
pView->QueryInterface(IID_PPV_ARGS(&qiRtv));
pView->QueryInterface(IID_PPV_ARGS(&qiUav));
pView->QueryInterface(IID_PPV_ARGS(&qiVov));

auto dsv = static_cast<D3D11DepthStencilView*>(qiDsv.ptr());
auto rtv = static_cast<D3D11RenderTargetView*>(qiRtv.ptr());
auto uav = static_cast<D3D11UnorderedAccessView*>(qiUav.ptr());
auto vov = static_cast<D3D11VideoProcessorOutputView*>(qiVov.ptr());

// Retrieve underlying resource view
if (dsv) {
Expand Down
Loading