Skip to content
Snippets Groups Projects
Commit 5c9ffc1b authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Fix grabs from back-buffer.

If we intend to grab from back-buffer, we need to ensure that the render
doesn't do a swap-buffers at the end of the render. Otherwise, that
remains in the back buffer is not guaranteed by OpenGL spec.
parent d3bc89c7
No related branches found
No related tags found
No related merge requests found
......@@ -395,9 +395,14 @@ int vtkTesting::RegressionTest(double thresh, ostream &os)
std::ostringstream out1;
// perform and extra render to make sure it is displayed
int swapBuffers = this->RenderWindow->GetSwapBuffers();
// since we're reading from back-buffer, it's essential that we turn off swapping
// otherwise what remains in the back-buffer after the swap is undefined by OpenGL specs.
this->RenderWindow->SwapBuffersOff();
this->RenderWindow->Render();
rtW2if->ReadFrontBufferOff();
rtW2if->Update();
this->RenderWindow->SetSwapBuffers(swapBuffers); // restore swap state.
int res = this->RegressionTest(rtW2if.Get(), thresh, out1);
if (res == FAILED)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment