Some code cleaning for my last commit.

the amount and size of the buffer is now changed to "new hardware" frienly values and will fall back to the right values if hardware does not support them.
my next commit will be to a branch, with my ogl work.
This commit is contained in:
rodolfoosvaldobogado 2012-10-22 19:37:26 -03:00
parent f7edfc0118
commit 72cb1734ee
5 changed files with 135 additions and 173 deletions

View File

@ -39,31 +39,24 @@ namespace DX11
{ {
// TODO: Find sensible values for these two // TODO: Find sensible values for these two
const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 12; const UINT IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16 * sizeof(u16);
const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 8; const UINT VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16;
const UINT MAXVBUFFER_COUNT = 4; const UINT MAXVBUFFER_COUNT = 2;
void VertexManager::CreateDeviceObjects() void VertexManager::CreateDeviceObjects()
{ {
D3D11_BUFFER_DESC bufdesc = CD3D11_BUFFER_DESC(IBUFFER_SIZE, D3D11_BUFFER_DESC bufdesc = CD3D11_BUFFER_DESC(IBUFFER_SIZE,
D3D11_BIND_INDEX_BUFFER, D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE); D3D11_BIND_INDEX_BUFFER, D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE);
m_indexBufferCursor = 0;
m_vertexBufferCursor = 0;
m_vertexDrawOffset = 0; m_vertexDrawOffset = 0;
m_triangleDrawIndex = 0; m_triangleDrawIndex = 0;
m_lineDrawIndex = 0; m_lineDrawIndex = 0;
m_pointDrawIndex = 0; m_pointDrawIndex = 0;
m_indexBuffers = new PID3D11Buffer[MAXVBUFFER_COUNT]; m_indexBuffers = new PID3D11Buffer[MAXVBUFFER_COUNT];
m_vertexBuffers = new PID3D11Buffer[MAXVBUFFER_COUNT]; m_vertexBuffers = new PID3D11Buffer[MAXVBUFFER_COUNT];
bool Fail = false;
for (m_activeVertexBuffer = 0; m_activeVertexBuffer < MAXVBUFFER_COUNT; m_activeVertexBuffer++)
{
m_indexBuffers[m_activeVertexBuffer] = NULL;
m_vertexBuffers[m_activeVertexBuffer] = NULL;
}
for (m_activeIndexBuffer = 0; m_activeIndexBuffer < MAXVBUFFER_COUNT; m_activeIndexBuffer++) for (m_activeIndexBuffer = 0; m_activeIndexBuffer < MAXVBUFFER_COUNT; m_activeIndexBuffer++)
{ {
m_indexBuffers[m_activeIndexBuffer] = NULL;
CHECK(SUCCEEDED(D3D::device->CreateBuffer(&bufdesc, NULL, &m_indexBuffers[m_activeIndexBuffer])), CHECK(SUCCEEDED(D3D::device->CreateBuffer(&bufdesc, NULL, &m_indexBuffers[m_activeIndexBuffer])),
"Failed to create index buffer."); "Failed to create index buffer.");
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_indexBuffers[m_activeIndexBuffer], "index buffer of VertexManager"); D3D::SetDebugObjectName((ID3D11DeviceChild*)m_indexBuffers[m_activeIndexBuffer], "index buffer of VertexManager");
@ -72,15 +65,15 @@ void VertexManager::CreateDeviceObjects()
bufdesc.ByteWidth = VBUFFER_SIZE; bufdesc.ByteWidth = VBUFFER_SIZE;
for (m_activeVertexBuffer = 0; m_activeVertexBuffer < MAXVBUFFER_COUNT; m_activeVertexBuffer++) for (m_activeVertexBuffer = 0; m_activeVertexBuffer < MAXVBUFFER_COUNT; m_activeVertexBuffer++)
{ {
m_vertexBuffers[m_activeVertexBuffer] = NULL;
CHECK(SUCCEEDED(D3D::device->CreateBuffer(&bufdesc, NULL, &m_vertexBuffers[m_activeVertexBuffer])), CHECK(SUCCEEDED(D3D::device->CreateBuffer(&bufdesc, NULL, &m_vertexBuffers[m_activeVertexBuffer])),
"Failed to create vertex buffer."); "Failed to create vertex buffer.");
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_vertexBuffers[m_activeVertexBuffer], "Vertex buffer of VertexManager"); D3D::SetDebugObjectName((ID3D11DeviceChild*)m_vertexBuffers[m_activeVertexBuffer], "Vertex buffer of VertexManager");
} }
m_activeVertexBuffer = 0; m_activeVertexBuffer = 0;
m_activeIndexBuffer = 0; m_activeIndexBuffer = 0;
m_LastVertexBuffer = MAXVBUFFER_COUNT; m_indexBufferCursor = IBUFFER_SIZE;
m_LastIndexBuffer = MAXVBUFFER_COUNT; m_vertexBufferCursor = VBUFFER_SIZE;
m_lineShader.Init(); m_lineShader.Init();
m_pointShader.Init(); m_pointShader.Init();
} }
@ -113,7 +106,7 @@ void VertexManager::LoadBuffers()
UINT vSize = UINT(s_pCurBufferPointer - LocalVBuffer); UINT vSize = UINT(s_pCurBufferPointer - LocalVBuffer);
D3D11_MAP MapType = D3D11_MAP_WRITE_NO_OVERWRITE; D3D11_MAP MapType = D3D11_MAP_WRITE_NO_OVERWRITE;
if (m_vertexBufferCursor + vSize >= VBUFFER_SIZE || m_activeVertexBuffer != m_LastVertexBuffer) if (m_vertexBufferCursor + vSize >= VBUFFER_SIZE)
{ {
// Wrap around // Wrap around
m_activeVertexBuffer = (m_activeVertexBuffer + 1) % MAXVBUFFER_COUNT; m_activeVertexBuffer = (m_activeVertexBuffer + 1) % MAXVBUFFER_COUNT;
@ -131,7 +124,7 @@ void VertexManager::LoadBuffers()
UINT iCount = IndexGenerator::GetTriangleindexLen() + UINT iCount = IndexGenerator::GetTriangleindexLen() +
IndexGenerator::GetLineindexLen() + IndexGenerator::GetPointindexLen(); IndexGenerator::GetLineindexLen() + IndexGenerator::GetPointindexLen();
MapType = D3D11_MAP_WRITE_NO_OVERWRITE; MapType = D3D11_MAP_WRITE_NO_OVERWRITE;
if (m_indexBufferCursor + iCount >= IBUFFER_SIZE/2 || m_activeIndexBuffer != m_LastIndexBuffer) if (m_indexBufferCursor + iCount >= (IBUFFER_SIZE / sizeof(u16)))
{ {
// Wrap around // Wrap around
m_activeIndexBuffer = (m_activeIndexBuffer + 1) % MAXVBUFFER_COUNT; m_activeIndexBuffer = (m_activeIndexBuffer + 1) % MAXVBUFFER_COUNT;
@ -143,9 +136,9 @@ void VertexManager::LoadBuffers()
m_triangleDrawIndex = m_indexBufferCursor; m_triangleDrawIndex = m_indexBufferCursor;
m_lineDrawIndex = m_triangleDrawIndex + IndexGenerator::GetTriangleindexLen(); m_lineDrawIndex = m_triangleDrawIndex + IndexGenerator::GetTriangleindexLen();
m_pointDrawIndex = m_lineDrawIndex + IndexGenerator::GetLineindexLen(); m_pointDrawIndex = m_lineDrawIndex + IndexGenerator::GetLineindexLen();
memcpy((u16*)map.pData + m_triangleDrawIndex, TIBuffer, 2*IndexGenerator::GetTriangleindexLen()); memcpy((u16*)map.pData + m_triangleDrawIndex, TIBuffer, sizeof(u16) * IndexGenerator::GetTriangleindexLen());
memcpy((u16*)map.pData + m_lineDrawIndex, LIBuffer, 2*IndexGenerator::GetLineindexLen()); memcpy((u16*)map.pData + m_lineDrawIndex, LIBuffer, sizeof(u16) * IndexGenerator::GetLineindexLen());
memcpy((u16*)map.pData + m_pointDrawIndex, PIBuffer, 2*IndexGenerator::GetPointindexLen()); memcpy((u16*)map.pData + m_pointDrawIndex, PIBuffer, sizeof(u16) * IndexGenerator::GetPointindexLen());
D3D::context->Unmap(m_indexBuffers[m_activeIndexBuffer], 0); D3D::context->Unmap(m_indexBuffers[m_activeIndexBuffer], 0);
m_indexBufferCursor += iCount; m_indexBufferCursor += iCount;
} }
@ -158,8 +151,6 @@ void VertexManager::Draw(UINT stride)
{ {
D3D::context->IASetVertexBuffers(0, 1, &m_vertexBuffers[m_activeVertexBuffer], &stride, &m_vertexDrawOffset); D3D::context->IASetVertexBuffers(0, 1, &m_vertexBuffers[m_activeVertexBuffer], &stride, &m_vertexDrawOffset);
D3D::context->IASetIndexBuffer(m_indexBuffers[m_activeIndexBuffer], DXGI_FORMAT_R16_UINT, 0); D3D::context->IASetIndexBuffer(m_indexBuffers[m_activeIndexBuffer], DXGI_FORMAT_R16_UINT, 0);
m_LastIndexBuffer = m_activeIndexBuffer;
m_LastVertexBuffer = m_activeVertexBuffer;
if (IndexGenerator::GetNumTriangles() > 0) if (IndexGenerator::GetNumTriangles() > 0)
{ {

View File

@ -50,8 +50,6 @@ private:
UINT m_pointDrawIndex; UINT m_pointDrawIndex;
UINT m_activeVertexBuffer; UINT m_activeVertexBuffer;
UINT m_activeIndexBuffer; UINT m_activeIndexBuffer;
UINT m_LastVertexBuffer;
UINT m_LastIndexBuffer;
typedef ID3D11Buffer* PID3D11Buffer; typedef ID3D11Buffer* PID3D11Buffer;
PID3D11Buffer* m_indexBuffers; PID3D11Buffer* m_indexBuffers;
PID3D11Buffer* m_vertexBuffers; PID3D11Buffer* m_vertexBuffers;

View File

@ -1202,7 +1202,9 @@ void Renderer::ApplyState(bool bUseDstAlpha)
D3D::ChangeRenderState(D3DRS_ALPHABLENDENABLE, false); D3D::ChangeRenderState(D3DRS_ALPHABLENDENABLE, false);
if(bpmem.zmode.testenable && bpmem.zmode.updateenable) if(bpmem.zmode.testenable && bpmem.zmode.updateenable)
{ {
D3D::ChangeRenderState(D3DRS_ZENABLE, TRUE); //This is needed to draw to the correct pixels in multi-pass algorithms
//this avoid z-figthing and grants that you write to the same pixels
//affected by the last pass
D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, false); D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, false);
D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL); D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL);
} }
@ -1215,7 +1217,6 @@ void Renderer::RestoreState()
D3D::RefreshRenderState(D3DRS_ALPHABLENDENABLE); D3D::RefreshRenderState(D3DRS_ALPHABLENDENABLE);
if(bpmem.zmode.testenable && bpmem.zmode.updateenable) if(bpmem.zmode.testenable && bpmem.zmode.updateenable)
{ {
D3D::RefreshRenderState(D3DRS_ZENABLE);
D3D::RefreshRenderState(D3DRS_ZWRITEENABLE); D3D::RefreshRenderState(D3DRS_ZWRITEENABLE);
D3D::RefreshRenderState(D3DRS_ZFUNC); D3D::RefreshRenderState(D3DRS_ZFUNC);
} }

View File

@ -41,6 +41,10 @@
extern NativeVertexFormat *g_nativeVertexFmt; extern NativeVertexFormat *g_nativeVertexFmt;
namespace DX9 namespace DX9
{ {
//This are the initially requeted size for the buffers expresed in elements
const u32 IBUFFER_SIZE = VertexManager::MAXIBUFFERSIZE * 16;
const u32 VBUFFER_SIZE = VertexManager::MAXVBUFFERSIZE * 16;
const u32 MAXVBUFFER_COUNT = 2;
inline void DumpBadShaders() inline void DumpBadShaders()
{ {
@ -64,37 +68,26 @@ inline void DumpBadShaders()
void VertexManager::CreateDeviceObjects() void VertexManager::CreateDeviceObjects()
{ {
NumVBuffers = 0; NumVBuffers = 0;
CurrentIBufferIndex = 0; VBuffers = NULL;
CurrentVBufferIndex = 0; IBuffers = NULL;
CurrentVBufferSize = 8 * MAXVBUFFERSIZE;
CurrentIBufferSize = 12 * MAXIBUFFERSIZE;
D3DCAPS9 DeviceCaps = D3D::GetCaps(); D3DCAPS9 DeviceCaps = D3D::GetCaps();
int maxdevicevbuffersize = DeviceCaps.MaxPrimitiveCount * 3 * DeviceCaps.MaxStreamStride; u32 devicevMaxBufferSize = DeviceCaps.MaxPrimitiveCount * 3 * DeviceCaps.MaxStreamStride;
if (CurrentVBufferSize > maxdevicevbuffersize) //Calculate Device Dependant size
{ CurrentVBufferSize = (VBUFFER_SIZE > devicevMaxBufferSize) ? devicevMaxBufferSize : VBUFFER_SIZE;
CurrentVBufferSize = maxdevicevbuffersize; CurrentIBufferSize = (IBUFFER_SIZE > DeviceCaps.MaxVertexIndex) ? DeviceCaps.MaxVertexIndex : IBUFFER_SIZE;
} //if device caps are not enough for Vbuffer fall back to vertex arrays
if (CurrentIBufferSize > DeviceCaps.MaxVertexIndex) if (CurrentIBufferSize < MAXIBUFFERSIZE || CurrentVBufferSize < MAXVBUFFERSIZE) return;
{
CurrentIBufferSize = DeviceCaps.MaxVertexIndex; VBuffers = new LPDIRECT3DVERTEXBUFFER9[MAXVBUFFER_COUNT];
} IBuffers = new LPDIRECT3DINDEXBUFFER9[MAXVBUFFER_COUNT];
if (CurrentIBufferSize < MAXIBUFFERSIZE)
{
return;
}
if (CurrentVBufferSize < MAXVBUFFERSIZE)
{
return;
}
VBuffers = new LPDIRECT3DVERTEXBUFFER9[MAX_VBufferCount];
IBuffers = new LPDIRECT3DINDEXBUFFER9[MAX_VBufferCount];
bool Fail = false; bool Fail = false;
for (CurrentVBuffer = 0; CurrentVBuffer < MAX_VBufferCount; CurrentVBuffer++) for (CurrentVBuffer = 0; CurrentVBuffer < MAXVBUFFER_COUNT; CurrentVBuffer++)
{ {
VBuffers[CurrentVBuffer] = NULL; VBuffers[CurrentVBuffer] = NULL;
IBuffers[CurrentVBuffer] = NULL; IBuffers[CurrentVBuffer] = NULL;
} }
for (CurrentVBuffer = 0; CurrentVBuffer < MAX_VBufferCount; CurrentVBuffer++) for (CurrentVBuffer = 0; CurrentVBuffer < MAXVBUFFER_COUNT; CurrentVBuffer++)
{ {
if(FAILED( D3D::dev->CreateVertexBuffer( CurrentVBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &VBuffers[CurrentVBuffer], NULL ) ) ) if(FAILED( D3D::dev->CreateVertexBuffer( CurrentVBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &VBuffers[CurrentVBuffer], NULL ) ) )
{ {
@ -110,24 +103,25 @@ void VertexManager::CreateDeviceObjects()
NumVBuffers = CurrentVBuffer; NumVBuffers = CurrentVBuffer;
CurrentVBuffer = 0; CurrentVBuffer = 0;
CurrentIBuffer = 0; CurrentIBuffer = 0;
LastVBuffer = NumVBuffers; CurrentIBufferIndex = CurrentIBufferSize;
LastIBuffer = NumVBuffers; CurrentVBufferIndex = CurrentVBufferSize;
if (Fail) if (Fail)
{ {
NumVBuffers--; NumVBuffers--;
if (NumVBuffers < 2) if (NumVBuffers < 2)
{ {
NumVBuffers = MAX_VBufferCount; //Error creating Vertex buffers. clean and fall to Vertex arrays
NumVBuffers = MAXVBUFFER_COUNT;
DestroyDeviceObjects(); DestroyDeviceObjects();
} }
} }
} }
void VertexManager::DestroyDeviceObjects() void VertexManager::DestroyDeviceObjects()
{ {
D3D::dev->SetStreamSource( 0, NULL, 0, 0); D3D::dev->SetStreamSource( 0, NULL, 0, 0);
D3D::dev->SetIndices(NULL); D3D::dev->SetIndices(NULL);
for (int i = 0; i < MAX_VBufferCount; i++) for (int i = 0; i < MAXVBUFFER_COUNT; i++)
{ {
if(VBuffers) if(VBuffers)
{ {
@ -152,16 +146,6 @@ void VertexManager::DestroyDeviceObjects()
IBuffers = NULL; IBuffers = NULL;
} }
VertexManager::VertexManager()
{
//CreateDeviceObjects();
}
VertexManager::~VertexManager()
{
//DestroyDeviceObjects();
}
void VertexManager::PrepareVBuffers(int stride) void VertexManager::PrepareVBuffers(int stride)
{ {
if (!NumVBuffers) if (!NumVBuffers)
@ -177,7 +161,7 @@ void VertexManager::PrepareVBuffers(int stride)
int IndexDataSize = TdataSize + LDataSize + PDataSize; int IndexDataSize = TdataSize + LDataSize + PDataSize;
DWORD LockMode = D3DLOCK_NOOVERWRITE; DWORD LockMode = D3DLOCK_NOOVERWRITE;
if (CurrentVBufferIndex > CurrentVBufferSize - datasize || LastVBuffer != CurrentVBuffer) if (CurrentVBufferIndex > CurrentVBufferSize - datasize)
{ {
LockMode = D3DLOCK_DISCARD; LockMode = D3DLOCK_DISCARD;
CurrentVBufferIndex = 0; CurrentVBufferIndex = 0;
@ -194,7 +178,7 @@ void VertexManager::PrepareVBuffers(int stride)
LockMode = D3DLOCK_NOOVERWRITE; LockMode = D3DLOCK_NOOVERWRITE;
if (CurrentIBufferIndex > CurrentIBufferSize - IndexDataSize || LastIBuffer != CurrentIBuffer) if (CurrentIBufferIndex > CurrentIBufferSize - IndexDataSize)
{ {
LockMode = D3DLOCK_DISCARD; LockMode = D3DLOCK_DISCARD;
CurrentIBufferIndex = 0; CurrentIBufferIndex = 0;
@ -221,12 +205,15 @@ void VertexManager::PrepareVBuffers(int stride)
memcpy(pIndices, PIBuffer, PDataSize * sizeof(u16)); memcpy(pIndices, PIBuffer, PDataSize * sizeof(u16));
} }
IBuffers[CurrentIBuffer]->Unlock(); IBuffers[CurrentIBuffer]->Unlock();
D3D::dev->SetStreamSource( 0, VBuffers[CurrentVBuffer], CurrentVBufferIndex, stride);
if(CurrentIBufferIndex == 0)
{
D3D::dev->SetIndices(IBuffers[CurrentIBuffer]);
}
} }
void VertexManager::Draw(int stride) void VertexManager::DrawVB(int stride)
{ {
if(NumVBuffers)
{
if (IndexGenerator::GetNumTriangles() > 0) if (IndexGenerator::GetNumTriangles() > 0)
{ {
if (FAILED(D3D::dev->DrawIndexedPrimitive( if (FAILED(D3D::dev->DrawIndexedPrimitive(
@ -269,9 +256,11 @@ void VertexManager::Draw(int stride)
} }
INCSTAT(stats.thisFrame.numIndexedDrawCalls); INCSTAT(stats.thisFrame.numIndexedDrawCalls);
} }
}
else }
{
void VertexManager::DrawVA(int stride)
{
if (IndexGenerator::GetNumTriangles() > 0) if (IndexGenerator::GetNumTriangles() > 0)
{ {
if (FAILED(D3D::dev->DrawIndexedPrimitiveUP( if (FAILED(D3D::dev->DrawIndexedPrimitiveUP(
@ -314,7 +303,6 @@ void VertexManager::Draw(int stride)
} }
INCSTAT(stats.thisFrame.numIndexedDrawCalls); INCSTAT(stats.thisFrame.numIndexedDrawCalls);
} }
}
} }
void VertexManager::vFlush() void VertexManager::vFlush()
@ -375,24 +363,13 @@ void VertexManager::vFlush()
} }
PrepareVBuffers(stride); PrepareVBuffers(stride);
if (NumVBuffers)
{
D3D::dev->SetStreamSource( 0, VBuffers[CurrentVBuffer], CurrentVBufferIndex, stride);
if(LastIBuffer != CurrentIBuffer)
{
LastIBuffer = CurrentIBuffer;
D3D::dev->SetIndices(IBuffers[CurrentIBuffer]);
}
LastVBuffer = CurrentVBuffer;
}
g_nativeVertexFmt->SetupVertexPointers(); g_nativeVertexFmt->SetupVertexPointers();
Draw(stride); if(NumVBuffers){ DrawVB(stride);} else { DrawVA(stride);}
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate &&
bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
if (useDstAlpha) if (useDstAlpha)
{ {
DWORD write = 0;
if (!PixelShaderCache::SetShader(DSTALPHA_ALPHA_PASS, g_nativeVertexFmt->m_components)) if (!PixelShaderCache::SetShader(DSTALPHA_ALPHA_PASS, g_nativeVertexFmt->m_components))
{ {
GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");}); GFX_DEBUGGER_PAUSE_LOG_AT(NEXT_ERROR,true,{printf("Fail to set pixel shader\n");});
@ -400,7 +377,7 @@ void VertexManager::vFlush()
} }
// update alpha only // update alpha only
g_renderer->ApplyState(true); g_renderer->ApplyState(true);
Draw(stride); if(NumVBuffers){ DrawVB(stride);} else { DrawVA(stride);}
g_renderer->RestoreState(); g_renderer->RestoreState();
} }
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true); GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);

View File

@ -23,7 +23,6 @@
#include "VertexManagerBase.h" #include "VertexManagerBase.h"
#define MAX_VBufferCount 4
namespace DX9 namespace DX9
{ {
@ -34,9 +33,6 @@ public:
void GetElements(NativeVertexFormat* format, D3DVERTEXELEMENT9** elems, int* num); void GetElements(NativeVertexFormat* format, D3DVERTEXELEMENT9** elems, int* num);
void CreateDeviceObjects(); void CreateDeviceObjects();
void DestroyDeviceObjects(); void DestroyDeviceObjects();
VertexManager();
~VertexManager();
private: private:
u32 CurrentVBufferIndex; u32 CurrentVBufferIndex;
u32 CurrentVBufferSize; u32 CurrentVBufferSize;
@ -45,12 +41,11 @@ private:
u32 NumVBuffers; u32 NumVBuffers;
u32 CurrentVBuffer; u32 CurrentVBuffer;
u32 CurrentIBuffer; u32 CurrentIBuffer;
u32 LastVBuffer;
u32 LastIBuffer;
LPDIRECT3DVERTEXBUFFER9 *VBuffers; LPDIRECT3DVERTEXBUFFER9 *VBuffers;
LPDIRECT3DINDEXBUFFER9 *IBuffers; LPDIRECT3DINDEXBUFFER9 *IBuffers;
void PrepareVBuffers(int stride); void PrepareVBuffers(int stride);
void Draw(int stride); void DrawVB(int stride);
void DrawVA(int stride);
// temp // temp
void vFlush(); void vFlush();
}; };