Added NextPipelineBuffer to vertex buffer and call in framebuffer

This commit is contained in:
Emile Belanger 2021-05-01 19:03:48 +01:00
parent db0569d000
commit 7994dd1905
4 changed files with 11 additions and 7 deletions

View file

@ -260,11 +260,14 @@ void OpenGLFrameBuffer::Swap()
Finish.Reset();
Finish.Clock();
//if (swapbefore) glFinish();
screen->mVertexData->DropSync();
mVertexData->DropSync();
FPSLimit();
SwapBuffers();
mVertexData->NextPipelineBuffer();
mVertexData->WaitSync();
//if (!swapbefore) glFinish();
Finish.Unclock();
camtexcount = 0;

View file

@ -247,6 +247,8 @@ void OpenGLFrameBuffer::Swap()
FPSLimit();
SwapBuffers();
mVertexData->NextPipelineBuffer();
Finish.Unclock();
camtexcount = 0;

View file

@ -104,6 +104,10 @@ public:
{
mCurIndex = mIndex;
}
void NextPipelineBuffer()
{
mPipelinePos++;
mPipelinePos %= mPipelineNbr;

View file

@ -303,13 +303,8 @@ sector_t* RenderView(player_t* player)
{
auto RenderState = screen->RenderState();
// Reset BEFORE SetVertexBuffer so it sets the correct buffer
screen->mVertexData->Reset();
// Wait (if necessary) for the buffer to be free to use
screen->mVertexData->WaitSync();
RenderState->SetVertexBuffer(screen->mVertexData);
screen->mVertexData->Reset();
sector_t* retsec;
if (!V_IsHardwareRenderer())