Rename PolyTriangleDrawer to PolyCommandBuffer and make its interface look like one

This commit is contained in:
Magnus Norddahl 2019-12-07 23:15:12 +01:00
commit 310ef73aa8
7 changed files with 217 additions and 147 deletions

View file

@ -90,8 +90,6 @@ void PolyFrameBuffer::InitializeState()
mViewpoints = new HWViewpointBuffer;
mLights = new FLightBuffer();
PolyTriangleDrawer::SetLightBuffer(GetDrawCommands(), mLightBuffer->Memory());
CheckCanvas();
}
@ -110,18 +108,22 @@ void PolyFrameBuffer::CheckCanvas()
}
}
const DrawerCommandQueuePtr &PolyFrameBuffer::GetDrawCommands()
PolyCommandBuffer *PolyFrameBuffer::GetDrawCommands()
{
if (!mDrawCommands)
mDrawCommands = std::make_shared<DrawerCommandQueue>(&mFrameMemory);
return mDrawCommands;
{
mDrawCommands.reset(new PolyCommandBuffer(&mFrameMemory));
mDrawCommands->SetLightBuffer(mLightBuffer->Memory());
}
return mDrawCommands.get();
}
void PolyFrameBuffer::FlushDrawCommands()
{
mRenderState->EndRenderPass();
if (mDrawCommands)
{
DrawerThreads::Execute(mDrawCommands);
mDrawCommands->Submit();
mDrawCommands.reset();
}
}