mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Validate vertex declaration on draws
This commit is contained in:
parent
8c0003552c
commit
28a07ef445
@ -2369,11 +2369,14 @@ namespace dxvk {
|
|||||||
D3DPRIMITIVETYPE PrimitiveType,
|
D3DPRIMITIVETYPE PrimitiveType,
|
||||||
UINT StartVertex,
|
UINT StartVertex,
|
||||||
UINT PrimitiveCount) {
|
UINT PrimitiveCount) {
|
||||||
if (unlikely(!PrimitiveCount))
|
|
||||||
return S_OK;
|
|
||||||
|
|
||||||
D3D9DeviceLock lock = LockDevice();
|
D3D9DeviceLock lock = LockDevice();
|
||||||
|
|
||||||
|
if (unlikely(m_state.vertexDecl == nullptr))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
if (unlikely(!PrimitiveCount))
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType);
|
||||||
|
|
||||||
EmitCs([this,
|
EmitCs([this,
|
||||||
@ -2402,11 +2405,14 @@ namespace dxvk {
|
|||||||
UINT NumVertices,
|
UINT NumVertices,
|
||||||
UINT StartIndex,
|
UINT StartIndex,
|
||||||
UINT PrimitiveCount) {
|
UINT PrimitiveCount) {
|
||||||
if (unlikely(!PrimitiveCount))
|
|
||||||
return S_OK;
|
|
||||||
|
|
||||||
D3D9DeviceLock lock = LockDevice();
|
D3D9DeviceLock lock = LockDevice();
|
||||||
|
|
||||||
|
if (unlikely(m_state.vertexDecl == nullptr))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
if (unlikely(!PrimitiveCount))
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType);
|
||||||
|
|
||||||
EmitCs([this,
|
EmitCs([this,
|
||||||
@ -2435,11 +2441,14 @@ namespace dxvk {
|
|||||||
UINT PrimitiveCount,
|
UINT PrimitiveCount,
|
||||||
const void* pVertexStreamZeroData,
|
const void* pVertexStreamZeroData,
|
||||||
UINT VertexStreamZeroStride) {
|
UINT VertexStreamZeroStride) {
|
||||||
if (unlikely(!PrimitiveCount))
|
|
||||||
return S_OK;
|
|
||||||
|
|
||||||
D3D9DeviceLock lock = LockDevice();
|
D3D9DeviceLock lock = LockDevice();
|
||||||
|
|
||||||
|
if (unlikely(m_state.vertexDecl == nullptr))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
if (unlikely(!PrimitiveCount))
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType);
|
||||||
|
|
||||||
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
|
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
|
||||||
@ -2485,11 +2494,14 @@ namespace dxvk {
|
|||||||
D3DFORMAT IndexDataFormat,
|
D3DFORMAT IndexDataFormat,
|
||||||
const void* pVertexStreamZeroData,
|
const void* pVertexStreamZeroData,
|
||||||
UINT VertexStreamZeroStride) {
|
UINT VertexStreamZeroStride) {
|
||||||
if (unlikely(!PrimitiveCount))
|
|
||||||
return S_OK;
|
|
||||||
|
|
||||||
D3D9DeviceLock lock = LockDevice();
|
D3D9DeviceLock lock = LockDevice();
|
||||||
|
|
||||||
|
if (unlikely(m_state.vertexDecl == nullptr))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
|
if (unlikely(!PrimitiveCount))
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
PrepareDraw(PrimitiveType);
|
PrepareDraw(PrimitiveType);
|
||||||
|
|
||||||
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
|
auto drawInfo = GenerateDrawInfo(PrimitiveType, PrimitiveCount, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user