Add CMake-controllable option to avoid doing a glBlitFramebuffer into depth to resolve multisampling. This works arouns a hang on OS X with NVIDIA GeForce 8800 and v1.5.49 drivers.
This commit is contained in:
@@ -6,6 +6,16 @@ ELSE (DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# MSFBO resolve blit to depth buffer control.
|
||||||
|
#
|
||||||
|
OPTION(OSG_MULTISAMPLE_FBO_RESOLVE_IGNORES_DEPTH "Set to ON to ignore depth when resolving multisampled FBO rendering. This is a workaround for a crash on OS X with NVIDIA driver 1.5.49." OFF)
|
||||||
|
IF(OSG_MULTISAMPLE_FBO_RESOLVE_IGNORES_DEPTH)
|
||||||
|
ADD_DEFINITIONS(-DOSG_MULTISAMPLE_FBO_RESOLVE_IGNORES_DEPTH)
|
||||||
|
ENDIF(OSG_MULTISAMPLE_FBO_RESOLVE_IGNORES_DEPTH)
|
||||||
|
|
||||||
|
|
||||||
SET(LIB_NAME osgUtil)
|
SET(LIB_NAME osgUtil)
|
||||||
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
|
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
|
||||||
SET(LIB_PUBLIC_HEADERS
|
SET(LIB_PUBLIC_HEADERS
|
||||||
|
|||||||
@@ -879,7 +879,14 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
|||||||
switch (it->first)
|
switch (it->first)
|
||||||
{
|
{
|
||||||
case Camera::DEPTH_BUFFER:
|
case Camera::DEPTH_BUFFER:
|
||||||
|
#ifndef OSG_MULTISAMPLE_FBO_RESOLVE_IGNORES_DEPTH
|
||||||
|
// This #define is a workaround for an OS X NVIDIA driver bug
|
||||||
|
// confirmed on GeForce 8800 with driver v1.5.49.
|
||||||
|
// If the glBlitFramebuffer mask includes depth, the OS X desktop
|
||||||
|
// will hang. The #define is controlled from CMake and should be
|
||||||
|
// set to ON to enable the workaround and avoid blitting depth.
|
||||||
blitMask |= GL_DEPTH_BUFFER_BIT;
|
blitMask |= GL_DEPTH_BUFFER_BIT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case Camera::STENCIL_BUFFER:
|
case Camera::STENCIL_BUFFER:
|
||||||
blitMask |= GL_STENCIL_BUFFER_BIT;
|
blitMask |= GL_STENCIL_BUFFER_BIT;
|
||||||
|
|||||||
Reference in New Issue
Block a user