From 34e7e4f2fbb51b25a54fc21460a50057d594ea50 Mon Sep 17 00:00:00 2001 From: Mads Buvik Sandvei Date: Thu, 25 Aug 2022 23:26:25 +0200 Subject: [PATCH] MultiView: Recreate resolve layers if user calls RenderStage::setFrameBufferObject() or RenderStage::setMultisampleResolveFramebufferObject --- .../Windows/OpenSceneGraphVersionInfo.rc | 31 +++ .../Windows/OpenThreadsVersionInfo.rc | 31 +++ build/include/OpenThreads/Config | 34 +++ build/include/OpenThreads/Version | 38 ++++ build/include/osg/Config | 42 ++++ build/include/osg/GL | 194 ++++++++++++++++++ build/include/osg/Version | 73 +++++++ .../Windows/OpenSceneGraphVersionInfo.rc | 31 +++ .../Windows/OpenThreadsVersionInfo.rc | 31 +++ build2019/include/OpenThreads/Config | 34 +++ build2019/include/OpenThreads/Version | 38 ++++ build2019/include/osg/Config | 42 ++++ build2019/include/osg/GL | 194 ++++++++++++++++++ build2019/include/osg/Version | 73 +++++++ include/osgUtil/RenderStage | 4 +- src/osgUtil/RenderStage.cpp | 152 ++++++++++---- 16 files changed, 1005 insertions(+), 37 deletions(-) create mode 100644 build/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc create mode 100644 build/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc create mode 100644 build/include/OpenThreads/Config create mode 100644 build/include/OpenThreads/Version create mode 100644 build/include/osg/Config create mode 100644 build/include/osg/GL create mode 100644 build/include/osg/Version create mode 100644 build2019/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc create mode 100644 build2019/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc create mode 100644 build2019/include/OpenThreads/Config create mode 100644 build2019/include/OpenThreads/Version create mode 100644 build2019/include/osg/Config create mode 100644 build2019/include/osg/GL create mode 100644 build2019/include/osg/Version diff --git a/build/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc b/build/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc new file mode 100644 index 00000000000..c2073ff7960 --- /dev/null +++ b/build/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc @@ -0,0 +1,31 @@ +1 VERSIONINFO + FILEVERSION 3, 6, 5, 162 + PRODUCTVERSION 3, 6, 5, 162 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "OpenSceneGraph Binary" + VALUE "FileVersion", "3, 6, 5, 162" + VALUE "InternalName", "OSG" + VALUE "LegalCopyright", "Copyright (C) 2009" + VALUE "OriginalFilename", "" + VALUE "ProductName", "OpenSceneGraph" + VALUE "ProductVersion", "3, 6, 5, 162" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/build/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc b/build/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc new file mode 100644 index 00000000000..205ba181caf --- /dev/null +++ b/build/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc @@ -0,0 +1,31 @@ +1 VERSIONINFO + FILEVERSION 3, 3, 1, 21 + PRODUCTVERSION 3, 3, 1, 21 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "OPENTHREADS Binary" + VALUE "FileVersion", "3, 3, 1, 21" + VALUE "InternalName", "OSG" + VALUE "LegalCopyright", "Copyright (C) 2009" + VALUE "OriginalFilename", "" + VALUE "ProductName", "OPENTHREADS" + VALUE "ProductVersion", "3, 3, 1, 21" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/build/include/OpenThreads/Config b/build/include/OpenThreads/Config new file mode 100644 index 00000000000..713905d64c1 --- /dev/null +++ b/build/include/OpenThreads/Config @@ -0,0 +1,34 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +/**************************************************************************** + * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT! + ****************************************************************************/ + +/* Changes to the configuration reflected here can be made with ccmake on + * unix or with cmake-gui on windows. Alternatively you can use cmake's -D + * or -P switches to set some configuration values at cmake configuration time. + */ + +#ifndef _OPENTHREADS_CONFIG +#define _OPENTHREADS_CONFIG + +/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */ +/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */ +/* #undef _OPENTHREADS_ATOMIC_USE_SUN */ +#define _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED +/* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */ +/* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */ +/* #undef OT_LIBRARY_STATIC */ + +#endif diff --git a/build/include/OpenThreads/Version b/build/include/OpenThreads/Version new file mode 100644 index 00000000000..1381595fd85 --- /dev/null +++ b/build/include/OpenThreads/Version @@ -0,0 +1,38 @@ +/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OPENTHREADS_VERSION +#define OPENTHREADS_VERSION 1 + +#include + +extern "C" { + +#define OPENTHREADS_MAJOR_VERSION 3 +#define OPENTHREADS_MINOR_VERSION 3 +#define OPENTHREADS_PATCH_VERSION 1 +#define OPENTHREADS_SOVERSION 21 + +/** OpenThreadsGetVersion() returns the library version number. + * Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetVersion(); + +/** The OpenThreadsGetSOVersion() method returns the OpenSceneGraph soversion number. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetSOVersion(); + +/** The OpenThreadsGetLibraryName() method returns the library name in human-friendly form. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetLibraryName(); + +} + +#endif diff --git a/build/include/osg/Config b/build/include/osg/Config new file mode 100644 index 00000000000..d5e0300f065 --- /dev/null +++ b/build/include/osg/Config @@ -0,0 +1,42 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +/**************************************************************************** + * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT! + ****************************************************************************/ + +/* Changes to the configuration reflected here can be made with ccmake on + * unix or with cmake-gui on windows. Alternatively you can use cmake's -D + * or -P switches to set some configuration values at cmake configuration time. + */ + +#ifndef OSG_CONFIG +#define OSG_CONFIG 1 + +/* #undef OSG_NOTIFY_DISABLED */ +/* #undef OSG_USE_FLOAT_MATRIX */ +/* #undef OSG_USE_FLOAT_PLANE */ +#define OSG_USE_FLOAT_BOUNDINGSPHERE +#define OSG_USE_FLOAT_BOUNDINGBOX +/* #undef OSG_USE_FLOAT_QUAT */ +#define OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION +/* #undef OSG_USE_REF_PTR_SAFE_DEREFERENCE */ +/* #undef OSG_USE_UTF8_FILENAME */ +#define OSG_DISABLE_MSVC_WARNINGS +#define OSG_PROVIDE_READFILE +#define OSG_USE_DEPRECATED_API +#define OSG_ENVVAR_SUPPORTED +/* #undef OSG_WINDOWING_SYSTEM_CARBON */ +/* #undef OSG_WINDOWING_SYSTEM_NONE */ + +#endif diff --git a/build/include/osg/GL b/build/include/osg/GL new file mode 100644 index 00000000000..f678ba46342 --- /dev/null +++ b/build/include/osg/GL @@ -0,0 +1,194 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSG_OPENGL +#define OSG_OPENGL 1 + +#include +#include +#include + +#define OSG_GL1_AVAILABLE +#define OSG_GL2_AVAILABLE +/* #undef OSG_GL3_AVAILABLE */ +/* #undef OSG_GLES1_AVAILABLE */ +/* #undef OSG_GLES2_AVAILABLE */ +/* #undef OSG_GLES3_AVAILABLE */ +/* #undef OSG_GL_LIBRARY_STATIC */ +#define OSG_GL_DISPLAYLISTS_AVAILABLE +#define OSG_GL_MATRICES_AVAILABLE +#define OSG_GL_VERTEX_FUNCS_AVAILABLE +#define OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE +#define OSG_GL_FIXED_FUNCTION_AVAILABLE +/* #undef GL_HEADER_HAS_GLINT64 */ +/* #undef GL_HEADER_HAS_GLUINT64 */ + +#define OSG_GL1_FEATURES 1 +#define OSG_GL2_FEATURES 1 +#define OSG_GL3_FEATURES 0 +#define OSG_GLES1_FEATURES 0 +#define OSG_GLES2_FEATURES 0 +#define OSG_GLES3_FEATURES 0 +#define OSG_GL_CONTEXT_VERSION "1.0" + + +#ifndef _WIN32 + + // Required for compatibility with glext.h style function definitions of + // OpenGL extensions, such as in src/osg/Point.cpp. + #ifndef APIENTRY + #define APIENTRY + #endif + +#else // _WIN32 + + #if defined(__CYGWIN__) || defined(__MINGW32__) + + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #define APIENTRY __stdcall + #endif + // XXX This is from Win32's + #ifndef CALLBACK + #define CALLBACK __stdcall + #endif + + #else // ! __CYGWIN__ + + // Under Windows avoid including + // to avoid name space pollution, but Win32's + // needs APIENTRY and WINGDIAPI defined properly. + // XXX This is from Win32's + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) + #define WINAPI __stdcall + #define APIENTRY WINAPI + #else + #define APIENTRY + #endif + #endif + + // XXX This is from Win32's + #ifndef CALLBACK + #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #endif + + #endif // __CYGWIN__ + + // XXX This is from Win32's and + #ifndef WINGDIAPI + #define GLUT_WINGDIAPI_DEFINED + #define DECLSPEC_IMPORT __declspec(dllimport) + #define WINGDIAPI DECLSPEC_IMPORT + #endif + + // XXX This is from Win32's + #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ > 2)) + typedef unsigned short wchar_t; + #define _WCHAR_T_DEFINED + #endif + +#endif // _WIN32 + +#if defined(OSG_GL3_AVAILABLE) + #define GL3_PROTOTYPES 1 + #define GL_GLEXT_PROTOTYPES 1 +#endif + + +#include + + + +#ifndef GL_APIENTRY + #define GL_APIENTRY APIENTRY +#endif // GL_APIENTRY + + +#ifndef GL_HEADER_HAS_GLINT64 + typedef int64_t GLint64; +#endif + +#ifndef GL_HEADER_HAS_GLUINT64 + typedef uint64_t GLuint64; +#endif + +#ifdef OSG_GL_MATRICES_AVAILABLE + + inline void glLoadMatrix(const float* mat) { glLoadMatrixf(static_cast(mat)); } + inline void glMultMatrix(const float* mat) { glMultMatrixf(static_cast(mat)); } + + #ifdef OSG_GLES1_AVAILABLE + inline void glLoadMatrix(const double* mat) + { + GLfloat flt_mat[16]; + for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; + glLoadMatrixf(flt_mat); + } + + inline void glMultMatrix(const double* mat) + { + GLfloat flt_mat[16]; + for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; + glMultMatrixf(flt_mat); + } + + #else + inline void glLoadMatrix(const double* mat) { glLoadMatrixd(static_cast(mat)); } + inline void glMultMatrix(const double* mat) { glMultMatrixd(static_cast(mat)); } + #endif +#endif + +// add defines for OpenGL targets that don't define them, just to ease compatibility across targets +#ifndef GL_DOUBLE + #define GL_DOUBLE 0x140A + typedef double GLdouble; +#endif + +#ifndef GL_INT + #define GL_INT 0x1404 +#endif + +#ifndef GL_UNSIGNED_INT + #define GL_UNSIGNED_INT 0x1405 +#endif + +#ifndef GL_NONE + // OpenGL ES1 doesn't provide GL_NONE + #define GL_NONE 0x0 +#endif + +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) + //GLES defines (OES) + #define GL_RGB8_OES 0x8051 + #define GL_RGBA8_OES 0x8058 +#endif + +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) || defined(OSG_GL3_AVAILABLE) + #define GL_POLYGON 0x0009 + #define GL_QUADS 0x0007 + #define GL_QUAD_STRIP 0x0008 +#endif + +#if defined(OSG_GL3_AVAILABLE) + #define GL_LUMINANCE 0x1909 + #define GL_LUMINANCE_ALPHA 0x190A +#endif + + +#endif diff --git a/build/include/osg/Version b/build/include/osg/Version new file mode 100644 index 00000000000..def75985126 --- /dev/null +++ b/build/include/osg/Version @@ -0,0 +1,73 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSG_VERSION +#define OSG_VERSION 1 + +#include + +extern "C" { + +#define OPENSCENEGRAPH_MAJOR_VERSION 3 +#define OPENSCENEGRAPH_MINOR_VERSION 6 +#define OPENSCENEGRAPH_PATCH_VERSION 5 +#define OPENSCENEGRAPH_SOVERSION 162 + +/* Convenience macro that can be used to decide whether a feature is present or not i.e. + * #if OSG_MIN_VERSION_REQUIRED(2,9,5) + * your code here + * #endif + */ +#define OSG_MIN_VERSION_REQUIRED(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) +#define OSG_VERSION_LESS_THAN(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSIONMAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>PATCH)))) +#define OSG_VERSION_GREATER_OR_EQUAL(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) + + +/** + * osgGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgGetVersion. + * + * This C function can be also used to check for the existence of the OpenSceneGraph + * library using autoconf and its m4 macro AC_CHECK_LIB. + * + * Here is the code to add to your configure.in: + \verbatim + # + # Check for the OpenSceneGraph (OSG) library + # + AC_CHECK_LIB(osg, osgGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSG_EXPORT const char* osgGetVersion(); + +/** The osgGetSOVersion() method returns the OpenSceneGraph shared object version number. */ +extern OSG_EXPORT const char* osgGetSOVersion(); + +/** The osgGetLibraryName() method returns the library name in human-friendly form. */ +extern OSG_EXPORT const char* osgGetLibraryName(); + +// old defines for backwards compatibility. +#define OSG_VERSION_MAJOR OPENSCENEGRAPH_MAJOR_VERSION +#define OSG_VERSION_MINOR OPENSCENEGRAPH_MINOR_VERSION +#define OSG_VERSION_PATCH OPENSCENEGRAPH_PATCH_VERSION + +#define OSG_VERSION_RELEASE OSG_VERSION_PATCH +#define OSG_VERSION_REVISION 0 + + +} + +#endif diff --git a/build2019/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc b/build2019/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc new file mode 100644 index 00000000000..c2073ff7960 --- /dev/null +++ b/build2019/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc @@ -0,0 +1,31 @@ +1 VERSIONINFO + FILEVERSION 3, 6, 5, 162 + PRODUCTVERSION 3, 6, 5, 162 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "OpenSceneGraph Binary" + VALUE "FileVersion", "3, 6, 5, 162" + VALUE "InternalName", "OSG" + VALUE "LegalCopyright", "Copyright (C) 2009" + VALUE "OriginalFilename", "" + VALUE "ProductName", "OpenSceneGraph" + VALUE "ProductVersion", "3, 6, 5, 162" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/build2019/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc b/build2019/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc new file mode 100644 index 00000000000..205ba181caf --- /dev/null +++ b/build2019/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc @@ -0,0 +1,31 @@ +1 VERSIONINFO + FILEVERSION 3, 3, 1, 21 + PRODUCTVERSION 3, 3, 1, 21 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "OPENTHREADS Binary" + VALUE "FileVersion", "3, 3, 1, 21" + VALUE "InternalName", "OSG" + VALUE "LegalCopyright", "Copyright (C) 2009" + VALUE "OriginalFilename", "" + VALUE "ProductName", "OPENTHREADS" + VALUE "ProductVersion", "3, 3, 1, 21" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/build2019/include/OpenThreads/Config b/build2019/include/OpenThreads/Config new file mode 100644 index 00000000000..713905d64c1 --- /dev/null +++ b/build2019/include/OpenThreads/Config @@ -0,0 +1,34 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +/**************************************************************************** + * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT! + ****************************************************************************/ + +/* Changes to the configuration reflected here can be made with ccmake on + * unix or with cmake-gui on windows. Alternatively you can use cmake's -D + * or -P switches to set some configuration values at cmake configuration time. + */ + +#ifndef _OPENTHREADS_CONFIG +#define _OPENTHREADS_CONFIG + +/* #undef _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS */ +/* #undef _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS */ +/* #undef _OPENTHREADS_ATOMIC_USE_SUN */ +#define _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED +/* #undef _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC */ +/* #undef _OPENTHREADS_ATOMIC_USE_MUTEX */ +/* #undef OT_LIBRARY_STATIC */ + +#endif diff --git a/build2019/include/OpenThreads/Version b/build2019/include/OpenThreads/Version new file mode 100644 index 00000000000..1381595fd85 --- /dev/null +++ b/build2019/include/OpenThreads/Version @@ -0,0 +1,38 @@ +/* -*-c++-*- OpenThreads library, Copyright (C) 2002 - 2007 The Open Thread Group + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OPENTHREADS_VERSION +#define OPENTHREADS_VERSION 1 + +#include + +extern "C" { + +#define OPENTHREADS_MAJOR_VERSION 3 +#define OPENTHREADS_MINOR_VERSION 3 +#define OPENTHREADS_PATCH_VERSION 1 +#define OPENTHREADS_SOVERSION 21 + +/** OpenThreadsGetVersion() returns the library version number. + * Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetVersion(); + +/** The OpenThreadsGetSOVersion() method returns the OpenSceneGraph soversion number. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetSOVersion(); + +/** The OpenThreadsGetLibraryName() method returns the library name in human-friendly form. */ +extern OPENTHREAD_EXPORT_DIRECTIVE const char* OpenThreadsGetLibraryName(); + +} + +#endif diff --git a/build2019/include/osg/Config b/build2019/include/osg/Config new file mode 100644 index 00000000000..74b19b18889 --- /dev/null +++ b/build2019/include/osg/Config @@ -0,0 +1,42 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 2008-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +/**************************************************************************** + * THIS FILE IS AUTOGENERATED BY CMAKE. DO NOT EDIT! + ****************************************************************************/ + +/* Changes to the configuration reflected here can be made with ccmake on + * unix or with cmake-gui on windows. Alternatively you can use cmake's -D + * or -P switches to set some configuration values at cmake configuration time. + */ + +#ifndef OSG_CONFIG +#define OSG_CONFIG 1 + +/* #undef OSG_NOTIFY_DISABLED */ +#define OSG_USE_FLOAT_MATRIX +#define OSG_USE_FLOAT_PLANE +#define OSG_USE_FLOAT_BOUNDINGSPHERE +#define OSG_USE_FLOAT_BOUNDINGBOX +#define OSG_USE_FLOAT_QUAT +#define OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION +/* #undef OSG_USE_REF_PTR_SAFE_DEREFERENCE */ +/* #undef OSG_USE_UTF8_FILENAME */ +#define OSG_DISABLE_MSVC_WARNINGS +#define OSG_PROVIDE_READFILE +#define OSG_USE_DEPRECATED_API +#define OSG_ENVVAR_SUPPORTED +/* #undef OSG_WINDOWING_SYSTEM_CARBON */ +/* #undef OSG_WINDOWING_SYSTEM_NONE */ + +#endif diff --git a/build2019/include/osg/GL b/build2019/include/osg/GL new file mode 100644 index 00000000000..f678ba46342 --- /dev/null +++ b/build2019/include/osg/GL @@ -0,0 +1,194 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSG_OPENGL +#define OSG_OPENGL 1 + +#include +#include +#include + +#define OSG_GL1_AVAILABLE +#define OSG_GL2_AVAILABLE +/* #undef OSG_GL3_AVAILABLE */ +/* #undef OSG_GLES1_AVAILABLE */ +/* #undef OSG_GLES2_AVAILABLE */ +/* #undef OSG_GLES3_AVAILABLE */ +/* #undef OSG_GL_LIBRARY_STATIC */ +#define OSG_GL_DISPLAYLISTS_AVAILABLE +#define OSG_GL_MATRICES_AVAILABLE +#define OSG_GL_VERTEX_FUNCS_AVAILABLE +#define OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE +#define OSG_GL_FIXED_FUNCTION_AVAILABLE +/* #undef GL_HEADER_HAS_GLINT64 */ +/* #undef GL_HEADER_HAS_GLUINT64 */ + +#define OSG_GL1_FEATURES 1 +#define OSG_GL2_FEATURES 1 +#define OSG_GL3_FEATURES 0 +#define OSG_GLES1_FEATURES 0 +#define OSG_GLES2_FEATURES 0 +#define OSG_GLES3_FEATURES 0 +#define OSG_GL_CONTEXT_VERSION "1.0" + + +#ifndef _WIN32 + + // Required for compatibility with glext.h style function definitions of + // OpenGL extensions, such as in src/osg/Point.cpp. + #ifndef APIENTRY + #define APIENTRY + #endif + +#else // _WIN32 + + #if defined(__CYGWIN__) || defined(__MINGW32__) + + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #define APIENTRY __stdcall + #endif + // XXX This is from Win32's + #ifndef CALLBACK + #define CALLBACK __stdcall + #endif + + #else // ! __CYGWIN__ + + // Under Windows avoid including + // to avoid name space pollution, but Win32's + // needs APIENTRY and WINGDIAPI defined properly. + // XXX This is from Win32's + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) + #define WINAPI __stdcall + #define APIENTRY WINAPI + #else + #define APIENTRY + #endif + #endif + + // XXX This is from Win32's + #ifndef CALLBACK + #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #endif + + #endif // __CYGWIN__ + + // XXX This is from Win32's and + #ifndef WINGDIAPI + #define GLUT_WINGDIAPI_DEFINED + #define DECLSPEC_IMPORT __declspec(dllimport) + #define WINGDIAPI DECLSPEC_IMPORT + #endif + + // XXX This is from Win32's + #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ > 2)) + typedef unsigned short wchar_t; + #define _WCHAR_T_DEFINED + #endif + +#endif // _WIN32 + +#if defined(OSG_GL3_AVAILABLE) + #define GL3_PROTOTYPES 1 + #define GL_GLEXT_PROTOTYPES 1 +#endif + + +#include + + + +#ifndef GL_APIENTRY + #define GL_APIENTRY APIENTRY +#endif // GL_APIENTRY + + +#ifndef GL_HEADER_HAS_GLINT64 + typedef int64_t GLint64; +#endif + +#ifndef GL_HEADER_HAS_GLUINT64 + typedef uint64_t GLuint64; +#endif + +#ifdef OSG_GL_MATRICES_AVAILABLE + + inline void glLoadMatrix(const float* mat) { glLoadMatrixf(static_cast(mat)); } + inline void glMultMatrix(const float* mat) { glMultMatrixf(static_cast(mat)); } + + #ifdef OSG_GLES1_AVAILABLE + inline void glLoadMatrix(const double* mat) + { + GLfloat flt_mat[16]; + for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; + glLoadMatrixf(flt_mat); + } + + inline void glMultMatrix(const double* mat) + { + GLfloat flt_mat[16]; + for(unsigned int i=0;i<16;++i) flt_mat[i] = mat[i]; + glMultMatrixf(flt_mat); + } + + #else + inline void glLoadMatrix(const double* mat) { glLoadMatrixd(static_cast(mat)); } + inline void glMultMatrix(const double* mat) { glMultMatrixd(static_cast(mat)); } + #endif +#endif + +// add defines for OpenGL targets that don't define them, just to ease compatibility across targets +#ifndef GL_DOUBLE + #define GL_DOUBLE 0x140A + typedef double GLdouble; +#endif + +#ifndef GL_INT + #define GL_INT 0x1404 +#endif + +#ifndef GL_UNSIGNED_INT + #define GL_UNSIGNED_INT 0x1405 +#endif + +#ifndef GL_NONE + // OpenGL ES1 doesn't provide GL_NONE + #define GL_NONE 0x0 +#endif + +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) + //GLES defines (OES) + #define GL_RGB8_OES 0x8051 + #define GL_RGBA8_OES 0x8058 +#endif + +#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE) || defined(OSG_GLES3_AVAILABLE) || defined(OSG_GL3_AVAILABLE) + #define GL_POLYGON 0x0009 + #define GL_QUADS 0x0007 + #define GL_QUAD_STRIP 0x0008 +#endif + +#if defined(OSG_GL3_AVAILABLE) + #define GL_LUMINANCE 0x1909 + #define GL_LUMINANCE_ALPHA 0x190A +#endif + + +#endif diff --git a/build2019/include/osg/Version b/build2019/include/osg/Version new file mode 100644 index 00000000000..def75985126 --- /dev/null +++ b/build2019/include/osg/Version @@ -0,0 +1,73 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSG_VERSION +#define OSG_VERSION 1 + +#include + +extern "C" { + +#define OPENSCENEGRAPH_MAJOR_VERSION 3 +#define OPENSCENEGRAPH_MINOR_VERSION 6 +#define OPENSCENEGRAPH_PATCH_VERSION 5 +#define OPENSCENEGRAPH_SOVERSION 162 + +/* Convenience macro that can be used to decide whether a feature is present or not i.e. + * #if OSG_MIN_VERSION_REQUIRED(2,9,5) + * your code here + * #endif + */ +#define OSG_MIN_VERSION_REQUIRED(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) +#define OSG_VERSION_LESS_THAN(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSIONMAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>PATCH)))) +#define OSG_VERSION_GREATER_OR_EQUAL(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH)))) + + +/** + * osgGetVersion() returns the library version number. + * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgGetVersion. + * + * This C function can be also used to check for the existence of the OpenSceneGraph + * library using autoconf and its m4 macro AC_CHECK_LIB. + * + * Here is the code to add to your configure.in: + \verbatim + # + # Check for the OpenSceneGraph (OSG) library + # + AC_CHECK_LIB(osg, osgGetVersion, , + [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],) + \endverbatim +*/ +extern OSG_EXPORT const char* osgGetVersion(); + +/** The osgGetSOVersion() method returns the OpenSceneGraph shared object version number. */ +extern OSG_EXPORT const char* osgGetSOVersion(); + +/** The osgGetLibraryName() method returns the library name in human-friendly form. */ +extern OSG_EXPORT const char* osgGetLibraryName(); + +// old defines for backwards compatibility. +#define OSG_VERSION_MAJOR OPENSCENEGRAPH_MAJOR_VERSION +#define OSG_VERSION_MINOR OPENSCENEGRAPH_MINOR_VERSION +#define OSG_VERSION_PATCH OPENSCENEGRAPH_PATCH_VERSION + +#define OSG_VERSION_RELEASE OSG_VERSION_PATCH +#define OSG_VERSION_REVISION 0 + + +} + +#endif diff --git a/include/osgUtil/RenderStage b/include/osgUtil/RenderStage index 3dc70b499c4..04d33cc34e5 100644 --- a/include/osgUtil/RenderStage +++ b/include/osgUtil/RenderStage @@ -167,7 +167,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin /** Set a framebuffer object to render into. It is permissible for the * framebuffer object to be multisampled, in which case you should also * set a resolve framebuffer object - see setMultisampleResolveFramebufferObject(). */ - void setFrameBufferObject(osg::FrameBufferObject* fbo) { _fbo = fbo; } + void setFrameBufferObject(osg::FrameBufferObject* fbo); osg::FrameBufferObject* getFrameBufferObject() { return _fbo.get(); } const osg::FrameBufferObject* getFrameBufferObject() const { return _fbo.get(); } @@ -316,6 +316,8 @@ protected: // VRV_PATCH BEGIN // for resolving individual layers of a multisampled texture 2d array + void runResolveArrayLayersSetup(); + bool _resolveArrayLayersNeedSetup; std::vector> _arrayLayerFbos; std::vector> _resolveArrayLayerFbos; // VRV_PATCH END diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index 0ed49909c97..842d493f1e6 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -64,6 +64,8 @@ RenderStage::RenderStage(): _imageReadPixelFormat = GL_RGBA; _imageReadPixelDataType = GL_UNSIGNED_BYTE; + + _resolveArrayLayersNeedSetup = false; } RenderStage::RenderStage(SortMode mode): @@ -131,6 +133,69 @@ RenderStage::~RenderStage() { } +void osgUtil::RenderStage::runResolveArrayLayersSetup() +{ + _resolveArrayLayersNeedSetup = false; + + if (!_fbo || !_resolveFbo) return; + + OSG_INFO << "RenderStage::runResolveArrayLayersSetup() " << this << std::endl; + + const osg::FrameBufferObject::AttachmentMap& bufferAttachments = _fbo->getAttachmentMap(); + const osg::FrameBufferObject::AttachmentMap& resolveBufferAttachments = _resolveFbo->getAttachmentMap(); + _resolveArrayLayerFbos.clear(); + _arrayLayerFbos.clear(); + + for (osg::FrameBufferObject::AttachmentMap::const_iterator itr = bufferAttachments.begin(); + itr != bufferAttachments.end(); + ++itr) + { + osg::FrameBufferObject::BufferComponent buffer = itr->first; + if (resolveBufferAttachments.count(buffer) == 0) + continue; + + osg::FrameBufferAttachment msaaAttachment = _fbo->getAttachment(buffer); + osg::FrameBufferAttachment resolveAttachment = _resolveFbo->getAttachment(buffer); + osg::Texture2DMultisampleArray* msaaAttachmentAsTex2dArray = dynamic_cast(msaaAttachment.getTexture()); + osg::Texture2DArray* attachmentAsTex2dArray = dynamic_cast(resolveAttachment.getTexture()); + + int depth = attachmentAsTex2dArray->getTextureDepth(); + + // make a read and draw fbos for each layer so we can resolve later + for (unsigned int i = 0; i < static_cast(depth); i++) + { + osg::ref_ptr layerfbo; + osg::ref_ptr resolvelayerfbo; + + if (static_cast(_arrayLayerFbos.size()) <= i) + { + layerfbo = new osg::FrameBufferObject; + layerfbo->setName(_camera->getName() + "_layer_"); + _arrayLayerFbos.push_back(layerfbo); + } + else + { + layerfbo = _arrayLayerFbos[i]; + } + + if (static_cast(_resolveArrayLayerFbos.size()) <= i) + { + resolvelayerfbo = new osg::FrameBufferObject; + resolvelayerfbo->setName(_camera->getName() + "_resolvelayer_"); + _resolveArrayLayerFbos.push_back(resolvelayerfbo); + } + else + { + resolvelayerfbo = _resolveArrayLayerFbos[i]; + } + + resolvelayerfbo->setAttachment(buffer, osg::FrameBufferAttachment(attachmentAsTex2dArray, i, 0)); + layerfbo->setAttachment(buffer, osg::FrameBufferAttachment(msaaAttachmentAsTex2dArray, i, 0)); + + } + } +} + void RenderStage::reset() { _stageDrawnThisFrame = false; @@ -465,39 +530,11 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) osg::Texture2DMultisampleArray* multiSampleTexArray = new osg::Texture2DMultisampleArray(width, height, depth, internalFormat, samples, GL_FALSE); fbo_multisample->setAttachment(buffer, osg::FrameBufferAttachment(multiSampleTexArray, attachment._face, 0)); - osg::Texture2DArray* attachmentAsTex2dArray = dynamic_cast(attachment._texture.get()); + // The default MIN_FILTER is LINEAR_MIPMAP_LINEAR which would cause mipmap generation, which + // does not work for Texture2DMultisampleArray and would throw an error. + multiSampleTexArray->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR); - // make a read and draw fbos for each layer so we can resolve later - for(unsigned int i=0; i layerfbo; - osg::ref_ptr resolvelayerfbo; - - if(static_cast(_arrayLayerFbos.size()) <= i) - { - layerfbo = new osg::FrameBufferObject; - layerfbo->setName(_camera->getName() + "_layer_"); - _arrayLayerFbos.push_back(layerfbo); - } - else - { - layerfbo = _arrayLayerFbos[i]; - } - - if (static_cast(_resolveArrayLayerFbos.size()) <= i) - { - resolvelayerfbo = new osg::FrameBufferObject; - resolvelayerfbo->setName(_camera->getName() + "_resolvelayer_"); - _resolveArrayLayerFbos.push_back(resolvelayerfbo); - } - else - { - resolvelayerfbo = _resolveArrayLayerFbos[i]; - } - - resolvelayerfbo->setAttachment(buffer, osg::FrameBufferAttachment(attachmentAsTex2dArray, i, 0)); - layerfbo->setAttachment(buffer, osg::FrameBufferAttachment(multiSampleTexArray, i, 0)); - } + _resolveArrayLayersNeedSetup = true; } else { @@ -1101,13 +1138,17 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b else { // VRV_PATCH BEGIN - if (blitMask) + if (_resolveArrayLayersNeedSetup || _arrayLayerFbos.empty() || _resolveArrayLayerFbos.empty()) + runResolveArrayLayersSetup(); + + for (unsigned int i = 0; i < _resolveArrayLayerFbos.size(); i++) { - for(unsigned int i = 0; i < _resolveArrayLayerFbos.size(); i++) + _arrayLayerFbos[i]->apply(state, FrameBufferObject::READ_FRAMEBUFFER); + _resolveArrayLayerFbos[i]->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER); + + if (blitMask) { //_arrayLayerFbos[i]->dirtyAll(); - _arrayLayerFbos[i]->apply(state, FrameBufferObject::READ_FRAMEBUFFER); - _resolveArrayLayerFbos[i]->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER); ext->glBlitFramebuffer( static_cast(_viewport->x()), static_cast(_viewport->y()), @@ -1116,6 +1157,35 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), blitMask, GL_NEAREST); } + + +#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + if (needToBlitColorBuffers) + { + for (FrameBufferObject::AttachmentMap::const_iterator + it = _resolveArrayLayerFbos[i]->getAttachmentMap().begin(), + end = _resolveArrayLayerFbos[i]->getAttachmentMap().end(); it != end; ++it) + { + osg::Camera::BufferComponent attachment = it->first; + if (attachment >= osg::Camera::COLOR_BUFFER0) + { + glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment - osg::Camera::COLOR_BUFFER0)); + glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment - osg::Camera::COLOR_BUFFER0)); + + ext->glBlitFramebuffer( + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), + static_cast(_viewport->x()), static_cast(_viewport->y()), + static_cast(_viewport->x() + _viewport->width()), static_cast(_viewport->y() + _viewport->height()), + GL_COLOR_BUFFER_BIT, GL_NEAREST); + } + } + // reset the read and draw buffers? will comment out for now with the assumption that + // the buffers will be set explicitly when needed elsewhere. + // glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); + // glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); + } +#endif } // VRV_PATCH END } @@ -1579,6 +1649,13 @@ unsigned int RenderStage::computeNumberOfDynamicRenderLeaves() const } +void osgUtil::RenderStage::setFrameBufferObject(osg::FrameBufferObject* fbo) +{ + _fbo = fbo; + if (!_arrayLayerFbos.empty()) + _resolveArrayLayersNeedSetup = true; +} + void RenderStage::setMultisampleResolveFramebufferObject(osg::FrameBufferObject* fbo) { if (fbo && fbo->isMultisample()) @@ -1587,6 +1664,9 @@ void RenderStage::setMultisampleResolveFramebufferObject(osg::FrameBufferObject* " multisampled." << std::endl; } _resolveFbo = fbo; + + if (!_resolveArrayLayerFbos.empty()) + _resolveArrayLayersNeedSetup = true; } void RenderStage::collateReferencesToDependentCameras()