diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 607288dce..637915304 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -7058,11 +7058,6 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext) assert(IsValidCurrentShader()); CxbxUpdateActiveIndexBuffer(DrawContext.pIndexData, DrawContext.dwVertexCount); - - //Walk through index buffer - // Determine highest and lowest index in use : - INDEX16 LowIndex, HighIndex; - WalkIndexBuffer(LowIndex, HighIndex, &(DrawContext.pIndexData[DrawContext.dwStartVertex]), DrawContext.dwVertexCount); VertexBufferConverter.Apply(&DrawContext); if (DrawContext.XboxPrimitiveType == X_D3DPT_QUADLIST) { @@ -7076,6 +7071,7 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext) // Test-cases : XDK samples reaching this case are : DisplacementMap, Ripple // Test-case : XDK Samples (Billboard, BumpLens, DebugKeyboard, Gamepad, Lensflare, PerfTest?VolumeLight, PointSprites, Tiling, VolumeFog, VolumeSprites, etc) while (iNumVertices >= VERTICES_PER_QUAD) { + INDEX16 LowIndex, HighIndex; WalkIndexBuffer(LowIndex, HighIndex, &(DrawContext.pIndexData[uiStartIndex]), VERTICES_PER_QUAD); // Emulate a quad by drawing each as a fan of 2 triangles @@ -7095,6 +7091,11 @@ void XTL::CxbxDrawIndexed(CxbxDrawContext &DrawContext) } } else { + //Walk through index buffer + // Determine highest and lowest index in use : + INDEX16 LowIndex, HighIndex; + WalkIndexBuffer(LowIndex, HighIndex, &(DrawContext.pIndexData[DrawContext.dwStartVertex]), DrawContext.dwVertexCount); + // Primitives other than X_D3DPT_QUADLIST can be drawn using one DrawIndexedPrimitive call : HRESULT hRet = g_pD3DDevice->DrawIndexedPrimitive( EmuXB2PC_D3DPrimitiveType(DrawContext.XboxPrimitiveType),