1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[d3d9] Validate vertex declaration on draws

This commit is contained in:
Georg Lehmann 2021-07-25 15:12:25 +02:00 committed by Joshie
parent 8c0003552c
commit 28a07ef445

View File

@ -2369,11 +2369,14 @@ namespace dxvk {
D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex,
UINT PrimitiveCount) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice();
if (unlikely(m_state.vertexDecl == nullptr))
return D3DERR_INVALIDCALL;
if (unlikely(!PrimitiveCount))
return S_OK;
PrepareDraw(PrimitiveType);
EmitCs([this,
@ -2402,11 +2405,14 @@ namespace dxvk {
UINT NumVertices,
UINT StartIndex,
UINT PrimitiveCount) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice();
if (unlikely(m_state.vertexDecl == nullptr))
return D3DERR_INVALIDCALL;
if (unlikely(!PrimitiveCount))
return S_OK;
PrepareDraw(PrimitiveType);
EmitCs([this,
@ -2435,11 +2441,14 @@ namespace dxvk {
UINT PrimitiveCount,
const void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice();
if (unlikely(m_state.vertexDecl == nullptr))
return D3DERR_INVALIDCALL;
if (unlikely(!PrimitiveCount))
return S_OK;
PrepareDraw(PrimitiveType);
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
@ -2485,11 +2494,14 @@ namespace dxvk {
D3DFORMAT IndexDataFormat,
const void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice();
if (unlikely(m_state.vertexDecl == nullptr))
return D3DERR_INVALIDCALL;
if (unlikely(!PrimitiveCount))
return S_OK;
PrepareDraw(PrimitiveType);
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);