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;