Commit e473e02b authored by Ken Martin's avatar Ken Martin
Browse files

remove glFlush calls

These calls should not be needed but pollute the code
and the profiling results and potentially slow down execution
parent 582dd5c8
Pipeline #7459 passed with stage
...@@ -613,10 +613,6 @@ void vtkCocoaRenderWindow::Frame() ...@@ -613,10 +613,6 @@ void vtkCocoaRenderWindow::Frame()
{ {
[(NSOpenGLContext*)this->GetContextId() flushBuffer]; [(NSOpenGLContext*)this->GetContextId() flushBuffer];
} }
else
{
glFlush();
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -149,10 +149,6 @@ void vtkEGLRenderWindow::Frame() ...@@ -149,10 +149,6 @@ void vtkEGLRenderWindow::Frame()
eglSwapBuffers(impl->Display, impl->Surface); eglSwapBuffers(impl->Display, impl->Surface);
vtkDebugMacro(<< " eglSwapBuffers\n"); vtkDebugMacro(<< " eglSwapBuffers\n");
} }
else
{
glFlush();
}
} }
else else
{ {
...@@ -161,10 +157,6 @@ void vtkEGLRenderWindow::Frame() ...@@ -161,10 +157,6 @@ void vtkEGLRenderWindow::Frame()
eglSwapBuffers( eglGetCurrentDisplay(), eglGetCurrentSurface( EGL_DRAW ) ); eglSwapBuffers( eglGetCurrentDisplay(), eglGetCurrentSurface( EGL_DRAW ) );
vtkDebugMacro(<< " eglSwapBuffers\n"); vtkDebugMacro(<< " eglSwapBuffers\n");
} }
else
{
glFlush();
}
} }
} }
......
...@@ -279,10 +279,6 @@ void vtkIOSRenderWindow::Frame() ...@@ -279,10 +279,6 @@ void vtkIOSRenderWindow::Frame()
{ {
// [(NSOpenGLContext*)this->GetContextId() flushBuffer]; // [(NSOpenGLContext*)this->GetContextId() flushBuffer];
} }
else
{
glFlush();
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -128,7 +128,6 @@ vtkOSOpenGLRenderWindow::~vtkOSOpenGLRenderWindow() ...@@ -128,7 +128,6 @@ vtkOSOpenGLRenderWindow::~vtkOSOpenGLRenderWindow()
void vtkOSOpenGLRenderWindow::Frame() void vtkOSOpenGLRenderWindow::Frame()
{ {
this->MakeCurrent(); this->MakeCurrent();
glFlush();
} }
// //
......
...@@ -230,7 +230,6 @@ void vtkOpenGLHardwareSelector::BeginRenderProp() ...@@ -230,7 +230,6 @@ void vtkOpenGLHardwareSelector::BeginRenderProp()
this->BeginRenderProp(renWin); this->BeginRenderProp(renWin);
//cout << "In BeginRenderProp" << endl; //cout << "In BeginRenderProp" << endl;
//glFinish();
if (this->CurrentPass == ACTOR_PASS) if (this->CurrentPass == ACTOR_PASS)
{ {
int propid = this->PropID; int propid = this->PropID;
......
...@@ -970,9 +970,6 @@ void vtkOpenGLRenderWindow::DrawPixels( ...@@ -970,9 +970,6 @@ void vtkOpenGLRenderWindow::DrawPixels(
this->DrawPixelsTextureObject->Create2DFromRaw(srcWidth, srcHeight, this->DrawPixelsTextureObject->Create2DFromRaw(srcWidth, srcHeight,
numComponents, dataType, data); numComponents, dataType, data);
this->DrawPixelsTextureObject->CopyToFrameBuffer(NULL, NULL); this->DrawPixelsTextureObject->CopyToFrameBuffer(NULL, NULL);
// This seems to be necessary for the image to show up
glFlush();
} }
// very generic call to draw pixel data to a region of the window // very generic call to draw pixel data to a region of the window
...@@ -999,9 +996,6 @@ void vtkOpenGLRenderWindow::DrawPixels( ...@@ -999,9 +996,6 @@ void vtkOpenGLRenderWindow::DrawPixels(
dstXmin, dstYmin, dstXmax, dstYmax, dstXmin, dstYmin, dstXmax, dstYmax,
this->GetSize()[0], this->GetSize()[1], this->GetSize()[0], this->GetSize()[1],
NULL, NULL); NULL, NULL);
// This seems to be necessary for the image to show up
glFlush();
} }
// less generic verison, old API // less generic verison, old API
...@@ -1586,9 +1580,6 @@ int vtkOpenGLRenderWindow::SetRGBACharPixelData(int x1, int y1, int x2, ...@@ -1586,9 +1580,6 @@ int vtkOpenGLRenderWindow::SetRGBACharPixelData(int x1, int y1, int x2,
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
// This seems to be necessary for the image to show up
glFlush();
glDrawBuffer(buffer); glDrawBuffer(buffer);
if (glGetError() != GL_NO_ERROR) if (glGetError() != GL_NO_ERROR)
......
...@@ -554,8 +554,6 @@ void vtkOpenGLRenderer::DonePick() ...@@ -554,8 +554,6 @@ void vtkOpenGLRenderer::DonePick()
{ {
if (this->PickInfo->PerformedHardwarePick) if (this->PickInfo->PerformedHardwarePick)
{ {
glFlush();
unsigned char *pixBuffer = this->GetRenderWindow()->GetPixelData( unsigned char *pixBuffer = this->GetRenderWindow()->GetPixelData(
this->PickX1, this->PickY1, this->PickX2, this->PickY2, 0); this->PickX1, this->PickY1, this->PickX2, this->PickY2, 0);
// (this->GetRenderWindow()->GetSwapBuffers() == 1) ? 0 : 1); // (this->GetRenderWindow()->GetSwapBuffers() == 1) ? 0 : 1);
......
...@@ -199,7 +199,6 @@ void vtkTransformFeedback::ReadBuffer() ...@@ -199,7 +199,6 @@ void vtkTransformFeedback::ReadBuffer()
} }
glEndTransformFeedback(); glEndTransformFeedback();
glFlush();
size_t bufferSize = this->GetBufferSize(); size_t bufferSize = this->GetBufferSize();
this->ReleaseBufferData(); this->ReleaseBufferData();
......
...@@ -369,10 +369,6 @@ void vtkWin32OpenGLRenderWindow::Frame(void) ...@@ -369,10 +369,6 @@ void vtkWin32OpenGLRenderWindow::Frame(void)
vtkDebugMacro(<< " SwapBuffers\n"); vtkDebugMacro(<< " SwapBuffers\n");
} }
} }
else
{
glFlush();
}
} }
void vtkWin32OpenGLRenderWindow::VTKRegisterClass() void vtkWin32OpenGLRenderWindow::VTKRegisterClass()
......
...@@ -375,10 +375,6 @@ void vtkXOpenGLRenderWindow::Frame() ...@@ -375,10 +375,6 @@ void vtkXOpenGLRenderWindow::Frame()
glXSwapBuffers(this->DisplayId, this->WindowId); glXSwapBuffers(this->DisplayId, this->WindowId);
vtkDebugMacro(<< " glXSwapBuffers\n"); vtkDebugMacro(<< " glXSwapBuffers\n");
} }
else
{
glFlush();
}
} }
bool vtkXOpenGLRenderWindow::InitializeFromCurrentContext() bool vtkXOpenGLRenderWindow::InitializeFromCurrentContext()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment