Skip to content

Commit

Permalink
Enable GPU Raycast volume mapper for recent NVIDIA drivers on Mac OS X
Browse files Browse the repository at this point in the history
GPU Raycast mapper was crashing for GL_VERSION "2.1 NVIDIA-1.6.XX".
However it works fine for tested version "2.1 NVIDIA-8.0.61"

Commit cherry-picked and adapted from 74079f9
  • Loading branch information
finetjul authored and jcfr committed Jul 22, 2015
1 parent 426987d commit add058e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2139,16 +2139,23 @@ void vtkOpenGLGPUVolumeRayCastMapper::LoadExtensions(
this->UnsupportedRequiredExtensions =
new vtkUnsupportedRequiredExtensionsStringStream;

const char *gl_version=reinterpret_cast<const char *>(glGetString(GL_VERSION));
// It does not work on Apple OS X Snow Leopard with nVidia.
// However it works with Apple OS X Lion with nVidia
// There is a bug in the OpenGL driver with an error in the
// Cg compiler about an infinite loop.
#if defined(__APPLE__) && !defined(APPLE_SNOW_LEOPARD_BUG)

(void)window;
this->UnsupportedRequiredExtensions->Stream<<
" Disabled on Apple OS X Snow Leopard with nVidia.";
this->LoadExtensionsSucceeded=0;
return;
const char *gl_vendor=reinterpret_cast<const char *>(glGetString(GL_VENDOR));
const char *minNVIDIAVersion = "2.1 NVIDIA-8";
if(gl_vendor == 0 ||
(strstr(gl_vendor,"NVIDIA Corporation")!=0 &&
strncmp(gl_version, minNVIDIAVersion, strlen(minNVIDIAVersion)) < 0))
{
this->LoadExtensionsSucceeded=0;
return;
}

#else

Expand Down

0 comments on commit add058e

Please sign in to comment.