From b2ad25755a7085ea9eac5f120ba4aa7a587e2ed5 Mon Sep 17 00:00:00 2001 From: Adam Jereczek Date: Wed, 28 Sep 2022 16:40:41 +0200 Subject: [PATCH] [d3d9] Fix for missing restriction check in ProcessVertices Co-authored-by: aroztkow --- src/d3d9/d3d9_device.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 536c6331a..3aa396482 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -2620,9 +2620,18 @@ namespace dxvk { DWORD Flags) { D3D9DeviceLock lock = LockDevice(); - if (unlikely(pDestBuffer == nullptr || pVertexDecl == nullptr)) + if (unlikely(pDestBuffer == nullptr)) return D3DERR_INVALIDCALL; + // When vertex shader 3.0 or above is set as the current vertex shader, + // the output vertex declaration must be present. + if (UseProgrammableVS()) { + const auto& programInfo = GetCommonShader(m_state.vertexShader)->GetInfo(); + + if (unlikely(programInfo.majorVersion() >= 3) && (pVertexDecl == nullptr)) + return D3DERR_INVALIDCALL; + } + if (!SupportsSWVP()) { static bool s_errorShown = false;