Prevent wasted call to WalkIndexBuffer when drawing indexed quadlists
This commit is contained in:
parent
f36cd0540a
commit
7851af5378
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue