VTK/OpenGL Driver Information

From KitwarePublic
< VTK
Revision as of 16:07, 4 January 2014 by Burlen (talk | contribs) (Created page with "With VTK's extensive use of OpenGL extensions and broad cross platform support it's inevitable that occasionally driver bugs are encountered for specific combinations of GPU, GL...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

With VTK's extensive use of OpenGL extensions and broad cross platform support it's inevitable that occasionally driver bugs are encountered for specific combinations of GPU, GL driver, and operating system. This page describes additions to vtkOpenGLExtenstionManager for uniformly dealing with OpenGL driver bugs in such a way that they may be easily located and re-evaluated periodically. For example when new drivers are released.

Identifying Driver Bugs

A rendering bug should be considered an OpenGL driver bug when a VTK class fails to render properly and the following conditions are met:

  • the class renders correctly on a number of other devices, OS's, or driver versions.
  • the class makes use of OpenGL functions as documented in the OpenGL spec for the version associated with the rendering context used by VTK.
  • no OpenGL errors are reported by VTK's GL error checking macros or errors are reported that do not match the behavior required by the OpenGL spec.

This is a rather high standard and can require some substantial effort reproducing the bug and reading both the source code and OpenGL spec. However, it's worth looking closely at the problematic code skeptically. For example some drivers, such as NVidia's, are generously fault tolerant and run cleanly on code that's not following the GL spec to the letter. In this case the bug is in the VTK code but it looks like a driver bug because it runs cleanly on all of one vendors hardware. For common features or popular GPU's it's worth the effort to see if the problem can be avoided by a slight refactoring rather than disabling the feature altogether even when the bug is in the driver.

Handling Driver Bugs

When a feature is disabled because of a driver bug it's important that the feature not remain disabled indefinitely. It's important to be able to locate features in VTK that have been disabled due to driver bugs and periodically reevaluate the situation as new hardware and drivers are released.

Additions to vtkOpenGLExtensionManager

  // Description:
  // When set known driver bugs are ignored during driver feature
  // detection. This is used to evaluate the status of a new driver
  // release to see if the bugs have been fixed. The function takes
  // a description argument which, is sent to VTK's warning stream
  // when the ignore flag is set. This makes the test output searchable
  // for tests which have problems with certain drivers. The CMakeLists
  // variable VTK_IGNORE_GLDRIVER_BUGS can be used to set this at
  // build time. Default OFF.
  bool GetIgnoreDriverBugs(const char *description);
  vtkSetMacro(IgnoreDriverBugs, bool);
  vtkBooleanMacro(IgnoreDriverBugs, bool);