Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
02346f5
[d3d9] validate AdapterFormat and buffer RTypes in CheckDeviceFormat
pythonlover02 Jul 15, 2026
4155fdc
[d3d9] require both color and depth sample count support for MSAA
pythonlover02 Jul 15, 2026
ed39f44
[d3d9] dont request DEVICE_LOCAL for cached dynamic buffers
pythonlover02 Jul 15, 2026
1bf6f31
[d3d9] validate pool and usage flags in ValidateBufferProperties
pythonlover02 Jul 15, 2026
24327a0
[d3d9] use ShouldRecord in BeginStateBlock
pythonlover02 Jul 15, 2026
c2c4401
[d3d9] initialize return pointer before validation in EndStateBlock
pythonlover02 Jul 15, 2026
4bc9fd9
[d3d9] dirty alpha test state when rebinding RT0
pythonlover02 Jul 15, 2026
ee807d5
[d3d9] MultiplyTransform is applied immediately, never recorded
pythonlover02 Jul 15, 2026
736476d
[d3d9] don't mark all subresources for readback on mipgen
pythonlover02 Jul 15, 2026
7317e4a
[d3d9] skip CS chunk flush if sequence number already reached
pythonlover02 Jul 15, 2026
83b4d11
[d3d9] drop implicit flush in UnlockBuffer
pythonlover02 Jul 15, 2026
b156bf6
[d3d9] log GDI DC creation failure in Surface::GetDC
pythonlover02 Jul 15, 2026
9dc52c5
[d3d9] handle destroyed back buffers in GetBackBuffer
pythonlover02 Jul 15, 2026
843de2b
[d3d9] initialize out parameter in GetLastPresentCount stub
pythonlover02 Jul 15, 2026
8d8194c
[d3d9] expose RGBA8 fallback for ARGB back buffer formats
pythonlover02 Jul 15, 2026
6640609
[d3d9] lock device in UserDefinedAnnotation::BeginEvent
pythonlover02 Jul 15, 2026
2544d66
[d3d9] lock device in UserDefinedAnnotation::EndEvent
pythonlover02 Jul 15, 2026
748ca93
[d3d9] lock device in UserDefinedAnnotation::SetMarker
pythonlover02 Jul 15, 2026
6f9b3c7
[d3d9] pick stencil-aware D24S8 fallback format
pythonlover02 Jul 15, 2026
e797a49
[d3d9] validate box and clear output in Volume::LockBox
pythonlover02 Jul 15, 2026
f497970
[d3d11] return DEVICE_LOCAL only for tiled buffers
pythonlover02 Jul 15, 2026
2b64cd3
[d3d11] don't request DEVICE_LOCAL for cached dynamic resources
pythonlover02 Jul 15, 2026
a845984
[d3d11] reject SO geometry shaders without transform feedback support
pythonlover02 Jul 15, 2026
31483cf
[d3d11] reject tiled 1D textures
pythonlover02 Jul 15, 2026
d4cdee9
[d3d11] null-check out pointer in DXGISurface::GetResource
pythonlover02 Jul 15, 2026
390001d
[d3d11] fix DXGI map flag decoding in DXGISurface::Map
pythonlover02 Jul 15, 2026
c47f47b
[d3d11] null-safe DXGISurface::isSurfaceCompatible
pythonlover02 Jul 15, 2026
904aa6b
[d3d11] support null event in Fence::SetEventOnCompletion
pythonlover02 Jul 15, 2026
5c40523
[d3d11] skip initialization of tiled buffers
pythonlover02 Jul 15, 2026
0f801f8
[d3d11] validate resource in ReadFromSubresource
pythonlover02 Jul 15, 2026
dc03cbb
[d3d11] validate resource in WriteToSubresource
pythonlover02 Jul 15, 2026
28de125
[dxbc] throw on invalid shader stage in emitInit
pythonlover02 Jul 15, 2026
d926005
[dxbc] decode EvalSnapped offset as 4-bit fixed point
pythonlover02 Jul 15, 2026
6ae931b
[dxbc] only emit fused mad when instruction is precise
pythonlover02 Jul 15, 2026
36aa7df
[dxbc] emit dot products with a defined operation order
pythonlover02 Jul 15, 2026
885d48a
[dxbc] report one LOD for multisampled images in emitQueryTextureLods
pythonlover02 Jul 15, 2026
ed2c734
[dxbc] return zero size for out-of-bounds resinfo mip levels
pythonlover02 Jul 15, 2026
6f11f2e
[dxbc] use NClamp for hull shader tess factors
pythonlover02 Jul 15, 2026
6c9f60a
[dxbc] use NClamp for output depth clamp
pythonlover02 Jul 15, 2026
9dcdeae
[dxso] read usedRTs after finalize to catch SM1 color output
pythonlover02 Jul 15, 2026
a130470
[dxvk] use TOP_OF_PIPE instead of 0 for image discard barrier
pythonlover02 Jul 15, 2026
bf1d08b
[dxvk] dont query queues for ignored queue families
pythonlover02 Jul 15, 2026
2194644
[dxvk] apply CPU device filter independently of device name filter
pythonlover02 Jul 15, 2026
d1e0f16
[dxvk] skip disabled extensions in toNameList
pythonlover02 Jul 15, 2026
82fa705
[dxvk] free undersized memory chunks
pythonlover02 Jul 15, 2026
61127c3
[dxvk] bump default chunk size to 256 MiB
pythonlover02 Jul 15, 2026
59140dc
[dxgi] lock buffer in SetSourceSize
pythonlover02 Jul 15, 2026
dc7f7aa
[dxgi] forward GetFrameStatistics to the fullscreen swap chain
pythonlover02 Jul 15, 2026
1bc8d1a
[util] guard wine log output behind _WIN32 in emitMsg
pythonlover02 Jul 15, 2026
a84a907
[util] guard wine log output behind _WIN32 in getFileName
pythonlover02 Jul 15, 2026
f3c61ba
[vulkan] null out surface handle after destruction
pythonlover02 Jul 15, 2026
0c06ab3
[spirv] forward newVar to newVarInit
pythonlover02 Jul 15, 2026
aed15e8
[spirv] handle null initializer in newVarInit
pythonlover02 Jul 15, 2026
c177a37
[dxvk] match upstream. do dynamic chunk sizing, smarter dedicated all…
pythonlover02 Jun 29, 2026
fa39034
[readme, config] remove duplicate and document frame pacing / low lat…
pythonlover02 Jul 15, 2026
761d9ef
[dxvk] add DxvkMemoryChunk::size accessor for undersized chunk check
pythonlover02 Jul 15, 2026
66d4827
[d3d11] revert null-event handling in Fence::SetEventOnCompletion
pythonlover02 Jul 15, 2026
7276fff
[d3d9] fix CheckDeviceFormat validation applied to wrong function
pythonlover02 Jul 15, 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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ A huge thank-you to the following contributors for their invaluable help:
- [Shader Compilation (dyasync)](#shader-compilation-dyasync)
- [Frame Pacing (low-latency mode)](#frame-pacing-low-latency-mode)
- [Debugging](#debugging)
- [Debugging](#debugging)
- [Troubleshooting](#troubleshooting)

## Proton-Sarek: discontinued
Expand Down
39 changes: 38 additions & 1 deletion dxvk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,44 @@
# dxvk.numDyasyncThreads = 0


# Frame Pacing
#
# Controls how DXVK-Sarek paces CPU frame submission relative to
# GPU completion. Adapted from netborg-afps/dxvk-low-latency, with
# the mechanism reworked around what Sarek's Vulkan 1.1/1.2 presenter
# can actually observe (no per-submission GPU timing telemetry).
#
# Supported values:
# - max-frame-latency: Default. Sarek's existing, unchanged behaviour.
# Frame i won't start until frame (i-1)-x has finished, where x is
# dxgi.maxFrameLatency / d3d9.maxFrameLatency.
# - low-latency: Forces the effective frame latency down to the minimum
# needed for forward progress, and uses a best-effort prediction of
# when the previous frame will finish (rolling average of recent
# frame durations) to reduce CPU wake-up jitter. A wrong prediction
# costs microseconds, never a broken frame.
# - min-latency: Same minimal frame latency without the predictive
# sleep. Lowest possible latency, usually at a noticeable fps cost.
#
# Note: because the presenter lacks per-submission GPU progress
# telemetry, low-latency and min-latency currently share the same
# underlying latency-reduction mechanism. There is no VRR-aware pacing
# mode and no HUD latency display yet.

# dxvk.framePace = "max-frame-latency"


# Low latency offset
#
# Fine-tunes low-latency mode: positive values (in microseconds) delay
# a frame's predicted start slightly, negative values start it earlier.
# Only takes effect when dxvk.framePace = "low-latency".
#
# Supported values: -10000 to 10000

# dxvk.lowLatencyOffset = 0


# Toggles raw SSBO usage.
#
# Uses storage buffers to implement raw and structured buffer
Expand Down Expand Up @@ -1022,4 +1060,3 @@
# - True/False

# ddraw.legacyDeviceNames = False

72 changes: 38 additions & 34 deletions src/d3d11/d3d11_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../dxvk/dxvk_data.h"

namespace dxvk {

D3D11Buffer::D3D11Buffer(
D3D11Device* pDevice,
const D3D11_BUFFER_DESC* pDesc)
Expand All @@ -20,19 +20,19 @@ namespace dxvk {
info.stages = VK_PIPELINE_STAGE_TRANSFER_BIT;
info.access = VK_ACCESS_TRANSFER_READ_BIT
| VK_ACCESS_TRANSFER_WRITE_BIT;

if (pDesc->BindFlags & D3D11_BIND_VERTEX_BUFFER) {
info.usage |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
info.stages |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;
info.access |= VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT;
}

if (pDesc->BindFlags & D3D11_BIND_INDEX_BUFFER) {
info.usage |= VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
info.stages |= VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;
info.access |= VK_ACCESS_INDEX_READ_BIT;
}

if (pDesc->BindFlags & D3D11_BIND_CONSTANT_BUFFER) {
info.usage |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
info.stages |= m_parent->GetEnabledShaderStages();
Expand All @@ -41,28 +41,28 @@ namespace dxvk {
if (m_parent->GetOptions()->constantBufferRangeCheck)
info.usage |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
}

if (pDesc->BindFlags & D3D11_BIND_SHADER_RESOURCE) {
info.usage |= VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
| VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
info.stages |= m_parent->GetEnabledShaderStages();
info.access |= VK_ACCESS_SHADER_READ_BIT;
}

if (pDesc->BindFlags & D3D11_BIND_STREAM_OUTPUT) {
info.usage |= VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT;
info.stages |= VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT;
info.access |= VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT;
}

if (pDesc->BindFlags & D3D11_BIND_UNORDERED_ACCESS) {
info.usage |= VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
| VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
info.stages |= m_parent->GetEnabledShaderStages();
info.access |= VK_ACCESS_SHADER_READ_BIT
| VK_ACCESS_SHADER_WRITE_BIT;
}

if (pDesc->MiscFlags & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS) {
info.usage |= VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
info.stages |= VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT;
Expand All @@ -80,27 +80,27 @@ namespace dxvk {
if (pDesc->BindFlags & D3D11_BIND_STREAM_OUTPUT)
m_soCounter = CreateSoCounterBuffer();
}


D3D11Buffer::~D3D11Buffer() {

}


HRESULT STDMETHODCALLTYPE D3D11Buffer::QueryInterface(REFIID riid, void** ppvObject) {
if (ppvObject == nullptr)
return E_POINTER;

*ppvObject = nullptr;

if (riid == __uuidof(IUnknown)
|| riid == __uuidof(ID3D11DeviceChild)
|| riid == __uuidof(ID3D11Resource)
|| riid == __uuidof(ID3D11Buffer)) {
*ppvObject = ref(this);
return S_OK;
}

if (riid == __uuidof(ID3D10DeviceChild)
|| riid == __uuidof(ID3D10Resource)
|| riid == __uuidof(ID3D10Buffer)) {
Expand All @@ -115,36 +115,36 @@ namespace dxvk {
*ppvObject = ref(&m_resource);
return S_OK;
}

Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query");
Logger::warn(str::format(riid));
return E_NOINTERFACE;
}


UINT STDMETHODCALLTYPE D3D11Buffer::GetEvictionPriority() {
return DXGI_RESOURCE_PRIORITY_NORMAL;
}


void STDMETHODCALLTYPE D3D11Buffer::SetEvictionPriority(UINT EvictionPriority) {
static bool s_errorShown = false;

if (!std::exchange(s_errorShown, true))
Logger::warn("D3D11Buffer::SetEvictionPriority: Stub");
}


void STDMETHODCALLTYPE D3D11Buffer::GetType(D3D11_RESOURCE_DIMENSION* pResourceDimension) {
*pResourceDimension = D3D11_RESOURCE_DIMENSION_BUFFER;
}


void STDMETHODCALLTYPE D3D11Buffer::GetDesc(D3D11_BUFFER_DESC* pDesc) {
*pDesc = m_desc;
}


bool D3D11Buffer::CheckViewCompatibility(
UINT BindFlags,
DXGI_FORMAT Format) const {
Expand Down Expand Up @@ -173,7 +173,7 @@ namespace dxvk {
// We don't support tiled resources
if (pDesc->MiscFlags & (D3D11_RESOURCE_MISC_TILE_POOL | D3D11_RESOURCE_MISC_TILED))
return E_INVALIDARG;

// Constant buffer size must be a multiple of 16
if ((pDesc->BindFlags & D3D11_BIND_CONSTANT_BUFFER)
&& (pDesc->ByteWidth & 0xF))
Expand All @@ -185,7 +185,7 @@ namespace dxvk {
|| (pDesc->StructureByteStride == 0)
|| (pDesc->StructureByteStride & 0x3)))
return E_INVALIDARG;

// Basic validation for raw buffers
if ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS)
&& (!(pDesc->BindFlags & (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS))))
Expand All @@ -194,10 +194,10 @@ namespace dxvk {
// Mip generation obviously doesn't work for buffers
if (pDesc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS)
return E_INVALIDARG;

if (!(pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_STRUCTURED))
pDesc->StructureByteStride = 0;

return S_OK;
}

Expand All @@ -212,7 +212,10 @@ namespace dxvk {

VkMemoryPropertyFlags D3D11Buffer::GetMemoryFlags() const {
VkMemoryPropertyFlags memoryFlags = 0;


if (m_desc.MiscFlags & (D3D11_RESOURCE_MISC_TILE_POOL | D3D11_RESOURCE_MISC_TILED))
return VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;

switch (m_desc.Usage) {
case D3D11_USAGE_IMMUTABLE:
memoryFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
Expand All @@ -231,26 +234,27 @@ namespace dxvk {
memoryFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
}
break;

case D3D11_USAGE_DYNAMIC:
memoryFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;

if (m_desc.BindFlags)
memoryFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
break;

case D3D11_USAGE_STAGING:
memoryFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
break;
}

bool useCached = (m_parent->GetOptions()->cachedDynamicResources == ~0u)
|| (m_parent->GetOptions()->cachedDynamicResources & m_desc.BindFlags);

if ((memoryFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && useCached) {
memoryFlags &= ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
memoryFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
}
Expand Down Expand Up @@ -285,7 +289,7 @@ namespace dxvk {
? D3D11_COMMON_BUFFER_MAP_MODE_DIRECT
: D3D11_COMMON_BUFFER_MAP_MODE_NONE;
}


D3D11Buffer* GetCommonBuffer(ID3D11Resource* pResource) {
D3D11_RESOURCE_DIMENSION dimension = D3D11_RESOURCE_DIMENSION_UNKNOWN;
Expand Down
38 changes: 38 additions & 0 deletions src/d3d11/d3d11_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ namespace dxvk {
if (FAILED(hr))
return hr;

if (desc.MiscFlags & D3D11_RESOURCE_MISC_TILED)
return E_INVALIDARG;

if (!ppTexture1D)
return S_FALSE;

Expand Down Expand Up @@ -816,6 +819,8 @@ namespace dxvk {
InitReturnPtr(ppGeometryShader);
D3D11CommonShader module;

if (!m_dxvkDevice->features().extTransformFeedback.transformFeedback)
return DXGI_ERROR_INVALID_CALL;

// Zero-init some counterss so that we can increment
// them while walking over the stream output entries
Expand Down Expand Up @@ -1381,6 +1386,22 @@ namespace dxvk {
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox) {
auto texture = GetCommonTexture(pSrcResource);

if (!texture)
return;

if (texture->Desc()->Usage != D3D11_USAGE_DEFAULT
|| texture->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_NONE
|| texture->CountSubresources() <= SrcSubresource)
return;

uint32_t map = texture->GetMapType(SrcSubresource);

if (map != uint32_t(D3D11_MAP_READ)
&& map != uint32_t(D3D11_MAP_READ_WRITE))
return;

CopySubresourceData(
pDstData, DstRowPitch, DstDepthPitch,
pSrcResource, SrcSubresource, pSrcBox);
Expand All @@ -1394,6 +1415,23 @@ namespace dxvk {
const void* pSrcData,
UINT SrcRowPitch,
UINT SrcDepthPitch) {
auto texture = GetCommonTexture(pDstResource);

if (!texture)
return;

if (texture->Desc()->Usage != D3D11_USAGE_DEFAULT
|| texture->GetMapMode() == D3D11_COMMON_TEXTURE_MAP_MODE_NONE
|| texture->CountSubresources() <= DstSubresource)
return;

uint32_t map = texture->GetMapType(DstSubresource);

if (map != uint32_t(D3D11_MAP_WRITE)
&& map != uint32_t(D3D11_MAP_WRITE_NO_OVERWRITE)
&& map != uint32_t(D3D11_MAP_READ_WRITE))
return;

CopySubresourceData(
pSrcData, SrcRowPitch, SrcRowPitch,
pDstResource, DstSubresource, pDstBox);
Expand Down
6 changes: 3 additions & 3 deletions src/d3d11/d3d11_fence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "d3d11_device.h"

namespace dxvk {

D3D11Fence::D3D11Fence(
D3D11Device* pDevice,
UINT64 InitialValue,
Expand Down Expand Up @@ -39,7 +39,7 @@ namespace dxvk {
return E_POINTER;

*ppvObject = nullptr;

if (riid == __uuidof(IUnknown)
|| riid == __uuidof(ID3D11DeviceChild)
|| riid == __uuidof(ID3D11Fence)) {
Expand Down Expand Up @@ -97,5 +97,5 @@ namespace dxvk {

return m_fence->getValue();
}

}
Loading
Loading