• Burlen Loring's avatar
    OpenGL error hunt · a6fa3e37
    Burlen Loring authored
    This patch implements OpenGL error checking in VTK.
    
    OpenGL's error handling implementation error is designed such
    that internal error flags remain set with the first error that
    occurred until they are explicitly checked. With this design
    it's important to check and clear the error flags regularly
    else they become unusable as code checking for errors ends
    up reporting earlier undetected unrelated errors.
    
    This patch takes the following approach:
    
    1) at public entry points into code that uses OpenGL clear the
    error flags without reporting errors. This guards against
    reportinig unrealted errors, such as those caused by code
    outside of VTK. See vtkOpenGLClearErrorMacro
    
    2) before returning from functions that made OpenGL calls check
    for and report OpenGL errors. This detects Open GL errors in the
    function/method where they occurred facilitating debugging and it
    clears error flags so that user code doesn't detect errors caused
    by VTK. See vtkOpenGLCheckErrorMacro
    
    This patch cleans up a number of bugs that were detected by
    the new error checking and reporting.
    
    This patch also contains improvements for OpenGL pixel buffers, a
    renderbuffer object, and fast paths through framebuffer objects,
    and texture objects, and fast path for setting uniform variables,
    all of which are needed in vtkSurfaceLICPainter and
    vtkLineIntegralConvolution2D GPGPU code.
    
    Change-Id: I4ecefe9a444a74128bf73ef2ddfd5d4acea387ec
    a6fa3e37
vtkOpenGLLight.cxx 3.81 KB