diff --git a/sys-libs/mesa/mesa-10.0.1.recipe b/sys-libs/mesa/mesa-10.0.1.recipe deleted file mode 100644 index b6322d407..000000000 --- a/sys-libs/mesa/mesa-10.0.1.recipe +++ /dev/null @@ -1,147 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="5" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.0.1/MesaLib-10.0.1.tar.bz2" -CHECKSUM_SHA256="3cdf868f9599ca310c17fcf5b4ce9aec9903d8bf8561fde2577f3d422f823270" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.0.1.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -# We're locked to LLVM 3.2 as 3.3 is broken at the moment on Haiku. -# Mesa should build with any newer LLVM version however. -# As LLVM is only linked into the swpipe renderer (and not libGL) -# changing LLVM versions shouldn't introduce any abi issues. -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} == 3.2 - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 0 1 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 0 1 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 0 1 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.0.2.recipe b/sys-libs/mesa/mesa-10.0.2.recipe deleted file mode 100644 index ef5672c99..000000000 --- a/sys-libs/mesa/mesa-10.0.2.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="3" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.0.2/MesaLib-10.0.2.tar.bz2" -CHECKSUM_SHA256="4502a8e2dfa53e15d8fff89c153e6b14824fe82e49bd101e7edc02fa8cf76a7e" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.0.2.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 0 2 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 0 2 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 0 2 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.1.0.recipe b/sys-libs/mesa/mesa-10.1.0.recipe deleted file mode 100644 index f155cb9b3..000000000 --- a/sys-libs/mesa/mesa-10.1.0.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.1/MesaLib-10.1.0.tar.bz2" -CHECKSUM_SHA256="5941c3d4772a9f447f51569dfca48e01af98080bc996991d00a13f900dab2230" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.1.0.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 1 0 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 1 0 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 1 0 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.1.1.recipe b/sys-libs/mesa/mesa-10.1.1.recipe deleted file mode 100644 index 746227518..000000000 --- a/sys-libs/mesa/mesa-10.1.1.recipe +++ /dev/null @@ -1,141 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION=" -Mesa is an open-source implementation of the OpenGL specification. The OpenGL \ -specification documents a system for rendering interactive 3D graphics. -Mesa fills the role of the Haiku OpenGL kit providing 3D rendering to Haiku \ -applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul All Rights Reserved." -LICENSE="MIT" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.1.1/MesaLib-10.1.1.tar.bz2" -CHECKSUM_SHA256="f3ae730ed81fffcb1ec59076813f9955157da7a1dd9ba23a6b1b8ff8cf6798b0" -REVISION="1" -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.1.1.patchset" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 1 1 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 1 1 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 1 1 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " - -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - - -SUMMARY_swrast="Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software - rasterization on Haiku systems. Software rasterization performs all - 3D rendering on the systems CPU and doesn't require any specialized - hardware. Software rasterization is generally considered a fallback - 3D rendering method as performance is limited. - " -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM - enhanced software rendering. Software pipe rendering performs all - 3D rendering on the systems CPU and doesn't require any specialized - hardware. The usage of LLVM over traditional rasterization gives this - renderer a boost in performance. - - Gallium software pipe rendering is in an extremely early state as of - this version of Mesa, and may not function as expected. - " -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " - -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.2.9.recipe b/sys-libs/mesa/mesa-10.2.9.recipe deleted file mode 100644 index 58c1862d7..000000000 --- a/sys-libs/mesa/mesa-10.2.9.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.2.9/MesaLib-10.2.9.tar.bz2" -CHECKSUM_SHA256="f6031f8b7113a92325b60635c504c510490eebb2e707119bbff7bd86aa34657d" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.2.9.patchset" - -ARCHITECTURES="!x86_gcc2 x86 ?x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 2 9 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 2 9 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 2 9 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.3.7.recipe b/sys-libs/mesa/mesa-10.3.7.recipe deleted file mode 100644 index b526030b9..000000000 --- a/sys-libs/mesa/mesa-10.3.7.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/$portVersion/MesaLib-$portVersion.tar.bz2" -CHECKSUM_SHA256="43c6ced15e237cbb21b3082d7c0b42777c50c1f731d0d4b5efb5231063fb6a5b" -SOURCE_DIR="Mesa-$portVersion" -#PATCHES="mesa-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="?x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 3 7 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 3 7 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 3 7 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.4.7.recipe b/sys-libs/mesa/mesa-10.4.7.recipe deleted file mode 100644 index 884d5c7b1..000000000 --- a/sys-libs/mesa/mesa-10.4.7.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/$portVersion/MesaLib-$portVersion.tar.bz2" -CHECKSUM_SHA256="2c351c98671f9a7ab3fd9c601bb7a255801b1580f5dd0992639f99152801b0d2" -SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="?x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - libxml2_python - llvm${secondaryArchSuffix} - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 4 7 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 4 7 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 4 7 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-10.5.2.recipe b/sys-libs/mesa/mesa-10.5.2.recipe deleted file mode 100644 index dd7a776e9..000000000 --- a/sys-libs/mesa/mesa-10.5.2.recipe +++ /dev/null @@ -1,143 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/10.5.2/mesa-10.5.2.tar.xz" -CHECKSUM_SHA256="2f4b6fb77c3e7d6f861558d0884a3073f575e1e673dad8d1b0624e78e9c4dd44" -#SOURCE_DIR="Mesa-$portVersion" -PATCHES="mesa-10.5.2.patchset" - -ARCHITECTURES="!x86_gcc2 x86 ?x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - # libGL.so makes up the core of our OpenGL kit - mkdir -p $libDir - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - mkdir -p $developLibDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswrast.so') \ - "$addOnsDir/opengl/Software Rasterizer" - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 10 5 2 -long "Haiku OpenGL kit" - setversion "$addOnsDir/opengl/Software Rasterizer" -app 10 5 2 -long "Mesa software rasterization renderer" - setversion "$addOnsDir/opengl/Software Pipe" -app 10 5 2 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" - - # swrast renderer package - packageEntries swrast \ - "$addOnsDir/opengl/Software Rasterizer" -} - -# ===== Mesa OpenGL Add-ons ================================================== -# ----- swrast package ------------------------------------------------------- - -SUMMARY_swrast="The Mesa software rasterization renderer" -DESCRIPTION_swrast="This 3D BGLRenderer add-on provides Mesa software \ -rasterization on Haiku systems. Software rasterization performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. Software rasterization is generally considered a fallback \ -3D rendering method as performance is limited." - -PROVIDES_swrast=" - mesa${secondaryArchSuffix}_swrast = $portVersion - " -REQUIRED_swrast=" - mesa$secondaryArchSuffix == $portVersion base - " - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-11.0.1.recipe b/sys-libs/mesa/mesa-11.0.1.recipe deleted file mode 100644 index 414fe820d..000000000 --- a/sys-libs/mesa/mesa-11.0.1.recipe +++ /dev/null @@ -1,136 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="2" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/${portVersion}/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="43d0dfcd1f1e36f07f8228cd76d90175d3fc74c1ed25d7071794a100a98ef2a6" -PATCHES="mesa-11.0.1.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - setversion "$libDir/libGL.so" -app 11 0 1 -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app 11 0 1 -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app 11 0 1 -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-11.2.2.recipe b/sys-libs/mesa/mesa-11.2.2.recipe deleted file mode 100644 index a374e920c..000000000 --- a/sys-libs/mesa/mesa-11.2.2.recipe +++ /dev/null @@ -1,137 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/${portVersion}/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="40e148812388ec7c6d7b6657d5a16e2e8dabba8b97ddfceea5197947647bdfb4" -PATCHES="mesa-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - appVersion=${portVersion//\./ } - setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-12.0.4.recipe b/sys-libs/mesa/mesa-12.0.4.recipe deleted file mode 100644 index 3b4c3b797..000000000 --- a/sys-libs/mesa/mesa-12.0.4.recipe +++ /dev/null @@ -1,137 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/${portVersion}/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="5d6003da867d3f54e5000b4acdfc37e6cce5b6a4459274fdad73e24bd2f0065e" -PATCHES="mesa-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - appVersion=${portVersion//\./ } - setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-13.0.4.recipe b/sys-libs/mesa/mesa-13.0.4.recipe deleted file mode 100644 index 19f6b8551..000000000 --- a/sys-libs/mesa/mesa-13.0.4.recipe +++ /dev/null @@ -1,137 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2013 Brian Paul" -LICENSE="MIT" -REVISION="1" -SOURCE_URI="ftp://ftp.freedesktop.org/pub/mesa/${portVersion}/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="a95d7ce8f7bd5f88585e4be3144a341236d8c0fc91f6feaec59bb8ba3120e726" -PATCHES="mesa-$portVersion.patchset" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion compat >= 10.0 - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - appVersion=${portVersion//\./ } - setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-17.0.6.recipe b/sys-libs/mesa/mesa-17.0.6.recipe deleted file mode 100644 index 2e3997c30..000000000 --- a/sys-libs/mesa/mesa-17.0.6.recipe +++ /dev/null @@ -1,169 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2017 Brian Paul" -LICENSE="MIT" -REVISION="3" -SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="89ecf3bcd0f18dcca5aaa42bf36bb52a2df33be89889f94aaaad91f7a504a69d" - -ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $libDir/libEGL.so - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - appVersion=${portVersion//\./ } - setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # KHR headers for EGL - mkdir -p $includeDir/KHR - cp ./include/KHR/* $includeDir/KHR - - # Create KHR symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/KHR - - mkdir -p $developLibDir/pkgconfig - cat > $developLibDir/pkgconfig/gl.pc << EOF -prefix=${prefix} -exec_prefix=${prefix} -libdir=${libDir} -includedir=${includeDir} - -Name: gl -Description: Mesa OpenGL library -Version: $portVersion -Libs: -L${developLibDir} -lGL -Libs.private: -lm -EOF - cat > $developLibDir/pkgconfig/egl.pc << EOF -prefix=${prefix} -exec_prefix=${prefix} -libdir=${libDir} -includedir=${includeDir} - -Name: egl -Description: Mesa EGL library -Version: $portVersion -Libs: -L${developLibDir} -lEGL -Libs.private: -lm -EOF - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRES_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/mesa-17.1.4.recipe b/sys-libs/mesa/mesa-17.1.4.recipe deleted file mode 100644 index 0c80e05b1..000000000 --- a/sys-libs/mesa/mesa-17.1.4.recipe +++ /dev/null @@ -1,172 +0,0 @@ -SUMMARY="Multi-platform GL implementation" -DESCRIPTION="Mesa is an open-source implementation of the OpenGL \ -specification. The OpenGL specification documents a system for rendering \ -interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \ -providing 3D rendering to Haiku applications." -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2017 Brian Paul" -LICENSE="MIT" -REVISION="2" -SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz" -CHECKSUM_SHA256="06f3b0e6a28f0d20b7f3391cf67fe89ae98ecd0a686cd545da76557b6cec9cad" - -ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64 ?arm ?ppc" -SECONDARY_ARCHITECTURES="x86" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion - lib:libGL$secondaryArchSuffix - lib:libEGL$secondaryArchSuffix - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libLLVM_4.0$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libGL$secondaryArchSuffix = $portVersion - devel:libEGL$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - llvm${secondaryArchSuffix} - mako_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release - #scons $jobArgs build=debug -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $libDir - mkdir -p $developLibDir - - # libGL.so makes up the core of our OpenGL kit - cp $(find $mesaBuildDir -name 'libGL.so') $libDir - symlinkRelative -s $libDir/libGL.so $developLibDir - symlinkRelative -s $libDir/libGL.so $libDir/libGL.so.1 - - # OpenGL ES - cp $(find $mesaBuildDir -name 'libEGL.so.1') $libDir - symlinkRelative -s $libDir/libEGL.so.1 $libDir/libEGL.so - symlinkRelative -s $libDir/libEGL.so.1 $developLibDir/libEGL.so - - # Our rendering add-ons - mkdir -p $addOnsDir/opengl - cp $(find $mesaBuildDir -name 'libswpipe.so') \ - "$addOnsDir/opengl/Software Pipe" - - # Set some nice version info - appVersion=${portVersion//\./ } - setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit" - setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL" - setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer" - - # OpenGL Kit - mkdir -p $includeDir/os/opengl - cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/ - cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/ - cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/ - - # Standard GL headers - mkdir -p $includeDir/GL - cp ./include/GL/gl.h $includeDir/GL/ - cp ./include/GL/gl_mangle.h $includeDir/GL/ - cp ./include/GL/glext.h $includeDir/GL/ - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL - - # Standard EGL headers - mkdir -p $includeDir/EGL - cp ./include/EGL/* $includeDir/EGL - - # Create GL symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL - - # KHR headers for EGL - mkdir -p $includeDir/KHR - cp ./include/KHR/* $includeDir/KHR - - # Create KHR symlink in opengl kit - symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/KHR - - mkdir -p $developLibDir/pkgconfig - cat > $developLibDir/pkgconfig/gl.pc << EOF -prefix=${prefix} -exec_prefix=${prefix} -libdir=${libDir} -includedir=${includeDir} - -Name: gl -Description: Mesa OpenGL library -Version: $portVersion -Libs: -L${developLibDir} -lGL -Libs.private: -lm -EOF - cat > $developLibDir/pkgconfig/egl.pc << EOF -prefix=${prefix} -exec_prefix=${prefix} -libdir=${libDir} -includedir=${includeDir} - -Name: egl -Description: Mesa EGL library -Version: $portVersion -Libs: -L${developLibDir} -lEGL -Libs.private: -lm -EOF - # devel package - packageEntries devel \ - $developDir - - # swpipe renderer package - packageEntries swpipe \ - "$addOnsDir/opengl/Software Pipe" -} - - -# ===== Gallium OpenGL Add-ons =============================================== -# ----- swpipe package ------------------------------------------------------- - -SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer" -DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \ -enhanced software rendering. Software pipe rendering performs all \ -3D rendering on the systems CPU and doesn't require any specialized \ -hardware. The usage of LLVM over traditional rasterization gives this \ -renderer a boost in performance. - -Gallium software pipe rendering is in an extremely early state as of \ -this version of Mesa, and may not function as expected." - -PROVIDES_swpipe=" - mesa${secondaryArchSuffix}_swpipe = $portVersion - " -REQUIRED_swpipe=" - mesa$secondaryArchSuffix == $portVersion base - lib:libLLVM_4.0$secondaryArchSuffix - " diff --git a/sys-libs/mesa/mesa-9.1.1.recipe b/sys-libs/mesa/mesa-9.1.1.recipe deleted file mode 100644 index 0f82ec6ac..000000000 --- a/sys-libs/mesa/mesa-9.1.1.recipe +++ /dev/null @@ -1,105 +0,0 @@ -# NOTE: This recipe doesn't generate packages for general use: -# * mesa_devel: Is a service package for the Haiku build system. It contains the -# Mesa libraries and headers, which are built into the Haiku system package. -# * mesa: Is an empty package which we keep as a dependency for the Haiku system -# package, mainly to keep the copyright info. - -SUMMARY="Multi-platform GL implementation" -DESCRIPTION=" -Mesa is an open-source implementation of the OpenGL specification - a system \ -for rendering interactive 3D graphics. -A variety of device drivers allows Mesa to be used in many different \ -environments ranging from software emulation to complete hardware acceleration \ -for modern GPUs. -Mesa ties into several other open-source projects: the Direct Rendering \ -Infrastructure and X.org to provide OpenGL support to users of X on Linux, \ -FreeBSD and other operating systems. -" -HOMEPAGE="http://www.mesa3d.org/" -COPYRIGHT="1999-2012 Brian Paul All Rights Reserved." -LICENSE="MIT" -SOURCE_URI="ftp://freedesktop.org/pub/mesa/9.1.1/MesaLib-9.1.1.tar.bz2" -CHECKSUM_SHA256="3ae5741918a26ce6457b4427663b9e0ed31a3cae1b10b9009e55769a52e9adeb" -REVISION="1" -ARCHITECTURES="!x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86" - -PATCHES="mesa-9.1.1.patch" - -PROVIDES=" - mesa$secondaryArchSuffix = $portVersion - " -REQUIRES=" - haiku$secondaryArchSuffix - " -BUILD_REQUIRES=" - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - libxml2_python - cmd:bison - cmd:find - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:scons - cmd:sed - " -# TODO: Add LLVM, so llvmpipe can be built! - -SOURCE_DIR="Mesa-$portVersion" - -BUILD() -{ - if [ -n "$secondaryArchSuffix" ]; then - export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture" - fi - scons $jobArgs build=release -} - -INSTALL() -{ - mesaBuildDir=build/haiku-$effectiveTargetArchitecture - - mkdir -p $includeDir - cp -r include/* $includeDir - - mkdir -p $developLibDir - cp $(find $mesaBuildDir -name '*\.a') $developLibDir - strip --strip-debug $developLibDir/* - - mesaPrivateHeaders=$includeDir/mesa_private - for header in $(find src -name '*\.h' | sed "s,^src/,,"); do - mkdir -p $mesaPrivateHeaders/$(dirname $header) - cp src/$header $mesaPrivateHeaders/$header - done - - # devel package - packageEntries devel \ - $developDir -} - -# ----- devel package ------------------------------------------------------- - -PROVIDES_devel=" - mesa${secondaryArchSuffix}_devel = $portVersion - devel:libgalahad$secondaryArchSuffix = $portVersion - devel:libgallium$secondaryArchSuffix = $portVersion - devel:libglapi$secondaryArchSuffix = $portVersion - devel:libglsl$secondaryArchSuffix = $portVersion - devel:libi915$secondaryArchSuffix = $portVersion - devel:libi915sw$secondaryArchSuffix = $portVersion - devel:libidentity$secondaryArchSuffix = $portVersion - devel:libmesa$secondaryArchSuffix = $portVersion - devel:librbug$secondaryArchSuffix = $portVersion - devel:libsoftpipe$secondaryArchSuffix = $portVersion - devel:libst_vega$secondaryArchSuffix = $portVersion - devel:libsvga$secondaryArchSuffix = $portVersion - devel:libtrace$secondaryArchSuffix = $portVersion - devel:libws_null$secondaryArchSuffix = $portVersion - devel:libws_wrapper$secondaryArchSuffix = $portVersion - " - -REQUIRES_devel=" - mesa$secondaryArchSuffix == $portVersion base - " diff --git a/sys-libs/mesa/patches/mesa-10.0.1.patchset b/sys-libs/mesa/patches/mesa-10.0.1.patchset deleted file mode 100644 index 8dbbc212a..000000000 --- a/sys-libs/mesa/patches/mesa-10.0.1.patchset +++ /dev/null @@ -1,3073 +0,0 @@ -From dfe5d4f383c16208d32c498e2c3e92095422d532 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 14 Dec 2013 11:46:05 -0600 -Subject: [PATCH] Haiku: Add in public GL kit headers - -* These make up the base of what C++ GL Haiku - applications use for 3D rendering. -* Not placed in includes/GL to prevent Haiku headers - from getting installed on non-Haiku systems ---- - include/HaikuGL/GLRenderer.h | 76 +++++++++++++++++ - include/HaikuGL/GLView.h | 193 +++++++++++++++++++++++++++++++++++++++++++ - include/HaikuGL/OpenGLKit.h | 10 +++ - include/HaikuGL/README | 28 +++++++ - 4 files changed, 307 insertions(+) - create mode 100644 include/HaikuGL/GLRenderer.h - create mode 100644 include/HaikuGL/GLView.h - create mode 100644 include/HaikuGL/OpenGLKit.h - create mode 100644 include/HaikuGL/README - -diff --git a/include/HaikuGL/GLRenderer.h b/include/HaikuGL/GLRenderer.h -new file mode 100644 -index 0000000..7ffcc34 ---- /dev/null -+++ b/include/HaikuGL/GLRenderer.h -@@ -0,0 +1,76 @@ -+/* -+ * Copyright 2006, Philippe Houdoin. All rights reserved. -+ * Distributed under the terms of the MIT License. -+ -+ * This header defines BGLRenderer, the base class making up -+ * the Haiku GL renderer add-ons (essentially selfcontained C++ -+ * shared libraries that do the actual rendering such as -+ * libswpipe.so and libswrast.so) -+ */ -+#ifndef GLRENDERER_H -+#define GLRENDERER_H -+ -+ -+#include -+#include -+ -+ -+class BGLDispatcher; -+class GLRendererRoster; -+ -+typedef unsigned long renderer_id; -+ -+class BGLRenderer -+{ -+ // Private unimplemented copy constructors -+ BGLRenderer(const BGLRenderer &); -+ BGLRenderer & operator=(const BGLRenderer &); -+ -+public: -+ BGLRenderer(BGLView *view, ulong bgl_options, -+ BGLDispatcher *dispatcher); -+ virtual ~BGLRenderer(); -+ -+ void Acquire(); -+ void Release(); -+ -+ virtual void LockGL(); -+ virtual void UnlockGL(); -+ -+ virtual void SwapBuffers(bool VSync = false); -+ virtual void Draw(BRect updateRect); -+ virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest); -+ virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest); -+ -+ virtual void FrameResized(float width, float height); -+ -+ virtual void DirectConnected(direct_buffer_info *info); -+ virtual void EnableDirectMode(bool enabled); -+ -+ inline int32 ReferenceCount() const { return fRefCount; }; -+ inline ulong Options() const { return fOptions; }; -+ inline BGLView* GLView() { return fView; }; -+ inline BGLDispatcher* GLDispatcher() { return fDispatcher; }; -+ -+private: -+ friend class GLRendererRoster; -+ -+ virtual status_t _Reserved_Renderer_0(int32, void *); -+ virtual status_t _Reserved_Renderer_1(int32, void *); -+ virtual status_t _Reserved_Renderer_2(int32, void *); -+ virtual status_t _Reserved_Renderer_3(int32, void *); -+ virtual status_t _Reserved_Renderer_4(int32, void *); -+ -+ volatile int32 fRefCount; // How much we're still usefull? -+ BGLView* fView; // Never forget who is the boss! -+ ulong fOptions; // Keep that tune in memory -+ BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher -+ -+ GLRendererRoster* fOwningRoster; -+ renderer_id fID; -+}; -+ -+extern "C" _EXPORT BGLRenderer* instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher); -+ -+ -+#endif // GLRENDERER_H -diff --git a/include/HaikuGL/GLView.h b/include/HaikuGL/GLView.h -new file mode 100644 -index 0000000..b848578 ---- /dev/null -+++ b/include/HaikuGL/GLView.h -@@ -0,0 +1,193 @@ -+/* -+ * Copyright 2008-2013, Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * This header defines BGLView, the base class making up -+ * the Haiku GL Kit. -+ * -+ */ -+#ifndef BGLVIEW_H -+#define BGLVIEW_H -+ -+ -+#include -+ -+#define BGL_RGB 0 -+#define BGL_INDEX 1 -+#define BGL_SINGLE 0 -+#define BGL_DOUBLE 2 -+#define BGL_DIRECT 0 -+#define BGL_INDIRECT 4 -+#define BGL_ACCUM 8 -+#define BGL_ALPHA 16 -+#define BGL_DEPTH 32 -+#define BGL_OVERLAY 64 -+#define BGL_UNDERLAY 128 -+#define BGL_STENCIL 512 -+ -+#ifdef __cplusplus -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+struct glview_direct_info; -+class BGLRenderer; -+class GLRendererRoster; -+ -+class BGLView : public BView { -+public: -+ BGLView(BRect rect, const char* name, -+ ulong resizingMode, ulong mode, -+ ulong options); -+ virtual ~BGLView(); -+ -+ void LockGL(); -+ void UnlockGL(); -+ void SwapBuffers(); -+ void SwapBuffers(bool vSync); -+ -+ BView* EmbeddedView(); // deprecated, returns NULL -+ void* GetGLProcAddress(const char* procName); -+ -+ status_t CopyPixelsOut(BPoint source, BBitmap *dest); -+ status_t CopyPixelsIn(BBitmap *source, BPoint dest); -+ -+ // Mesa's GLenum is uint where Be's ones was ulong! -+ virtual void ErrorCallback(unsigned long errorCode); -+ -+ virtual void Draw(BRect updateRect); -+ virtual void AttachedToWindow(); -+ virtual void AllAttached(); -+ virtual void DetachedFromWindow(); -+ virtual void AllDetached(); -+ -+ virtual void FrameResized(float newWidth, float newHeight); -+ virtual status_t Perform(perform_code d, void *arg); -+ -+ virtual status_t Archive(BMessage *data, bool deep = true) const; -+ -+ virtual void MessageReceived(BMessage *message); -+ virtual void SetResizingMode(uint32 mode); -+ -+ virtual void Show(); -+ virtual void Hide(); -+ -+ virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index, -+ BMessage *specifier, int32 form, -+ const char *property); -+ virtual status_t GetSupportedSuites(BMessage *data); -+ -+ void DirectConnected(direct_buffer_info *info); -+ void EnableDirectMode(bool enabled); -+ -+ void* getGC() { return fGc; } // ??? -+ -+ virtual void GetPreferredSize(float* width, float* height); -+ -+private: -+ -+ virtual void _ReservedGLView1(); -+ virtual void _ReservedGLView2(); -+ virtual void _ReservedGLView3(); -+ virtual void _ReservedGLView4(); -+ virtual void _ReservedGLView5(); -+ virtual void _ReservedGLView6(); -+ virtual void _ReservedGLView7(); -+ virtual void _ReservedGLView8(); -+ -+ BGLView(const BGLView &); -+ BGLView &operator=(const BGLView &); -+ -+ void _DitherFront(); -+ bool _ConfirmDither(); -+ void _Draw(BRect rect); -+ void _CallDirectConnected(); -+ -+ void* fGc; -+ uint32 fOptions; -+ uint32 fDitherCount; -+ BLocker fDrawLock; -+ BLocker fDisplayLock; -+ glview_direct_info* fClipInfo; -+ -+ BGLRenderer* fRenderer; -+ GLRendererRoster* fRoster; -+ -+ BBitmap* fDitherMap; -+ BRect fBounds; -+ int16* fErrorBuffer[2]; -+ uint64 _reserved[8]; -+ -+ void _LockDraw(); -+ void _UnlockDraw(); -+ -+// BeOS compatibility -+private: -+ BGLView(BRect rect, char* name, -+ ulong resizingMode, ulong mode, -+ ulong options); -+}; -+ -+ -+class BGLScreen : public BWindowScreen { -+public: -+ BGLScreen(char* name, -+ ulong screenMode, ulong options, -+ status_t *error, bool debug=false); -+ ~BGLScreen(); -+ -+ void LockGL(); -+ void UnlockGL(); -+ void SwapBuffers(); -+ // Mesa's GLenum is uint where Be's ones was ulong! -+ virtual void ErrorCallback(unsigned long errorCode); -+ -+ virtual void ScreenConnected(bool connected); -+ virtual void FrameResized(float width, float height); -+ virtual status_t Perform(perform_code code, void *arg); -+ -+ virtual status_t Archive(BMessage *data, bool deep = true) const; -+ virtual void MessageReceived(BMessage *message); -+ -+ virtual void Show(); -+ virtual void Hide(); -+ -+ virtual BHandler* ResolveSpecifier(BMessage *message, -+ int32 index, -+ BMessage *specifier, -+ int32 form, -+ const char *property); -+ virtual status_t GetSupportedSuites(BMessage *data); -+ -+private: -+ -+ virtual void _ReservedGLScreen1(); -+ virtual void _ReservedGLScreen2(); -+ virtual void _ReservedGLScreen3(); -+ virtual void _ReservedGLScreen4(); -+ virtual void _ReservedGLScreen5(); -+ virtual void _ReservedGLScreen6(); -+ virtual void _ReservedGLScreen7(); -+ virtual void _ReservedGLScreen8(); -+ -+ BGLScreen(const BGLScreen &); -+ BGLScreen &operator=(const BGLScreen &); -+ -+ void* fGc; -+ long fOptions; -+ BLocker fDrawLock; -+ -+ int32 fColorSpace; -+ uint32 fScreenMode; -+ -+ uint64 _reserved[7]; -+}; -+ -+#endif // __cplusplus -+ -+#endif // BGLVIEW_H -diff --git a/include/HaikuGL/OpenGLKit.h b/include/HaikuGL/OpenGLKit.h -new file mode 100644 -index 0000000..f482871 ---- /dev/null -+++ b/include/HaikuGL/OpenGLKit.h -@@ -0,0 +1,10 @@ -+/* -+ * Master include file for the Haiku OpenGL Kit. -+ */ -+ -+#include -+#include -+ -+// Projects needing GL/glu.h and GL/glut.h should now -+// include these headers independently as glu and glut -+// are no longe core parts of mesa -diff --git a/include/HaikuGL/README b/include/HaikuGL/README -new file mode 100644 -index 0000000..0f8503f ---- /dev/null -+++ b/include/HaikuGL/README -@@ -0,0 +1,28 @@ -+These headers make up the Haiku Op*nGL kit. -+ -+Headers in this directory preserve some BeOS™ compatibility -+compatibility, so changes should be mentioned to the Haiku -+project mailing list. -+ -+http://haiku-os.org -+ -+Normal Haiku Op*enGL layout: -+ -+ * headers/os/OpenGLKit.h -+ * headers/os/opengl/GLView.h -+ * headers/os/opengl/GLRenderer.h -+ * headers/os/opengl/GL/gl.h -+ * headers/os/opengl/GL/gl_mangle.h -+ * headers/os/opengl/GL/glext.h -+ * headers/os/opengl/GL/osmesa.h (needed?) -+ -+Extras: -+ -+ * headers/os/opengl/GL/glu.h -+ * headers/os/opengl/GL/glut.h -+ -+OpenGL™ is a trademark of SGI. The usage of this trademark -+in the Haiku GL Kit is not a sign of any certification or -+endorsement by SGI or its affiliates. Usage is purely to -+allow legacy compatibility with the BeOS™ and its 3D GL -+rendering subsystem. --- -1.8.3.4 - -From cc285772ce222f3672aa725dea18b52d9f94d2c2 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Mon, 30 Dec 2013 23:49:06 -0600 -Subject: [PATCH] haiku: Fix missing HaikuGL header paths - ---- - src/gallium/targets/haiku-softpipe/SConscript | 1 + - src/gallium/targets/libgl-haiku/SConscript | 1 + - src/mesa/drivers/haiku/swrast/SConscript | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript -index 40bf03c..16ce7cd 100644 ---- a/src/gallium/targets/haiku-softpipe/SConscript -+++ b/src/gallium/targets/haiku-softpipe/SConscript -@@ -21,6 +21,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '#/src/gallium/winsys/sw/hgl', - '/boot/system/develop/headers/private', - ]) -diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript -index 2e6b628..43d15c5 100644 ---- a/src/gallium/targets/libgl-haiku/SConscript -+++ b/src/gallium/targets/libgl-haiku/SConscript -@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '/boot/system/develop/headers/private', - Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers - ]) -diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript -index 71ce88e..ca0423e 100644 ---- a/src/mesa/drivers/haiku/swrast/SConscript -+++ b/src/mesa/drivers/haiku/swrast/SConscript -@@ -6,6 +6,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '/boot/system/develop/headers/private', - Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers - ]) --- -1.8.3.4 - -From 72e0f3de1f2df3407dbf257183c78bd3f81c1a12 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Tue, 31 Dec 2013 15:39:49 -0600 -Subject: [PATCH] haiku libGL: Move from gallium target to src/hgl - -* The Haiku renderers need to link to libGL to function properly - in all usage contexts. As mesa drivers build before gallium - targets, we couldn't properly link the mesa swrast driver to - the gallium libGL target for Haiku. -* This is likely better as it mimics how glx is laid out ensuring - the Haiku libGL is better understood. -* All renderers properly link in libGL now. ---- - src/SConscript | 5 + - src/gallium/SConscript | 1 - - src/gallium/targets/haiku-softpipe/SConscript | 2 + - src/gallium/targets/libgl-haiku/GLDispatcher.cpp | 72 --- - src/gallium/targets/libgl-haiku/GLDispatcher.h | 109 ---- - src/gallium/targets/libgl-haiku/GLRenderer.cpp | 106 ---- - .../targets/libgl-haiku/GLRendererRoster.cpp | 224 ------- - src/gallium/targets/libgl-haiku/GLRendererRoster.h | 51 -- - src/gallium/targets/libgl-haiku/GLView.cpp | 643 --------------------- - src/gallium/targets/libgl-haiku/SConscript | 35 -- - src/hgl/GLDispatcher.cpp | 72 +++ - src/hgl/GLDispatcher.h | 109 ++++ - src/hgl/GLRenderer.cpp | 106 ++++ - src/hgl/GLRendererRoster.cpp | 224 +++++++ - src/hgl/GLRendererRoster.h | 51 ++ - src/hgl/GLView.cpp | 643 +++++++++++++++++++++ - src/hgl/SConscript | 36 ++ - src/mesa/drivers/haiku/swrast/SConscript | 2 + - 18 files changed, 1250 insertions(+), 1241 deletions(-) - delete mode 100644 src/gallium/targets/libgl-haiku/GLDispatcher.cpp - delete mode 100644 src/gallium/targets/libgl-haiku/GLDispatcher.h - delete mode 100644 src/gallium/targets/libgl-haiku/GLRenderer.cpp - delete mode 100644 src/gallium/targets/libgl-haiku/GLRendererRoster.cpp - delete mode 100644 src/gallium/targets/libgl-haiku/GLRendererRoster.h - delete mode 100644 src/gallium/targets/libgl-haiku/GLView.cpp - delete mode 100644 src/gallium/targets/libgl-haiku/SConscript - create mode 100644 src/hgl/GLDispatcher.cpp - create mode 100644 src/hgl/GLDispatcher.h - create mode 100644 src/hgl/GLRenderer.cpp - create mode 100644 src/hgl/GLRendererRoster.cpp - create mode 100644 src/hgl/GLRendererRoster.h - create mode 100644 src/hgl/GLView.cpp - create mode 100644 src/hgl/SConscript - -diff --git a/src/SConscript b/src/SConscript -index 1465918..a24acea 100644 ---- a/src/SConscript -+++ b/src/SConscript -@@ -18,6 +18,11 @@ if env['hostonly']: - # enable OpenGL ES support. - SConscript('mapi/glapi/gen/SConscript') - SConscript('mapi/glapi/SConscript') -+ -+# Haiku C++ libGL dispatch (renderers depend on libgl) -+if env['platform'] in ['haiku']: -+ SConscript('hgl/SConscript') -+ - SConscript('mesa/SConscript') - - SConscript('mapi/vgapi/SConscript') -diff --git a/src/gallium/SConscript b/src/gallium/SConscript -index 6e27be2..32bbdbe 100644 ---- a/src/gallium/SConscript -+++ b/src/gallium/SConscript -@@ -119,7 +119,6 @@ if not env['embedded']: - if env['platform'] == 'haiku': - SConscript([ - 'targets/haiku-softpipe/SConscript', -- 'targets/libgl-haiku/SConscript', - ]) - - if env['dri']: -diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript -index 16ce7cd..0381d05 100644 ---- a/src/gallium/targets/haiku-softpipe/SConscript -+++ b/src/gallium/targets/haiku-softpipe/SConscript -@@ -17,6 +17,8 @@ if True: - ]) - env.Prepend(LIBS = [softpipe]) - -+env.Prepend(LIBS = [libgl]) -+ - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', -diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp b/src/gallium/targets/libgl-haiku/GLDispatcher.cpp -deleted file mode 100644 -index 46b91d5..0000000 ---- a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp -+++ /dev/null -@@ -1,72 +0,0 @@ --/* -- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Brian Paul -- * Philippe Houdoin -- * Alexander von Gluck IV -- */ -- -- --extern "C" { --#include "glapi/glapi.h" --#include "glapi/glapi_priv.h" -- --/* -- * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints -- * (glAccum, glBegin, etc). -- * This code IS NOT USED if we're compiling on an x86 system and using -- * the glapi_x86.S assembly code. -- */ --#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) -- --#define KEYWORD1 PUBLIC --#define KEYWORD2 --#define NAME(func) gl##func -- --#define DISPATCH(func, args, msg) \ -- const struct _glapi_table* dispatch; \ -- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -- (dispatch->func) args -- --#define RETURN_DISPATCH(func, args, msg) \ -- const struct _glapi_table* dispatch; \ -- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -- return (dispatch->func) args -- --#endif --} -- -- --/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching -- C++ wrapper class -- */ -- --#include "GLDispatcher.h" -- --BGLDispatcher::BGLDispatcher() --{ --} -- -- --BGLDispatcher::~BGLDispatcher() --{ --} -- -- --status_t --BGLDispatcher::CheckTable(const struct _glapi_table* table) --{ -- _glapi_check_table(table ? table : _glapi_get_dispatch()); -- return B_OK; --} -- -- --status_t --BGLDispatcher::SetTable(struct _glapi_table* table) --{ -- _glapi_set_dispatch(table); -- return B_OK; --} -diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.h b/src/gallium/targets/libgl-haiku/GLDispatcher.h -deleted file mode 100644 -index 44bca8c..0000000 ---- a/src/gallium/targets/libgl-haiku/GLDispatcher.h -+++ /dev/null -@@ -1,109 +0,0 @@ --/* -- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Brian Paul -- * Philippe Houdoin -- */ --#ifndef GLDISPATCHER_H --#define GLDISPATCHER_H -- -- --#include --#include --#include -- --#include "glheader.h" -- --extern "C" { --#include "glapi/glapi.h" --} -- -- --class BGLDispatcher --{ -- // Private unimplemented copy constructors -- BGLDispatcher(const BGLDispatcher &); -- BGLDispatcher & operator=(const BGLDispatcher &); -- -- public: -- BGLDispatcher(); -- ~BGLDispatcher(); -- -- void SetCurrentContext(void* context); -- void* CurrentContext(); -- -- struct _glapi_table* Table(); -- status_t CheckTable( -- const struct _glapi_table* dispatch = NULL); -- status_t SetTable(struct _glapi_table* dispatch); -- uint32 TableSize(); -- -- const _glapi_proc operator[](const char* functionName); -- const char* operator[](uint32 offset); -- -- const _glapi_proc AddressOf(const char* functionName); -- uint32 OffsetOf(const char* functionName); --}; -- -- --// Inlines methods --inline void --BGLDispatcher::SetCurrentContext(void* context) --{ -- _glapi_set_context(context); --} -- -- --inline void* --BGLDispatcher::CurrentContext() --{ -- return _glapi_get_context(); --} -- -- --inline struct _glapi_table* --BGLDispatcher::Table() --{ -- return _glapi_get_dispatch(); --} -- -- --inline uint32 --BGLDispatcher::TableSize() --{ -- return _glapi_get_dispatch_table_size(); --} -- -- --inline const _glapi_proc --BGLDispatcher::operator[](const char* functionName) --{ -- return _glapi_get_proc_address(functionName); --} -- -- --inline const char* --BGLDispatcher::operator[](uint32 offset) --{ -- return _glapi_get_proc_name((GLuint) offset); --} -- -- --inline const _glapi_proc --BGLDispatcher::AddressOf(const char* functionName) --{ -- return _glapi_get_proc_address(functionName); --} -- -- --inline uint32 --BGLDispatcher::OffsetOf(const char* functionName) --{ -- return (uint32) _glapi_get_proc_offset(functionName); --} -- -- --#endif // GLDISPATCHER_H -diff --git a/src/gallium/targets/libgl-haiku/GLRenderer.cpp b/src/gallium/targets/libgl-haiku/GLRenderer.cpp -deleted file mode 100644 -index 4573a64..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRenderer.cpp -+++ /dev/null -@@ -1,106 +0,0 @@ --/* -- * Copyright 2006-2008, Philippe Houdoin. All rights reserved. -- * Distributed under the terms of the MIT License. -- */ -- -- --#include -- --#include "GLRenderer.h" -- --#include "GLDispatcher.h" -- -- --BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, -- BGLDispatcher* dispatcher) -- : -- fRefCount(1), -- fView(view), -- fOptions(glOptions), -- fDispatcher(dispatcher) --{ --} -- -- --BGLRenderer::~BGLRenderer() --{ -- delete fDispatcher; --} -- -- --void --BGLRenderer::Acquire() --{ -- atomic_add(&fRefCount, 1); --} -- -- --void --BGLRenderer::Release() --{ -- if (atomic_add(&fRefCount, -1) < 1) -- delete this; --} -- -- --void --BGLRenderer::LockGL() --{ --} -- -- --void --BGLRenderer::UnlockGL() --{ --} -- -- --void --BGLRenderer::SwapBuffers(bool VSync) --{ --} -- -- --void --BGLRenderer::Draw(BRect updateRect) --{ --} -- -- --status_t --BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) --{ -- return B_ERROR; --} -- -- --status_t --BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) --{ -- return B_ERROR; --} -- -- --void --BGLRenderer::FrameResized(float width, float height) --{ --} -- -- --void --BGLRenderer::DirectConnected(direct_buffer_info* info) --{ --} -- -- --void --BGLRenderer::EnableDirectMode(bool enabled) --{ --} -- -- --status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } -diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp b/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp -deleted file mode 100644 -index 1712a87..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp -+++ /dev/null -@@ -1,224 +0,0 @@ --/* -- * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Philippe Houdoin -- * Alexander von Gluck IV -- */ -- -- --#include --#include -- --#include --#include -- --#include --#include --#include --#include --#include "GLDispatcher.h" --#include "GLRendererRoster.h" -- --#include --#include -- -- --extern "C" status_t _kern_get_safemode_option(const char* parameter, -- char* buffer, size_t* _bufferSize); -- -- --GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) -- : -- fNextID(0), -- fView(view), -- fOptions(options), -- fSafeMode(false), -- fABISubDirectory(NULL) --{ -- char parameter[32]; -- size_t parameterLength = sizeof(parameter); -- -- if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, -- parameter, ¶meterLength) == B_OK) { -- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -- fSafeMode = true; -- } -- -- if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, -- parameter, ¶meterLength) == B_OK) { -- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -- fSafeMode = true; -- } -- -- // We might run in compatibility mode on a system with a different ABI. The -- // renderers matching our ABI can usually be found in respective -- // subdirectories of the opengl add-ons directories. -- system_info info; -- if (get_system_info(&info) == B_OK -- && (info.abi & B_HAIKU_ABI_MAJOR) -- != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { -- switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { -- case B_HAIKU_ABI_GCC_2: -- fABISubDirectory = "gcc2"; -- break; -- case B_HAIKU_ABI_GCC_4: -- fABISubDirectory = "gcc4"; -- break; -- } -- } -- -- AddDefaultPaths(); --} -- -- --GLRendererRoster::~GLRendererRoster() --{ -- --} -- -- --BGLRenderer* --GLRendererRoster::GetRenderer(int32 id) --{ -- RendererMap::const_iterator iterator = fRenderers.find(id); -- if (iterator == fRenderers.end()) -- return NULL; -- -- struct renderer_item item = iterator->second; -- return item.renderer; --} -- -- --void --GLRendererRoster::AddDefaultPaths() --{ -- // add user directories first, so that they can override system renderers -- const directory_which paths[] = { -- B_USER_NONPACKAGED_ADDONS_DIRECTORY, -- B_USER_ADDONS_DIRECTORY, -- B_SYSTEM_ADDONS_DIRECTORY, -- }; -- -- for (uint32 i = fSafeMode ? 4 : 0; -- i < sizeof(paths) / sizeof(paths[0]); i++) { -- BPath path; -- status_t status = find_directory(paths[i], &path, true); -- if (status == B_OK && path.Append("opengl") == B_OK) -- AddPath(path.Path()); -- } --} -- -- --status_t --GLRendererRoster::AddPath(const char* path) --{ -- BDirectory directory(path); -- status_t status = directory.InitCheck(); -- if (status < B_OK) -- return status; -- -- // if a subdirectory for our ABI exists, use that instead -- if (fABISubDirectory != NULL) { -- BEntry entry(&directory, fABISubDirectory); -- if (entry.IsDirectory()) { -- status = directory.SetTo(&entry); -- if (status != B_OK) -- return status; -- } -- } -- -- node_ref nodeRef; -- status = directory.GetNodeRef(&nodeRef); -- if (status < B_OK) -- return status; -- -- int32 count = 0; -- int32 files = 0; -- -- entry_ref ref; -- BEntry entry; -- while (directory.GetNextRef(&ref) == B_OK) { -- entry.SetTo(&ref); -- if (entry.InitCheck() == B_OK && !entry.IsFile()) -- continue; -- -- if (CreateRenderer(ref) == B_OK) -- count++; -- -- files++; -- } -- -- if (files != 0 && count == 0) -- return B_BAD_VALUE; -- -- return B_OK; --} -- -- --status_t --GLRendererRoster::AddRenderer(BGLRenderer* renderer, -- image_id image, const entry_ref* ref, ino_t node) --{ -- renderer_item item; -- item.renderer = renderer; -- item.image = image; -- item.node = node; -- if (ref != NULL) -- item.ref = *ref; -- -- try { -- fRenderers[fNextID] = item; -- } catch (...) { -- return B_NO_MEMORY; -- } -- -- renderer->fOwningRoster = this; -- renderer->fID = fNextID++; -- return B_OK; --} -- -- --status_t --GLRendererRoster::CreateRenderer(const entry_ref& ref) --{ -- BEntry entry(&ref); -- node_ref nodeRef; -- status_t status = entry.GetNodeRef(&nodeRef); -- if (status < B_OK) -- return status; -- -- BPath path(&ref); -- image_id image = load_add_on(path.Path()); -- if (image < B_OK) -- return image; -- -- BGLRenderer* (*instantiate_renderer) -- (BGLView* view, ulong options, BGLDispatcher* dispatcher); -- -- status = get_image_symbol(image, "instantiate_gl_renderer", -- B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); -- if (status == B_OK) { -- BGLRenderer* renderer -- = instantiate_renderer(fView, fOptions, new BGLDispatcher()); -- if (!renderer) { -- unload_add_on(image); -- return B_UNSUPPORTED; -- } -- -- if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { -- renderer->Release(); -- // this will delete the renderer -- unload_add_on(image); -- } -- return B_OK; -- } -- unload_add_on(image); -- -- return status; --} -diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.h b/src/gallium/targets/libgl-haiku/GLRendererRoster.h -deleted file mode 100644 -index 5c8da27..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRendererRoster.h -+++ /dev/null -@@ -1,51 +0,0 @@ --/* -- * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Philippe Houdoin -- */ --#ifndef _GLRENDERER_ROSTER_H --#define _GLRENDERER_ROSTER_H -- -- --#include -- --#include -- -- --struct renderer_item { -- BGLRenderer* renderer; -- entry_ref ref; -- ino_t node; -- image_id image; --}; -- --typedef std::map RendererMap; -- -- --class GLRendererRoster { -- public: -- GLRendererRoster(BGLView* view, ulong options); -- virtual ~GLRendererRoster(); -- -- BGLRenderer* GetRenderer(int32 id = 0); -- -- private: -- void AddDefaultPaths(); -- status_t AddPath(const char* path); -- status_t AddRenderer(BGLRenderer* renderer, -- image_id image, const entry_ref* ref, ino_t node); -- status_t CreateRenderer(const entry_ref& ref); -- -- RendererMap fRenderers; -- int32 fNextID; -- BGLView* fView; -- ulong fOptions; -- bool fSafeMode; -- const char* fABISubDirectory; -- --}; -- -- --#endif /* _GLRENDERER_ROSTER_H */ -diff --git a/src/gallium/targets/libgl-haiku/GLView.cpp b/src/gallium/targets/libgl-haiku/GLView.cpp -deleted file mode 100644 -index 9ae5b5c..0000000 ---- a/src/gallium/targets/libgl-haiku/GLView.cpp -+++ /dev/null -@@ -1,643 +0,0 @@ --/* -- * Copyright 2006-2012, Haiku. All rights reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Jérôme Duval, korli@users.berlios.de -- * Philippe Houdoin, philippe.houdoin@free.fr -- * Stefano Ceccherini, burton666@libero.it -- */ -- --#include -- --#include -- --#include --#include --#include --#include -- --#include --#include -- --#include "interface/DirectWindowPrivate.h" --#include "GLDispatcher.h" --#include "GLRendererRoster.h" -- -- --struct glview_direct_info { -- direct_buffer_info* direct_info; -- bool direct_connected; -- bool enable_direct_mode; -- -- glview_direct_info(); -- ~glview_direct_info(); --}; -- -- --BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, -- ulong options) -- : -- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -- // | B_FULL_UPDATE_ON_RESIZE) -- fGc(NULL), -- fOptions(options), -- fDitherCount(0), -- fDrawLock("BGLView draw lock"), -- fDisplayLock("BGLView display lock"), -- fClipInfo(NULL), -- fRenderer(NULL), -- fRoster(NULL), -- fDitherMap(NULL) --{ -- fRoster = new GLRendererRoster(this, options); --} -- -- --BGLView::~BGLView() --{ -- delete fClipInfo; -- if (fRenderer) -- fRenderer->Release(); --} -- -- --void --BGLView::LockGL() --{ -- // TODO: acquire the OpenGL API lock it on this glview -- -- fDisplayLock.Lock(); -- if (fRenderer) -- fRenderer->LockGL(); --} -- -- --void --BGLView::UnlockGL() --{ -- if (fRenderer) -- fRenderer->UnlockGL(); -- fDisplayLock.Unlock(); -- -- // TODO: release the GL API lock to others glviews --} -- -- --void --BGLView::SwapBuffers() --{ -- SwapBuffers(false); --} -- -- --void --BGLView::SwapBuffers(bool vSync) --{ -- if (fRenderer) { -- _LockDraw(); -- fRenderer->SwapBuffers(vSync); -- _UnlockDraw(); -- } --} -- -- --BView* --BGLView::EmbeddedView() --{ -- return NULL; --} -- -- --void* --BGLView::GetGLProcAddress(const char* procName) --{ -- BGLDispatcher* glDispatcher = NULL; -- -- if (fRenderer) -- glDispatcher = fRenderer->GLDispatcher(); -- -- if (glDispatcher) -- return (void*)glDispatcher->AddressOf(procName); -- -- return NULL; --} -- -- --status_t --BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) --{ -- if (!fRenderer) -- return B_ERROR; -- -- if (!dest || !dest->Bounds().IsValid()) -- return B_BAD_VALUE; -- -- return fRenderer->CopyPixelsOut(source, dest); --} -- -- --status_t --BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) --{ -- if (!fRenderer) -- return B_ERROR; -- -- if (!source || !source->Bounds().IsValid()) -- return B_BAD_VALUE; -- -- return fRenderer->CopyPixelsIn(source, dest); --} -- -- --/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum -- without breaking this method signature. -- Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: -- unsigned long. -- */ --void --BGLView::ErrorCallback(unsigned long errorCode) --{ -- char msg[32]; -- sprintf(msg, "GL: Error code $%04lx.", errorCode); -- // TODO: under BeOS R5, it call debugger(msg); -- fprintf(stderr, "%s\n", msg); --} -- -- --void --BGLView::Draw(BRect updateRect) --{ -- if (fRenderer) { -- _LockDraw(); -- fRenderer->Draw(updateRect); -- _UnlockDraw(); -- return; -- } -- // TODO: auto-size and center the string -- MovePenTo(8, 32); -- DrawString("No OpenGL renderer available!"); --} -- -- --void --BGLView::AttachedToWindow() --{ -- BView::AttachedToWindow(); -- -- fBounds = Bounds(); -- for (BView* view = this; view != NULL; view = view->Parent()) -- view->ConvertToParent(&fBounds); -- -- fRenderer = fRoster->GetRenderer(); -- if (fRenderer != NULL) { -- // Jackburton: The following code was commented because it doesn't look -- // good in "direct" mode: -- // when the window is moved, the app_server doesn't paint the view's -- // background, and the stuff behind the window itself shows up. -- // Setting the view color to black, instead, looks a bit more elegant. --#if 0 -- // Don't paint white window background when resized -- SetViewColor(B_TRANSPARENT_32_BIT); --#else -- SetViewColor(0, 0, 0); --#endif -- -- // Set default OpenGL viewport: -- LockGL(); -- glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); -- UnlockGL(); -- fRenderer->FrameResized(Bounds().IntegerWidth(), -- Bounds().IntegerHeight()); -- -- if (fClipInfo) { -- fRenderer->DirectConnected(fClipInfo->direct_info); -- fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); -- } -- -- return; -- } -- -- fprintf(stderr, "no renderer found! \n"); -- -- // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing -- // context -- SetFont(be_bold_font); -- // SetFontSize(16); --} -- -- --void --BGLView::AllAttached() --{ -- BView::AllAttached(); --} -- -- --void --BGLView::DetachedFromWindow() --{ -- if (fRenderer) -- fRenderer->Release(); -- fRenderer = NULL; -- -- BView::DetachedFromWindow(); --} -- -- --void --BGLView::AllDetached() --{ -- BView::AllDetached(); --} -- -- --void --BGLView::FrameResized(float width, float height) --{ -- fBounds = Bounds(); -- for (BView* v = this; v; v = v->Parent()) -- v->ConvertToParent(&fBounds); -- -- if (fRenderer) { -- LockGL(); -- _LockDraw(); -- _CallDirectConnected(); -- fRenderer->FrameResized(width, height); -- _UnlockDraw(); -- UnlockGL(); -- } -- -- BView::FrameResized(width, height); --} -- -- --status_t --BGLView::Perform(perform_code d, void* arg) --{ -- return BView::Perform(d, arg); --} -- -- --status_t --BGLView::Archive(BMessage* data, bool deep) const --{ -- return BView::Archive(data, deep); --} -- -- --void --BGLView::MessageReceived(BMessage* msg) --{ -- BView::MessageReceived(msg); --} -- -- --void --BGLView::SetResizingMode(uint32 mode) --{ -- BView::SetResizingMode(mode); --} -- -- --void --BGLView::GetPreferredSize(float* _width, float* _height) --{ -- if (_width) -- *_width = 0; -- if (_height) -- *_height = 0; --} -- -- --void --BGLView::Show() --{ -- BView::Show(); --} -- -- --void --BGLView::Hide() --{ -- BView::Hide(); --} -- -- --BHandler* --BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -- int32 form, const char* property) --{ -- return BView::ResolveSpecifier(msg, index, specifier, form, property); --} -- -- --status_t --BGLView::GetSupportedSuites(BMessage* data) --{ -- return BView::GetSupportedSuites(data); --} -- -- --void --BGLView::DirectConnected(direct_buffer_info* info) --{ -- if (fClipInfo == NULL) { -- fClipInfo = new (std::nothrow) glview_direct_info(); -- if (fClipInfo == NULL) -- return; -- } -- -- direct_buffer_info* localInfo = fClipInfo->direct_info; -- -- switch (info->buffer_state & B_DIRECT_MODE_MASK) { -- case B_DIRECT_START: -- fClipInfo->direct_connected = true; -- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -- _UnlockDraw(); -- break; -- -- case B_DIRECT_MODIFY: -- _LockDraw(); -- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -- _UnlockDraw(); -- break; -- -- case B_DIRECT_STOP: -- fClipInfo->direct_connected = false; -- _LockDraw(); -- break; -- } -- -- if (fRenderer) -- _CallDirectConnected(); --} -- -- --void --BGLView::EnableDirectMode(bool enabled) --{ -- if (fRenderer) -- fRenderer->EnableDirectMode(enabled); -- if (fClipInfo == NULL) { -- fClipInfo = new (std::nothrow) glview_direct_info(); -- if (fClipInfo == NULL) -- return; -- } -- -- fClipInfo->enable_direct_mode = enabled; --} -- -- --void --BGLView::_LockDraw() --{ -- if (!fClipInfo || !fClipInfo->enable_direct_mode) -- return; -- -- fDrawLock.Lock(); --} -- -- --void --BGLView::_UnlockDraw() --{ -- if (!fClipInfo || !fClipInfo->enable_direct_mode) -- return; -- -- fDrawLock.Unlock(); --} -- -- --void --BGLView::_CallDirectConnected() --{ -- if (!fClipInfo) -- return; -- -- direct_buffer_info* localInfo = fClipInfo->direct_info; -- direct_buffer_info* info = (direct_buffer_info*)malloc( -- DIRECT_BUFFER_INFO_AREA_SIZE); -- if (info == NULL) -- return; -- -- memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); -- -- // Collect the rects into a BRegion, then clip to the view's bounds -- BRegion region; -- for (uint32 c = 0; c < localInfo->clip_list_count; c++) -- region.Include(localInfo->clip_list[c]); -- BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, -- localInfo->window_bounds.top); -- info->window_bounds = boundsRegion.RectAtInt(0); -- // window_bounds are now view bounds -- region.IntersectWith(&boundsRegion); -- -- info->clip_list_count = region.CountRects(); -- info->clip_bounds = region.FrameInt(); -- -- for (uint32 c = 0; c < info->clip_list_count; c++) -- info->clip_list[c] = region.RectAtInt(c); -- fRenderer->DirectConnected(info); -- free(info); --} -- -- --//---- virtual reserved methods ---------- -- -- --void BGLView::_ReservedGLView1() {} --void BGLView::_ReservedGLView2() {} --void BGLView::_ReservedGLView3() {} --void BGLView::_ReservedGLView4() {} --void BGLView::_ReservedGLView5() {} --void BGLView::_ReservedGLView6() {} --void BGLView::_ReservedGLView7() {} --void BGLView::_ReservedGLView8() {} -- -- --// #pragma mark - -- -- --// BeOS compatibility: contrary to others BView's contructors, --// BGLView one wants a non-const name argument. --BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, -- ulong options) -- : -- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -- fGc(NULL), -- fOptions(options), -- fDitherCount(0), -- fDrawLock("BGLView draw lock"), -- fDisplayLock("BGLView display lock"), -- fClipInfo(NULL), -- fRenderer(NULL), -- fRoster(NULL), -- fDitherMap(NULL) --{ -- fRoster = new GLRendererRoster(this, options); --} -- -- --#if 0 --// TODO: implement BGLScreen class... -- -- --BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, -- status_t* error, bool debug) -- : -- BWindowScreen(name, screenMode, error, debug) --{ --} -- -- --BGLScreen::~BGLScreen() --{ --} -- -- --void --BGLScreen::LockGL() --{ --} -- -- --void --BGLScreen::UnlockGL() --{ --} -- -- --void --BGLScreen::SwapBuffers() --{ --} -- -- --void --BGLScreen::ErrorCallback(unsigned long errorCode) --{ -- // Mesa's GLenum is not ulong but uint! -- char msg[32]; -- sprintf(msg, "GL: Error code $%04lx.", errorCode); -- // debugger(msg); -- fprintf(stderr, "%s\n", msg); -- return; --} -- -- --void --BGLScreen::ScreenConnected(bool enabled) --{ --} -- -- --void --BGLScreen::FrameResized(float width, float height) --{ -- return BWindowScreen::FrameResized(width, height); --} -- -- --status_t --BGLScreen::Perform(perform_code d, void* arg) --{ -- return BWindowScreen::Perform(d, arg); --} -- -- --status_t --BGLScreen::Archive(BMessage* data, bool deep) const --{ -- return BWindowScreen::Archive(data, deep); --} -- -- --void --BGLScreen::MessageReceived(BMessage* msg) --{ -- BWindowScreen::MessageReceived(msg); --} -- -- --void --BGLScreen::Show() --{ -- BWindowScreen::Show(); --} -- -- --void --BGLScreen::Hide() --{ -- BWindowScreen::Hide(); --} -- -- --BHandler* --BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -- int32 form, const char* property) --{ -- return BWindowScreen::ResolveSpecifier(msg, index, specifier, -- form, property); --} -- -- --status_t --BGLScreen::GetSupportedSuites(BMessage* data) --{ -- return BWindowScreen::GetSupportedSuites(data); --} -- -- --//---- virtual reserved methods ---------- -- --void BGLScreen::_ReservedGLScreen1() {} --void BGLScreen::_ReservedGLScreen2() {} --void BGLScreen::_ReservedGLScreen3() {} --void BGLScreen::_ReservedGLScreen4() {} --void BGLScreen::_ReservedGLScreen5() {} --void BGLScreen::_ReservedGLScreen6() {} --void BGLScreen::_ReservedGLScreen7() {} --void BGLScreen::_ReservedGLScreen8() {} --#endif -- -- --const char* color_space_name(color_space space) --{ --#define C2N(a) case a: return #a -- -- switch (space) { -- C2N(B_RGB24); -- C2N(B_RGB32); -- C2N(B_RGBA32); -- C2N(B_RGB32_BIG); -- C2N(B_RGBA32_BIG); -- C2N(B_GRAY8); -- C2N(B_GRAY1); -- C2N(B_RGB16); -- C2N(B_RGB15); -- C2N(B_RGBA15); -- C2N(B_CMAP8); -- default: -- return "Unknown!"; -- }; -- --#undef C2N --}; -- -- --glview_direct_info::glview_direct_info() --{ -- // TODO: See direct_window_data() in app_server's ServerWindow.cpp -- direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); -- direct_connected = false; -- enable_direct_mode = false; --} -- -- --glview_direct_info::~glview_direct_info() --{ -- free(direct_info); --} -- -diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript -deleted file mode 100644 -index 43d15c5..0000000 ---- a/src/gallium/targets/libgl-haiku/SConscript -+++ /dev/null -@@ -1,35 +0,0 @@ --####################################################################### --# SConscript for Haiku OpenGL kit -- --Import('*') -- --env = env.Clone() -- --env.Append(CPPPATH = [ -- '#/src/mapi', -- '#/src/mesa', -- '#/src/mesa/main', -- '#/include/HaikuGL', -- '/boot/system/develop/headers/private', -- Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers --]) -- --env.Prepend(LIBS = [ -- glapi --]) -- --sources = [ -- 'GLView.cpp', -- 'GLRenderer.cpp', -- 'GLRendererRoster.cpp', -- 'GLDispatcher.cpp', --] -- --# libGL.so --libgl = env.SharedLibrary( -- target ='GL', -- source = sources, -- SHLIBSUFFIX = env['SHLIBSUFFIX'], --) -- --env.Alias('libgl-haiku', libgl) -diff --git a/src/hgl/GLDispatcher.cpp b/src/hgl/GLDispatcher.cpp -new file mode 100644 -index 0000000..46b91d5 ---- /dev/null -+++ b/src/hgl/GLDispatcher.cpp -@@ -0,0 +1,72 @@ -+/* -+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Brian Paul -+ * Philippe Houdoin -+ * Alexander von Gluck IV -+ */ -+ -+ -+extern "C" { -+#include "glapi/glapi.h" -+#include "glapi/glapi_priv.h" -+ -+/* -+ * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints -+ * (glAccum, glBegin, etc). -+ * This code IS NOT USED if we're compiling on an x86 system and using -+ * the glapi_x86.S assembly code. -+ */ -+#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) -+ -+#define KEYWORD1 PUBLIC -+#define KEYWORD2 -+#define NAME(func) gl##func -+ -+#define DISPATCH(func, args, msg) \ -+ const struct _glapi_table* dispatch; \ -+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -+ (dispatch->func) args -+ -+#define RETURN_DISPATCH(func, args, msg) \ -+ const struct _glapi_table* dispatch; \ -+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -+ return (dispatch->func) args -+ -+#endif -+} -+ -+ -+/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching -+ C++ wrapper class -+ */ -+ -+#include "GLDispatcher.h" -+ -+BGLDispatcher::BGLDispatcher() -+{ -+} -+ -+ -+BGLDispatcher::~BGLDispatcher() -+{ -+} -+ -+ -+status_t -+BGLDispatcher::CheckTable(const struct _glapi_table* table) -+{ -+ _glapi_check_table(table ? table : _glapi_get_dispatch()); -+ return B_OK; -+} -+ -+ -+status_t -+BGLDispatcher::SetTable(struct _glapi_table* table) -+{ -+ _glapi_set_dispatch(table); -+ return B_OK; -+} -diff --git a/src/hgl/GLDispatcher.h b/src/hgl/GLDispatcher.h -new file mode 100644 -index 0000000..44bca8c ---- /dev/null -+++ b/src/hgl/GLDispatcher.h -@@ -0,0 +1,109 @@ -+/* -+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Brian Paul -+ * Philippe Houdoin -+ */ -+#ifndef GLDISPATCHER_H -+#define GLDISPATCHER_H -+ -+ -+#include -+#include -+#include -+ -+#include "glheader.h" -+ -+extern "C" { -+#include "glapi/glapi.h" -+} -+ -+ -+class BGLDispatcher -+{ -+ // Private unimplemented copy constructors -+ BGLDispatcher(const BGLDispatcher &); -+ BGLDispatcher & operator=(const BGLDispatcher &); -+ -+ public: -+ BGLDispatcher(); -+ ~BGLDispatcher(); -+ -+ void SetCurrentContext(void* context); -+ void* CurrentContext(); -+ -+ struct _glapi_table* Table(); -+ status_t CheckTable( -+ const struct _glapi_table* dispatch = NULL); -+ status_t SetTable(struct _glapi_table* dispatch); -+ uint32 TableSize(); -+ -+ const _glapi_proc operator[](const char* functionName); -+ const char* operator[](uint32 offset); -+ -+ const _glapi_proc AddressOf(const char* functionName); -+ uint32 OffsetOf(const char* functionName); -+}; -+ -+ -+// Inlines methods -+inline void -+BGLDispatcher::SetCurrentContext(void* context) -+{ -+ _glapi_set_context(context); -+} -+ -+ -+inline void* -+BGLDispatcher::CurrentContext() -+{ -+ return _glapi_get_context(); -+} -+ -+ -+inline struct _glapi_table* -+BGLDispatcher::Table() -+{ -+ return _glapi_get_dispatch(); -+} -+ -+ -+inline uint32 -+BGLDispatcher::TableSize() -+{ -+ return _glapi_get_dispatch_table_size(); -+} -+ -+ -+inline const _glapi_proc -+BGLDispatcher::operator[](const char* functionName) -+{ -+ return _glapi_get_proc_address(functionName); -+} -+ -+ -+inline const char* -+BGLDispatcher::operator[](uint32 offset) -+{ -+ return _glapi_get_proc_name((GLuint) offset); -+} -+ -+ -+inline const _glapi_proc -+BGLDispatcher::AddressOf(const char* functionName) -+{ -+ return _glapi_get_proc_address(functionName); -+} -+ -+ -+inline uint32 -+BGLDispatcher::OffsetOf(const char* functionName) -+{ -+ return (uint32) _glapi_get_proc_offset(functionName); -+} -+ -+ -+#endif // GLDISPATCHER_H -diff --git a/src/hgl/GLRenderer.cpp b/src/hgl/GLRenderer.cpp -new file mode 100644 -index 0000000..4573a64 ---- /dev/null -+++ b/src/hgl/GLRenderer.cpp -@@ -0,0 +1,106 @@ -+/* -+ * Copyright 2006-2008, Philippe Houdoin. All rights reserved. -+ * Distributed under the terms of the MIT License. -+ */ -+ -+ -+#include -+ -+#include "GLRenderer.h" -+ -+#include "GLDispatcher.h" -+ -+ -+BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, -+ BGLDispatcher* dispatcher) -+ : -+ fRefCount(1), -+ fView(view), -+ fOptions(glOptions), -+ fDispatcher(dispatcher) -+{ -+} -+ -+ -+BGLRenderer::~BGLRenderer() -+{ -+ delete fDispatcher; -+} -+ -+ -+void -+BGLRenderer::Acquire() -+{ -+ atomic_add(&fRefCount, 1); -+} -+ -+ -+void -+BGLRenderer::Release() -+{ -+ if (atomic_add(&fRefCount, -1) < 1) -+ delete this; -+} -+ -+ -+void -+BGLRenderer::LockGL() -+{ -+} -+ -+ -+void -+BGLRenderer::UnlockGL() -+{ -+} -+ -+ -+void -+BGLRenderer::SwapBuffers(bool VSync) -+{ -+} -+ -+ -+void -+BGLRenderer::Draw(BRect updateRect) -+{ -+} -+ -+ -+status_t -+BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) -+{ -+ return B_ERROR; -+} -+ -+ -+status_t -+BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) -+{ -+ return B_ERROR; -+} -+ -+ -+void -+BGLRenderer::FrameResized(float width, float height) -+{ -+} -+ -+ -+void -+BGLRenderer::DirectConnected(direct_buffer_info* info) -+{ -+} -+ -+ -+void -+BGLRenderer::EnableDirectMode(bool enabled) -+{ -+} -+ -+ -+status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } -diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp -new file mode 100644 -index 0000000..1712a87 ---- /dev/null -+++ b/src/hgl/GLRendererRoster.cpp -@@ -0,0 +1,224 @@ -+/* -+ * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Philippe Houdoin -+ * Alexander von Gluck IV -+ */ -+ -+ -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include "GLDispatcher.h" -+#include "GLRendererRoster.h" -+ -+#include -+#include -+ -+ -+extern "C" status_t _kern_get_safemode_option(const char* parameter, -+ char* buffer, size_t* _bufferSize); -+ -+ -+GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) -+ : -+ fNextID(0), -+ fView(view), -+ fOptions(options), -+ fSafeMode(false), -+ fABISubDirectory(NULL) -+{ -+ char parameter[32]; -+ size_t parameterLength = sizeof(parameter); -+ -+ if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, -+ parameter, ¶meterLength) == B_OK) { -+ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -+ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -+ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -+ fSafeMode = true; -+ } -+ -+ if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, -+ parameter, ¶meterLength) == B_OK) { -+ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -+ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -+ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -+ fSafeMode = true; -+ } -+ -+ // We might run in compatibility mode on a system with a different ABI. The -+ // renderers matching our ABI can usually be found in respective -+ // subdirectories of the opengl add-ons directories. -+ system_info info; -+ if (get_system_info(&info) == B_OK -+ && (info.abi & B_HAIKU_ABI_MAJOR) -+ != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { -+ switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { -+ case B_HAIKU_ABI_GCC_2: -+ fABISubDirectory = "gcc2"; -+ break; -+ case B_HAIKU_ABI_GCC_4: -+ fABISubDirectory = "gcc4"; -+ break; -+ } -+ } -+ -+ AddDefaultPaths(); -+} -+ -+ -+GLRendererRoster::~GLRendererRoster() -+{ -+ -+} -+ -+ -+BGLRenderer* -+GLRendererRoster::GetRenderer(int32 id) -+{ -+ RendererMap::const_iterator iterator = fRenderers.find(id); -+ if (iterator == fRenderers.end()) -+ return NULL; -+ -+ struct renderer_item item = iterator->second; -+ return item.renderer; -+} -+ -+ -+void -+GLRendererRoster::AddDefaultPaths() -+{ -+ // add user directories first, so that they can override system renderers -+ const directory_which paths[] = { -+ B_USER_NONPACKAGED_ADDONS_DIRECTORY, -+ B_USER_ADDONS_DIRECTORY, -+ B_SYSTEM_ADDONS_DIRECTORY, -+ }; -+ -+ for (uint32 i = fSafeMode ? 4 : 0; -+ i < sizeof(paths) / sizeof(paths[0]); i++) { -+ BPath path; -+ status_t status = find_directory(paths[i], &path, true); -+ if (status == B_OK && path.Append("opengl") == B_OK) -+ AddPath(path.Path()); -+ } -+} -+ -+ -+status_t -+GLRendererRoster::AddPath(const char* path) -+{ -+ BDirectory directory(path); -+ status_t status = directory.InitCheck(); -+ if (status < B_OK) -+ return status; -+ -+ // if a subdirectory for our ABI exists, use that instead -+ if (fABISubDirectory != NULL) { -+ BEntry entry(&directory, fABISubDirectory); -+ if (entry.IsDirectory()) { -+ status = directory.SetTo(&entry); -+ if (status != B_OK) -+ return status; -+ } -+ } -+ -+ node_ref nodeRef; -+ status = directory.GetNodeRef(&nodeRef); -+ if (status < B_OK) -+ return status; -+ -+ int32 count = 0; -+ int32 files = 0; -+ -+ entry_ref ref; -+ BEntry entry; -+ while (directory.GetNextRef(&ref) == B_OK) { -+ entry.SetTo(&ref); -+ if (entry.InitCheck() == B_OK && !entry.IsFile()) -+ continue; -+ -+ if (CreateRenderer(ref) == B_OK) -+ count++; -+ -+ files++; -+ } -+ -+ if (files != 0 && count == 0) -+ return B_BAD_VALUE; -+ -+ return B_OK; -+} -+ -+ -+status_t -+GLRendererRoster::AddRenderer(BGLRenderer* renderer, -+ image_id image, const entry_ref* ref, ino_t node) -+{ -+ renderer_item item; -+ item.renderer = renderer; -+ item.image = image; -+ item.node = node; -+ if (ref != NULL) -+ item.ref = *ref; -+ -+ try { -+ fRenderers[fNextID] = item; -+ } catch (...) { -+ return B_NO_MEMORY; -+ } -+ -+ renderer->fOwningRoster = this; -+ renderer->fID = fNextID++; -+ return B_OK; -+} -+ -+ -+status_t -+GLRendererRoster::CreateRenderer(const entry_ref& ref) -+{ -+ BEntry entry(&ref); -+ node_ref nodeRef; -+ status_t status = entry.GetNodeRef(&nodeRef); -+ if (status < B_OK) -+ return status; -+ -+ BPath path(&ref); -+ image_id image = load_add_on(path.Path()); -+ if (image < B_OK) -+ return image; -+ -+ BGLRenderer* (*instantiate_renderer) -+ (BGLView* view, ulong options, BGLDispatcher* dispatcher); -+ -+ status = get_image_symbol(image, "instantiate_gl_renderer", -+ B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); -+ if (status == B_OK) { -+ BGLRenderer* renderer -+ = instantiate_renderer(fView, fOptions, new BGLDispatcher()); -+ if (!renderer) { -+ unload_add_on(image); -+ return B_UNSUPPORTED; -+ } -+ -+ if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { -+ renderer->Release(); -+ // this will delete the renderer -+ unload_add_on(image); -+ } -+ return B_OK; -+ } -+ unload_add_on(image); -+ -+ return status; -+} -diff --git a/src/hgl/GLRendererRoster.h b/src/hgl/GLRendererRoster.h -new file mode 100644 -index 0000000..5c8da27 ---- /dev/null -+++ b/src/hgl/GLRendererRoster.h -@@ -0,0 +1,51 @@ -+/* -+ * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Philippe Houdoin -+ */ -+#ifndef _GLRENDERER_ROSTER_H -+#define _GLRENDERER_ROSTER_H -+ -+ -+#include -+ -+#include -+ -+ -+struct renderer_item { -+ BGLRenderer* renderer; -+ entry_ref ref; -+ ino_t node; -+ image_id image; -+}; -+ -+typedef std::map RendererMap; -+ -+ -+class GLRendererRoster { -+ public: -+ GLRendererRoster(BGLView* view, ulong options); -+ virtual ~GLRendererRoster(); -+ -+ BGLRenderer* GetRenderer(int32 id = 0); -+ -+ private: -+ void AddDefaultPaths(); -+ status_t AddPath(const char* path); -+ status_t AddRenderer(BGLRenderer* renderer, -+ image_id image, const entry_ref* ref, ino_t node); -+ status_t CreateRenderer(const entry_ref& ref); -+ -+ RendererMap fRenderers; -+ int32 fNextID; -+ BGLView* fView; -+ ulong fOptions; -+ bool fSafeMode; -+ const char* fABISubDirectory; -+ -+}; -+ -+ -+#endif /* _GLRENDERER_ROSTER_H */ -diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp -new file mode 100644 -index 0000000..9ae5b5c ---- /dev/null -+++ b/src/hgl/GLView.cpp -@@ -0,0 +1,643 @@ -+/* -+ * Copyright 2006-2012, Haiku. All rights reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Jérôme Duval, korli@users.berlios.de -+ * Philippe Houdoin, philippe.houdoin@free.fr -+ * Stefano Ceccherini, burton666@libero.it -+ */ -+ -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include "interface/DirectWindowPrivate.h" -+#include "GLDispatcher.h" -+#include "GLRendererRoster.h" -+ -+ -+struct glview_direct_info { -+ direct_buffer_info* direct_info; -+ bool direct_connected; -+ bool enable_direct_mode; -+ -+ glview_direct_info(); -+ ~glview_direct_info(); -+}; -+ -+ -+BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, -+ ulong options) -+ : -+ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -+ // | B_FULL_UPDATE_ON_RESIZE) -+ fGc(NULL), -+ fOptions(options), -+ fDitherCount(0), -+ fDrawLock("BGLView draw lock"), -+ fDisplayLock("BGLView display lock"), -+ fClipInfo(NULL), -+ fRenderer(NULL), -+ fRoster(NULL), -+ fDitherMap(NULL) -+{ -+ fRoster = new GLRendererRoster(this, options); -+} -+ -+ -+BGLView::~BGLView() -+{ -+ delete fClipInfo; -+ if (fRenderer) -+ fRenderer->Release(); -+} -+ -+ -+void -+BGLView::LockGL() -+{ -+ // TODO: acquire the OpenGL API lock it on this glview -+ -+ fDisplayLock.Lock(); -+ if (fRenderer) -+ fRenderer->LockGL(); -+} -+ -+ -+void -+BGLView::UnlockGL() -+{ -+ if (fRenderer) -+ fRenderer->UnlockGL(); -+ fDisplayLock.Unlock(); -+ -+ // TODO: release the GL API lock to others glviews -+} -+ -+ -+void -+BGLView::SwapBuffers() -+{ -+ SwapBuffers(false); -+} -+ -+ -+void -+BGLView::SwapBuffers(bool vSync) -+{ -+ if (fRenderer) { -+ _LockDraw(); -+ fRenderer->SwapBuffers(vSync); -+ _UnlockDraw(); -+ } -+} -+ -+ -+BView* -+BGLView::EmbeddedView() -+{ -+ return NULL; -+} -+ -+ -+void* -+BGLView::GetGLProcAddress(const char* procName) -+{ -+ BGLDispatcher* glDispatcher = NULL; -+ -+ if (fRenderer) -+ glDispatcher = fRenderer->GLDispatcher(); -+ -+ if (glDispatcher) -+ return (void*)glDispatcher->AddressOf(procName); -+ -+ return NULL; -+} -+ -+ -+status_t -+BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) -+{ -+ if (!fRenderer) -+ return B_ERROR; -+ -+ if (!dest || !dest->Bounds().IsValid()) -+ return B_BAD_VALUE; -+ -+ return fRenderer->CopyPixelsOut(source, dest); -+} -+ -+ -+status_t -+BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) -+{ -+ if (!fRenderer) -+ return B_ERROR; -+ -+ if (!source || !source->Bounds().IsValid()) -+ return B_BAD_VALUE; -+ -+ return fRenderer->CopyPixelsIn(source, dest); -+} -+ -+ -+/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum -+ without breaking this method signature. -+ Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: -+ unsigned long. -+ */ -+void -+BGLView::ErrorCallback(unsigned long errorCode) -+{ -+ char msg[32]; -+ sprintf(msg, "GL: Error code $%04lx.", errorCode); -+ // TODO: under BeOS R5, it call debugger(msg); -+ fprintf(stderr, "%s\n", msg); -+} -+ -+ -+void -+BGLView::Draw(BRect updateRect) -+{ -+ if (fRenderer) { -+ _LockDraw(); -+ fRenderer->Draw(updateRect); -+ _UnlockDraw(); -+ return; -+ } -+ // TODO: auto-size and center the string -+ MovePenTo(8, 32); -+ DrawString("No OpenGL renderer available!"); -+} -+ -+ -+void -+BGLView::AttachedToWindow() -+{ -+ BView::AttachedToWindow(); -+ -+ fBounds = Bounds(); -+ for (BView* view = this; view != NULL; view = view->Parent()) -+ view->ConvertToParent(&fBounds); -+ -+ fRenderer = fRoster->GetRenderer(); -+ if (fRenderer != NULL) { -+ // Jackburton: The following code was commented because it doesn't look -+ // good in "direct" mode: -+ // when the window is moved, the app_server doesn't paint the view's -+ // background, and the stuff behind the window itself shows up. -+ // Setting the view color to black, instead, looks a bit more elegant. -+#if 0 -+ // Don't paint white window background when resized -+ SetViewColor(B_TRANSPARENT_32_BIT); -+#else -+ SetViewColor(0, 0, 0); -+#endif -+ -+ // Set default OpenGL viewport: -+ LockGL(); -+ glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); -+ UnlockGL(); -+ fRenderer->FrameResized(Bounds().IntegerWidth(), -+ Bounds().IntegerHeight()); -+ -+ if (fClipInfo) { -+ fRenderer->DirectConnected(fClipInfo->direct_info); -+ fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); -+ } -+ -+ return; -+ } -+ -+ fprintf(stderr, "no renderer found! \n"); -+ -+ // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing -+ // context -+ SetFont(be_bold_font); -+ // SetFontSize(16); -+} -+ -+ -+void -+BGLView::AllAttached() -+{ -+ BView::AllAttached(); -+} -+ -+ -+void -+BGLView::DetachedFromWindow() -+{ -+ if (fRenderer) -+ fRenderer->Release(); -+ fRenderer = NULL; -+ -+ BView::DetachedFromWindow(); -+} -+ -+ -+void -+BGLView::AllDetached() -+{ -+ BView::AllDetached(); -+} -+ -+ -+void -+BGLView::FrameResized(float width, float height) -+{ -+ fBounds = Bounds(); -+ for (BView* v = this; v; v = v->Parent()) -+ v->ConvertToParent(&fBounds); -+ -+ if (fRenderer) { -+ LockGL(); -+ _LockDraw(); -+ _CallDirectConnected(); -+ fRenderer->FrameResized(width, height); -+ _UnlockDraw(); -+ UnlockGL(); -+ } -+ -+ BView::FrameResized(width, height); -+} -+ -+ -+status_t -+BGLView::Perform(perform_code d, void* arg) -+{ -+ return BView::Perform(d, arg); -+} -+ -+ -+status_t -+BGLView::Archive(BMessage* data, bool deep) const -+{ -+ return BView::Archive(data, deep); -+} -+ -+ -+void -+BGLView::MessageReceived(BMessage* msg) -+{ -+ BView::MessageReceived(msg); -+} -+ -+ -+void -+BGLView::SetResizingMode(uint32 mode) -+{ -+ BView::SetResizingMode(mode); -+} -+ -+ -+void -+BGLView::GetPreferredSize(float* _width, float* _height) -+{ -+ if (_width) -+ *_width = 0; -+ if (_height) -+ *_height = 0; -+} -+ -+ -+void -+BGLView::Show() -+{ -+ BView::Show(); -+} -+ -+ -+void -+BGLView::Hide() -+{ -+ BView::Hide(); -+} -+ -+ -+BHandler* -+BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -+ int32 form, const char* property) -+{ -+ return BView::ResolveSpecifier(msg, index, specifier, form, property); -+} -+ -+ -+status_t -+BGLView::GetSupportedSuites(BMessage* data) -+{ -+ return BView::GetSupportedSuites(data); -+} -+ -+ -+void -+BGLView::DirectConnected(direct_buffer_info* info) -+{ -+ if (fClipInfo == NULL) { -+ fClipInfo = new (std::nothrow) glview_direct_info(); -+ if (fClipInfo == NULL) -+ return; -+ } -+ -+ direct_buffer_info* localInfo = fClipInfo->direct_info; -+ -+ switch (info->buffer_state & B_DIRECT_MODE_MASK) { -+ case B_DIRECT_START: -+ fClipInfo->direct_connected = true; -+ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -+ _UnlockDraw(); -+ break; -+ -+ case B_DIRECT_MODIFY: -+ _LockDraw(); -+ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -+ _UnlockDraw(); -+ break; -+ -+ case B_DIRECT_STOP: -+ fClipInfo->direct_connected = false; -+ _LockDraw(); -+ break; -+ } -+ -+ if (fRenderer) -+ _CallDirectConnected(); -+} -+ -+ -+void -+BGLView::EnableDirectMode(bool enabled) -+{ -+ if (fRenderer) -+ fRenderer->EnableDirectMode(enabled); -+ if (fClipInfo == NULL) { -+ fClipInfo = new (std::nothrow) glview_direct_info(); -+ if (fClipInfo == NULL) -+ return; -+ } -+ -+ fClipInfo->enable_direct_mode = enabled; -+} -+ -+ -+void -+BGLView::_LockDraw() -+{ -+ if (!fClipInfo || !fClipInfo->enable_direct_mode) -+ return; -+ -+ fDrawLock.Lock(); -+} -+ -+ -+void -+BGLView::_UnlockDraw() -+{ -+ if (!fClipInfo || !fClipInfo->enable_direct_mode) -+ return; -+ -+ fDrawLock.Unlock(); -+} -+ -+ -+void -+BGLView::_CallDirectConnected() -+{ -+ if (!fClipInfo) -+ return; -+ -+ direct_buffer_info* localInfo = fClipInfo->direct_info; -+ direct_buffer_info* info = (direct_buffer_info*)malloc( -+ DIRECT_BUFFER_INFO_AREA_SIZE); -+ if (info == NULL) -+ return; -+ -+ memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); -+ -+ // Collect the rects into a BRegion, then clip to the view's bounds -+ BRegion region; -+ for (uint32 c = 0; c < localInfo->clip_list_count; c++) -+ region.Include(localInfo->clip_list[c]); -+ BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, -+ localInfo->window_bounds.top); -+ info->window_bounds = boundsRegion.RectAtInt(0); -+ // window_bounds are now view bounds -+ region.IntersectWith(&boundsRegion); -+ -+ info->clip_list_count = region.CountRects(); -+ info->clip_bounds = region.FrameInt(); -+ -+ for (uint32 c = 0; c < info->clip_list_count; c++) -+ info->clip_list[c] = region.RectAtInt(c); -+ fRenderer->DirectConnected(info); -+ free(info); -+} -+ -+ -+//---- virtual reserved methods ---------- -+ -+ -+void BGLView::_ReservedGLView1() {} -+void BGLView::_ReservedGLView2() {} -+void BGLView::_ReservedGLView3() {} -+void BGLView::_ReservedGLView4() {} -+void BGLView::_ReservedGLView5() {} -+void BGLView::_ReservedGLView6() {} -+void BGLView::_ReservedGLView7() {} -+void BGLView::_ReservedGLView8() {} -+ -+ -+// #pragma mark - -+ -+ -+// BeOS compatibility: contrary to others BView's contructors, -+// BGLView one wants a non-const name argument. -+BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, -+ ulong options) -+ : -+ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -+ fGc(NULL), -+ fOptions(options), -+ fDitherCount(0), -+ fDrawLock("BGLView draw lock"), -+ fDisplayLock("BGLView display lock"), -+ fClipInfo(NULL), -+ fRenderer(NULL), -+ fRoster(NULL), -+ fDitherMap(NULL) -+{ -+ fRoster = new GLRendererRoster(this, options); -+} -+ -+ -+#if 0 -+// TODO: implement BGLScreen class... -+ -+ -+BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, -+ status_t* error, bool debug) -+ : -+ BWindowScreen(name, screenMode, error, debug) -+{ -+} -+ -+ -+BGLScreen::~BGLScreen() -+{ -+} -+ -+ -+void -+BGLScreen::LockGL() -+{ -+} -+ -+ -+void -+BGLScreen::UnlockGL() -+{ -+} -+ -+ -+void -+BGLScreen::SwapBuffers() -+{ -+} -+ -+ -+void -+BGLScreen::ErrorCallback(unsigned long errorCode) -+{ -+ // Mesa's GLenum is not ulong but uint! -+ char msg[32]; -+ sprintf(msg, "GL: Error code $%04lx.", errorCode); -+ // debugger(msg); -+ fprintf(stderr, "%s\n", msg); -+ return; -+} -+ -+ -+void -+BGLScreen::ScreenConnected(bool enabled) -+{ -+} -+ -+ -+void -+BGLScreen::FrameResized(float width, float height) -+{ -+ return BWindowScreen::FrameResized(width, height); -+} -+ -+ -+status_t -+BGLScreen::Perform(perform_code d, void* arg) -+{ -+ return BWindowScreen::Perform(d, arg); -+} -+ -+ -+status_t -+BGLScreen::Archive(BMessage* data, bool deep) const -+{ -+ return BWindowScreen::Archive(data, deep); -+} -+ -+ -+void -+BGLScreen::MessageReceived(BMessage* msg) -+{ -+ BWindowScreen::MessageReceived(msg); -+} -+ -+ -+void -+BGLScreen::Show() -+{ -+ BWindowScreen::Show(); -+} -+ -+ -+void -+BGLScreen::Hide() -+{ -+ BWindowScreen::Hide(); -+} -+ -+ -+BHandler* -+BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -+ int32 form, const char* property) -+{ -+ return BWindowScreen::ResolveSpecifier(msg, index, specifier, -+ form, property); -+} -+ -+ -+status_t -+BGLScreen::GetSupportedSuites(BMessage* data) -+{ -+ return BWindowScreen::GetSupportedSuites(data); -+} -+ -+ -+//---- virtual reserved methods ---------- -+ -+void BGLScreen::_ReservedGLScreen1() {} -+void BGLScreen::_ReservedGLScreen2() {} -+void BGLScreen::_ReservedGLScreen3() {} -+void BGLScreen::_ReservedGLScreen4() {} -+void BGLScreen::_ReservedGLScreen5() {} -+void BGLScreen::_ReservedGLScreen6() {} -+void BGLScreen::_ReservedGLScreen7() {} -+void BGLScreen::_ReservedGLScreen8() {} -+#endif -+ -+ -+const char* color_space_name(color_space space) -+{ -+#define C2N(a) case a: return #a -+ -+ switch (space) { -+ C2N(B_RGB24); -+ C2N(B_RGB32); -+ C2N(B_RGBA32); -+ C2N(B_RGB32_BIG); -+ C2N(B_RGBA32_BIG); -+ C2N(B_GRAY8); -+ C2N(B_GRAY1); -+ C2N(B_RGB16); -+ C2N(B_RGB15); -+ C2N(B_RGBA15); -+ C2N(B_CMAP8); -+ default: -+ return "Unknown!"; -+ }; -+ -+#undef C2N -+}; -+ -+ -+glview_direct_info::glview_direct_info() -+{ -+ // TODO: See direct_window_data() in app_server's ServerWindow.cpp -+ direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); -+ direct_connected = false; -+ enable_direct_mode = false; -+} -+ -+ -+glview_direct_info::~glview_direct_info() -+{ -+ free(direct_info); -+} -+ -diff --git a/src/hgl/SConscript b/src/hgl/SConscript -new file mode 100644 -index 0000000..70db149 ---- /dev/null -+++ b/src/hgl/SConscript -@@ -0,0 +1,36 @@ -+####################################################################### -+# SConscript for Haiku OpenGL kit -+ -+Import('*') -+ -+env = env.Clone() -+ -+env.Append(CPPPATH = [ -+ '#/src/mapi', -+ '#/src/mesa', -+ '#/src/mesa/main', -+ '#/include/HaikuGL', -+ '/boot/system/develop/headers/private', -+ Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers -+]) -+ -+env.Prepend(LIBS = [ -+ glapi -+]) -+ -+sources = [ -+ 'GLView.cpp', -+ 'GLRenderer.cpp', -+ 'GLRendererRoster.cpp', -+ 'GLDispatcher.cpp', -+] -+ -+# libGL.so -+libgl = env.SharedLibrary( -+ target ='GL', -+ source = sources, -+ SHLIBSUFFIX = env['SHLIBSUFFIX'], -+) -+ -+env.Alias('libgl-haiku', libgl) -+Export('libgl') -diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript -index ca0423e..aef7300 100644 ---- a/src/mesa/drivers/haiku/swrast/SConscript -+++ b/src/mesa/drivers/haiku/swrast/SConscript -@@ -16,6 +16,8 @@ env.Prepend(LIBS = [ - mesa, - ]) - -+env.Prepend(LIBS = [libgl]) -+ - sources = [ - 'SoftwareRast.cpp' - ] --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.0.2.patchset b/sys-libs/mesa/patches/mesa-10.0.2.patchset deleted file mode 100644 index 5439c7159..000000000 --- a/sys-libs/mesa/patches/mesa-10.0.2.patchset +++ /dev/null @@ -1,2770 +0,0 @@ -From 880e1a26af698949add259ef80bc3e0e4aa55188 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Mon, 30 Dec 2013 23:49:06 -0600 -Subject: haiku: Fix missing HaikuGL header paths - - -diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript -index 40bf03c..16ce7cd 100644 ---- a/src/gallium/targets/haiku-softpipe/SConscript -+++ b/src/gallium/targets/haiku-softpipe/SConscript -@@ -21,6 +21,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '#/src/gallium/winsys/sw/hgl', - '/boot/system/develop/headers/private', - ]) -diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript -index 2e6b628..43d15c5 100644 ---- a/src/gallium/targets/libgl-haiku/SConscript -+++ b/src/gallium/targets/libgl-haiku/SConscript -@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '/boot/system/develop/headers/private', - Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers - ]) -diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript -index 71ce88e..ca0423e 100644 ---- a/src/mesa/drivers/haiku/swrast/SConscript -+++ b/src/mesa/drivers/haiku/swrast/SConscript -@@ -6,6 +6,7 @@ env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', -+ '#/include/HaikuGL', - '/boot/system/develop/headers/private', - Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers - ]) --- -1.8.3.4 - - -From add021d06196b1250454496cb3fb5b39746e2739 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Tue, 31 Dec 2013 15:39:49 -0600 -Subject: haiku libGL: Move from gallium target to src/hgl - -* The Haiku renderers need to link to libGL to function properly - in all usage contexts. As mesa drivers build before gallium - targets, we couldn't properly link the mesa swrast driver to - the gallium libGL target for Haiku. -* This is likely better as it mimics how glx is laid out ensuring - the Haiku libGL is better understood. -* All renderers properly link in libGL now. - -diff --git a/src/SConscript b/src/SConscript -index 1465918..a24acea 100644 ---- a/src/SConscript -+++ b/src/SConscript -@@ -18,6 +18,11 @@ if env['hostonly']: - # enable OpenGL ES support. - SConscript('mapi/glapi/gen/SConscript') - SConscript('mapi/glapi/SConscript') -+ -+# Haiku C++ libGL dispatch (renderers depend on libgl) -+if env['platform'] in ['haiku']: -+ SConscript('hgl/SConscript') -+ - SConscript('mesa/SConscript') - - SConscript('mapi/vgapi/SConscript') -diff --git a/src/gallium/SConscript b/src/gallium/SConscript -index c68519d..7ba8070 100644 ---- a/src/gallium/SConscript -+++ b/src/gallium/SConscript -@@ -119,7 +119,6 @@ if not env['embedded']: - if env['platform'] == 'haiku': - SConscript([ - 'targets/haiku-softpipe/SConscript', -- 'targets/libgl-haiku/SConscript', - ]) - - if env['dri']: -diff --git a/src/gallium/targets/haiku-softpipe/SConscript b/src/gallium/targets/haiku-softpipe/SConscript -index 16ce7cd..0381d05 100644 ---- a/src/gallium/targets/haiku-softpipe/SConscript -+++ b/src/gallium/targets/haiku-softpipe/SConscript -@@ -17,6 +17,8 @@ if True: - ]) - env.Prepend(LIBS = [softpipe]) - -+env.Prepend(LIBS = [libgl]) -+ - env.Append(CPPPATH = [ - '#/src/mapi', - '#/src/mesa', -diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp b/src/gallium/targets/libgl-haiku/GLDispatcher.cpp -deleted file mode 100644 -index 46b91d5..0000000 ---- a/src/gallium/targets/libgl-haiku/GLDispatcher.cpp -+++ /dev/null -@@ -1,72 +0,0 @@ --/* -- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Brian Paul -- * Philippe Houdoin -- * Alexander von Gluck IV -- */ -- -- --extern "C" { --#include "glapi/glapi.h" --#include "glapi/glapi_priv.h" -- --/* -- * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints -- * (glAccum, glBegin, etc). -- * This code IS NOT USED if we're compiling on an x86 system and using -- * the glapi_x86.S assembly code. -- */ --#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) -- --#define KEYWORD1 PUBLIC --#define KEYWORD2 --#define NAME(func) gl##func -- --#define DISPATCH(func, args, msg) \ -- const struct _glapi_table* dispatch; \ -- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -- (dispatch->func) args -- --#define RETURN_DISPATCH(func, args, msg) \ -- const struct _glapi_table* dispatch; \ -- dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -- return (dispatch->func) args -- --#endif --} -- -- --/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching -- C++ wrapper class -- */ -- --#include "GLDispatcher.h" -- --BGLDispatcher::BGLDispatcher() --{ --} -- -- --BGLDispatcher::~BGLDispatcher() --{ --} -- -- --status_t --BGLDispatcher::CheckTable(const struct _glapi_table* table) --{ -- _glapi_check_table(table ? table : _glapi_get_dispatch()); -- return B_OK; --} -- -- --status_t --BGLDispatcher::SetTable(struct _glapi_table* table) --{ -- _glapi_set_dispatch(table); -- return B_OK; --} -diff --git a/src/gallium/targets/libgl-haiku/GLDispatcher.h b/src/gallium/targets/libgl-haiku/GLDispatcher.h -deleted file mode 100644 -index 44bca8c..0000000 ---- a/src/gallium/targets/libgl-haiku/GLDispatcher.h -+++ /dev/null -@@ -1,109 +0,0 @@ --/* -- * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -- * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Brian Paul -- * Philippe Houdoin -- */ --#ifndef GLDISPATCHER_H --#define GLDISPATCHER_H -- -- --#include --#include --#include -- --#include "glheader.h" -- --extern "C" { --#include "glapi/glapi.h" --} -- -- --class BGLDispatcher --{ -- // Private unimplemented copy constructors -- BGLDispatcher(const BGLDispatcher &); -- BGLDispatcher & operator=(const BGLDispatcher &); -- -- public: -- BGLDispatcher(); -- ~BGLDispatcher(); -- -- void SetCurrentContext(void* context); -- void* CurrentContext(); -- -- struct _glapi_table* Table(); -- status_t CheckTable( -- const struct _glapi_table* dispatch = NULL); -- status_t SetTable(struct _glapi_table* dispatch); -- uint32 TableSize(); -- -- const _glapi_proc operator[](const char* functionName); -- const char* operator[](uint32 offset); -- -- const _glapi_proc AddressOf(const char* functionName); -- uint32 OffsetOf(const char* functionName); --}; -- -- --// Inlines methods --inline void --BGLDispatcher::SetCurrentContext(void* context) --{ -- _glapi_set_context(context); --} -- -- --inline void* --BGLDispatcher::CurrentContext() --{ -- return _glapi_get_context(); --} -- -- --inline struct _glapi_table* --BGLDispatcher::Table() --{ -- return _glapi_get_dispatch(); --} -- -- --inline uint32 --BGLDispatcher::TableSize() --{ -- return _glapi_get_dispatch_table_size(); --} -- -- --inline const _glapi_proc --BGLDispatcher::operator[](const char* functionName) --{ -- return _glapi_get_proc_address(functionName); --} -- -- --inline const char* --BGLDispatcher::operator[](uint32 offset) --{ -- return _glapi_get_proc_name((GLuint) offset); --} -- -- --inline const _glapi_proc --BGLDispatcher::AddressOf(const char* functionName) --{ -- return _glapi_get_proc_address(functionName); --} -- -- --inline uint32 --BGLDispatcher::OffsetOf(const char* functionName) --{ -- return (uint32) _glapi_get_proc_offset(functionName); --} -- -- --#endif // GLDISPATCHER_H -diff --git a/src/gallium/targets/libgl-haiku/GLRenderer.cpp b/src/gallium/targets/libgl-haiku/GLRenderer.cpp -deleted file mode 100644 -index 4573a64..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRenderer.cpp -+++ /dev/null -@@ -1,106 +0,0 @@ --/* -- * Copyright 2006-2008, Philippe Houdoin. All rights reserved. -- * Distributed under the terms of the MIT License. -- */ -- -- --#include -- --#include "GLRenderer.h" -- --#include "GLDispatcher.h" -- -- --BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, -- BGLDispatcher* dispatcher) -- : -- fRefCount(1), -- fView(view), -- fOptions(glOptions), -- fDispatcher(dispatcher) --{ --} -- -- --BGLRenderer::~BGLRenderer() --{ -- delete fDispatcher; --} -- -- --void --BGLRenderer::Acquire() --{ -- atomic_add(&fRefCount, 1); --} -- -- --void --BGLRenderer::Release() --{ -- if (atomic_add(&fRefCount, -1) < 1) -- delete this; --} -- -- --void --BGLRenderer::LockGL() --{ --} -- -- --void --BGLRenderer::UnlockGL() --{ --} -- -- --void --BGLRenderer::SwapBuffers(bool VSync) --{ --} -- -- --void --BGLRenderer::Draw(BRect updateRect) --{ --} -- -- --status_t --BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) --{ -- return B_ERROR; --} -- -- --status_t --BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) --{ -- return B_ERROR; --} -- -- --void --BGLRenderer::FrameResized(float width, float height) --{ --} -- -- --void --BGLRenderer::DirectConnected(direct_buffer_info* info) --{ --} -- -- --void --BGLRenderer::EnableDirectMode(bool enabled) --{ --} -- -- --status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } --status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } -diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp b/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp -deleted file mode 100644 -index 1712a87..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRendererRoster.cpp -+++ /dev/null -@@ -1,224 +0,0 @@ --/* -- * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Philippe Houdoin -- * Alexander von Gluck IV -- */ -- -- --#include --#include -- --#include --#include -- --#include --#include --#include --#include --#include "GLDispatcher.h" --#include "GLRendererRoster.h" -- --#include --#include -- -- --extern "C" status_t _kern_get_safemode_option(const char* parameter, -- char* buffer, size_t* _bufferSize); -- -- --GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) -- : -- fNextID(0), -- fView(view), -- fOptions(options), -- fSafeMode(false), -- fABISubDirectory(NULL) --{ -- char parameter[32]; -- size_t parameterLength = sizeof(parameter); -- -- if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, -- parameter, ¶meterLength) == B_OK) { -- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -- fSafeMode = true; -- } -- -- if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, -- parameter, ¶meterLength) == B_OK) { -- if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -- || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -- || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -- fSafeMode = true; -- } -- -- // We might run in compatibility mode on a system with a different ABI. The -- // renderers matching our ABI can usually be found in respective -- // subdirectories of the opengl add-ons directories. -- system_info info; -- if (get_system_info(&info) == B_OK -- && (info.abi & B_HAIKU_ABI_MAJOR) -- != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { -- switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { -- case B_HAIKU_ABI_GCC_2: -- fABISubDirectory = "gcc2"; -- break; -- case B_HAIKU_ABI_GCC_4: -- fABISubDirectory = "gcc4"; -- break; -- } -- } -- -- AddDefaultPaths(); --} -- -- --GLRendererRoster::~GLRendererRoster() --{ -- --} -- -- --BGLRenderer* --GLRendererRoster::GetRenderer(int32 id) --{ -- RendererMap::const_iterator iterator = fRenderers.find(id); -- if (iterator == fRenderers.end()) -- return NULL; -- -- struct renderer_item item = iterator->second; -- return item.renderer; --} -- -- --void --GLRendererRoster::AddDefaultPaths() --{ -- // add user directories first, so that they can override system renderers -- const directory_which paths[] = { -- B_USER_NONPACKAGED_ADDONS_DIRECTORY, -- B_USER_ADDONS_DIRECTORY, -- B_SYSTEM_ADDONS_DIRECTORY, -- }; -- -- for (uint32 i = fSafeMode ? 4 : 0; -- i < sizeof(paths) / sizeof(paths[0]); i++) { -- BPath path; -- status_t status = find_directory(paths[i], &path, true); -- if (status == B_OK && path.Append("opengl") == B_OK) -- AddPath(path.Path()); -- } --} -- -- --status_t --GLRendererRoster::AddPath(const char* path) --{ -- BDirectory directory(path); -- status_t status = directory.InitCheck(); -- if (status < B_OK) -- return status; -- -- // if a subdirectory for our ABI exists, use that instead -- if (fABISubDirectory != NULL) { -- BEntry entry(&directory, fABISubDirectory); -- if (entry.IsDirectory()) { -- status = directory.SetTo(&entry); -- if (status != B_OK) -- return status; -- } -- } -- -- node_ref nodeRef; -- status = directory.GetNodeRef(&nodeRef); -- if (status < B_OK) -- return status; -- -- int32 count = 0; -- int32 files = 0; -- -- entry_ref ref; -- BEntry entry; -- while (directory.GetNextRef(&ref) == B_OK) { -- entry.SetTo(&ref); -- if (entry.InitCheck() == B_OK && !entry.IsFile()) -- continue; -- -- if (CreateRenderer(ref) == B_OK) -- count++; -- -- files++; -- } -- -- if (files != 0 && count == 0) -- return B_BAD_VALUE; -- -- return B_OK; --} -- -- --status_t --GLRendererRoster::AddRenderer(BGLRenderer* renderer, -- image_id image, const entry_ref* ref, ino_t node) --{ -- renderer_item item; -- item.renderer = renderer; -- item.image = image; -- item.node = node; -- if (ref != NULL) -- item.ref = *ref; -- -- try { -- fRenderers[fNextID] = item; -- } catch (...) { -- return B_NO_MEMORY; -- } -- -- renderer->fOwningRoster = this; -- renderer->fID = fNextID++; -- return B_OK; --} -- -- --status_t --GLRendererRoster::CreateRenderer(const entry_ref& ref) --{ -- BEntry entry(&ref); -- node_ref nodeRef; -- status_t status = entry.GetNodeRef(&nodeRef); -- if (status < B_OK) -- return status; -- -- BPath path(&ref); -- image_id image = load_add_on(path.Path()); -- if (image < B_OK) -- return image; -- -- BGLRenderer* (*instantiate_renderer) -- (BGLView* view, ulong options, BGLDispatcher* dispatcher); -- -- status = get_image_symbol(image, "instantiate_gl_renderer", -- B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); -- if (status == B_OK) { -- BGLRenderer* renderer -- = instantiate_renderer(fView, fOptions, new BGLDispatcher()); -- if (!renderer) { -- unload_add_on(image); -- return B_UNSUPPORTED; -- } -- -- if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { -- renderer->Release(); -- // this will delete the renderer -- unload_add_on(image); -- } -- return B_OK; -- } -- unload_add_on(image); -- -- return status; --} -diff --git a/src/gallium/targets/libgl-haiku/GLRendererRoster.h b/src/gallium/targets/libgl-haiku/GLRendererRoster.h -deleted file mode 100644 -index 5c8da27..0000000 ---- a/src/gallium/targets/libgl-haiku/GLRendererRoster.h -+++ /dev/null -@@ -1,51 +0,0 @@ --/* -- * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Philippe Houdoin -- */ --#ifndef _GLRENDERER_ROSTER_H --#define _GLRENDERER_ROSTER_H -- -- --#include -- --#include -- -- --struct renderer_item { -- BGLRenderer* renderer; -- entry_ref ref; -- ino_t node; -- image_id image; --}; -- --typedef std::map RendererMap; -- -- --class GLRendererRoster { -- public: -- GLRendererRoster(BGLView* view, ulong options); -- virtual ~GLRendererRoster(); -- -- BGLRenderer* GetRenderer(int32 id = 0); -- -- private: -- void AddDefaultPaths(); -- status_t AddPath(const char* path); -- status_t AddRenderer(BGLRenderer* renderer, -- image_id image, const entry_ref* ref, ino_t node); -- status_t CreateRenderer(const entry_ref& ref); -- -- RendererMap fRenderers; -- int32 fNextID; -- BGLView* fView; -- ulong fOptions; -- bool fSafeMode; -- const char* fABISubDirectory; -- --}; -- -- --#endif /* _GLRENDERER_ROSTER_H */ -diff --git a/src/gallium/targets/libgl-haiku/GLView.cpp b/src/gallium/targets/libgl-haiku/GLView.cpp -deleted file mode 100644 -index 9ae5b5c..0000000 ---- a/src/gallium/targets/libgl-haiku/GLView.cpp -+++ /dev/null -@@ -1,643 +0,0 @@ --/* -- * Copyright 2006-2012, Haiku. All rights reserved. -- * Distributed under the terms of the MIT License. -- * -- * Authors: -- * Jérôme Duval, korli@users.berlios.de -- * Philippe Houdoin, philippe.houdoin@free.fr -- * Stefano Ceccherini, burton666@libero.it -- */ -- --#include -- --#include -- --#include --#include --#include --#include -- --#include --#include -- --#include "interface/DirectWindowPrivate.h" --#include "GLDispatcher.h" --#include "GLRendererRoster.h" -- -- --struct glview_direct_info { -- direct_buffer_info* direct_info; -- bool direct_connected; -- bool enable_direct_mode; -- -- glview_direct_info(); -- ~glview_direct_info(); --}; -- -- --BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, -- ulong options) -- : -- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -- // | B_FULL_UPDATE_ON_RESIZE) -- fGc(NULL), -- fOptions(options), -- fDitherCount(0), -- fDrawLock("BGLView draw lock"), -- fDisplayLock("BGLView display lock"), -- fClipInfo(NULL), -- fRenderer(NULL), -- fRoster(NULL), -- fDitherMap(NULL) --{ -- fRoster = new GLRendererRoster(this, options); --} -- -- --BGLView::~BGLView() --{ -- delete fClipInfo; -- if (fRenderer) -- fRenderer->Release(); --} -- -- --void --BGLView::LockGL() --{ -- // TODO: acquire the OpenGL API lock it on this glview -- -- fDisplayLock.Lock(); -- if (fRenderer) -- fRenderer->LockGL(); --} -- -- --void --BGLView::UnlockGL() --{ -- if (fRenderer) -- fRenderer->UnlockGL(); -- fDisplayLock.Unlock(); -- -- // TODO: release the GL API lock to others glviews --} -- -- --void --BGLView::SwapBuffers() --{ -- SwapBuffers(false); --} -- -- --void --BGLView::SwapBuffers(bool vSync) --{ -- if (fRenderer) { -- _LockDraw(); -- fRenderer->SwapBuffers(vSync); -- _UnlockDraw(); -- } --} -- -- --BView* --BGLView::EmbeddedView() --{ -- return NULL; --} -- -- --void* --BGLView::GetGLProcAddress(const char* procName) --{ -- BGLDispatcher* glDispatcher = NULL; -- -- if (fRenderer) -- glDispatcher = fRenderer->GLDispatcher(); -- -- if (glDispatcher) -- return (void*)glDispatcher->AddressOf(procName); -- -- return NULL; --} -- -- --status_t --BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) --{ -- if (!fRenderer) -- return B_ERROR; -- -- if (!dest || !dest->Bounds().IsValid()) -- return B_BAD_VALUE; -- -- return fRenderer->CopyPixelsOut(source, dest); --} -- -- --status_t --BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) --{ -- if (!fRenderer) -- return B_ERROR; -- -- if (!source || !source->Bounds().IsValid()) -- return B_BAD_VALUE; -- -- return fRenderer->CopyPixelsIn(source, dest); --} -- -- --/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum -- without breaking this method signature. -- Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: -- unsigned long. -- */ --void --BGLView::ErrorCallback(unsigned long errorCode) --{ -- char msg[32]; -- sprintf(msg, "GL: Error code $%04lx.", errorCode); -- // TODO: under BeOS R5, it call debugger(msg); -- fprintf(stderr, "%s\n", msg); --} -- -- --void --BGLView::Draw(BRect updateRect) --{ -- if (fRenderer) { -- _LockDraw(); -- fRenderer->Draw(updateRect); -- _UnlockDraw(); -- return; -- } -- // TODO: auto-size and center the string -- MovePenTo(8, 32); -- DrawString("No OpenGL renderer available!"); --} -- -- --void --BGLView::AttachedToWindow() --{ -- BView::AttachedToWindow(); -- -- fBounds = Bounds(); -- for (BView* view = this; view != NULL; view = view->Parent()) -- view->ConvertToParent(&fBounds); -- -- fRenderer = fRoster->GetRenderer(); -- if (fRenderer != NULL) { -- // Jackburton: The following code was commented because it doesn't look -- // good in "direct" mode: -- // when the window is moved, the app_server doesn't paint the view's -- // background, and the stuff behind the window itself shows up. -- // Setting the view color to black, instead, looks a bit more elegant. --#if 0 -- // Don't paint white window background when resized -- SetViewColor(B_TRANSPARENT_32_BIT); --#else -- SetViewColor(0, 0, 0); --#endif -- -- // Set default OpenGL viewport: -- LockGL(); -- glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); -- UnlockGL(); -- fRenderer->FrameResized(Bounds().IntegerWidth(), -- Bounds().IntegerHeight()); -- -- if (fClipInfo) { -- fRenderer->DirectConnected(fClipInfo->direct_info); -- fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); -- } -- -- return; -- } -- -- fprintf(stderr, "no renderer found! \n"); -- -- // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing -- // context -- SetFont(be_bold_font); -- // SetFontSize(16); --} -- -- --void --BGLView::AllAttached() --{ -- BView::AllAttached(); --} -- -- --void --BGLView::DetachedFromWindow() --{ -- if (fRenderer) -- fRenderer->Release(); -- fRenderer = NULL; -- -- BView::DetachedFromWindow(); --} -- -- --void --BGLView::AllDetached() --{ -- BView::AllDetached(); --} -- -- --void --BGLView::FrameResized(float width, float height) --{ -- fBounds = Bounds(); -- for (BView* v = this; v; v = v->Parent()) -- v->ConvertToParent(&fBounds); -- -- if (fRenderer) { -- LockGL(); -- _LockDraw(); -- _CallDirectConnected(); -- fRenderer->FrameResized(width, height); -- _UnlockDraw(); -- UnlockGL(); -- } -- -- BView::FrameResized(width, height); --} -- -- --status_t --BGLView::Perform(perform_code d, void* arg) --{ -- return BView::Perform(d, arg); --} -- -- --status_t --BGLView::Archive(BMessage* data, bool deep) const --{ -- return BView::Archive(data, deep); --} -- -- --void --BGLView::MessageReceived(BMessage* msg) --{ -- BView::MessageReceived(msg); --} -- -- --void --BGLView::SetResizingMode(uint32 mode) --{ -- BView::SetResizingMode(mode); --} -- -- --void --BGLView::GetPreferredSize(float* _width, float* _height) --{ -- if (_width) -- *_width = 0; -- if (_height) -- *_height = 0; --} -- -- --void --BGLView::Show() --{ -- BView::Show(); --} -- -- --void --BGLView::Hide() --{ -- BView::Hide(); --} -- -- --BHandler* --BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -- int32 form, const char* property) --{ -- return BView::ResolveSpecifier(msg, index, specifier, form, property); --} -- -- --status_t --BGLView::GetSupportedSuites(BMessage* data) --{ -- return BView::GetSupportedSuites(data); --} -- -- --void --BGLView::DirectConnected(direct_buffer_info* info) --{ -- if (fClipInfo == NULL) { -- fClipInfo = new (std::nothrow) glview_direct_info(); -- if (fClipInfo == NULL) -- return; -- } -- -- direct_buffer_info* localInfo = fClipInfo->direct_info; -- -- switch (info->buffer_state & B_DIRECT_MODE_MASK) { -- case B_DIRECT_START: -- fClipInfo->direct_connected = true; -- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -- _UnlockDraw(); -- break; -- -- case B_DIRECT_MODIFY: -- _LockDraw(); -- memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -- _UnlockDraw(); -- break; -- -- case B_DIRECT_STOP: -- fClipInfo->direct_connected = false; -- _LockDraw(); -- break; -- } -- -- if (fRenderer) -- _CallDirectConnected(); --} -- -- --void --BGLView::EnableDirectMode(bool enabled) --{ -- if (fRenderer) -- fRenderer->EnableDirectMode(enabled); -- if (fClipInfo == NULL) { -- fClipInfo = new (std::nothrow) glview_direct_info(); -- if (fClipInfo == NULL) -- return; -- } -- -- fClipInfo->enable_direct_mode = enabled; --} -- -- --void --BGLView::_LockDraw() --{ -- if (!fClipInfo || !fClipInfo->enable_direct_mode) -- return; -- -- fDrawLock.Lock(); --} -- -- --void --BGLView::_UnlockDraw() --{ -- if (!fClipInfo || !fClipInfo->enable_direct_mode) -- return; -- -- fDrawLock.Unlock(); --} -- -- --void --BGLView::_CallDirectConnected() --{ -- if (!fClipInfo) -- return; -- -- direct_buffer_info* localInfo = fClipInfo->direct_info; -- direct_buffer_info* info = (direct_buffer_info*)malloc( -- DIRECT_BUFFER_INFO_AREA_SIZE); -- if (info == NULL) -- return; -- -- memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); -- -- // Collect the rects into a BRegion, then clip to the view's bounds -- BRegion region; -- for (uint32 c = 0; c < localInfo->clip_list_count; c++) -- region.Include(localInfo->clip_list[c]); -- BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, -- localInfo->window_bounds.top); -- info->window_bounds = boundsRegion.RectAtInt(0); -- // window_bounds are now view bounds -- region.IntersectWith(&boundsRegion); -- -- info->clip_list_count = region.CountRects(); -- info->clip_bounds = region.FrameInt(); -- -- for (uint32 c = 0; c < info->clip_list_count; c++) -- info->clip_list[c] = region.RectAtInt(c); -- fRenderer->DirectConnected(info); -- free(info); --} -- -- --//---- virtual reserved methods ---------- -- -- --void BGLView::_ReservedGLView1() {} --void BGLView::_ReservedGLView2() {} --void BGLView::_ReservedGLView3() {} --void BGLView::_ReservedGLView4() {} --void BGLView::_ReservedGLView5() {} --void BGLView::_ReservedGLView6() {} --void BGLView::_ReservedGLView7() {} --void BGLView::_ReservedGLView8() {} -- -- --// #pragma mark - -- -- --// BeOS compatibility: contrary to others BView's contructors, --// BGLView one wants a non-const name argument. --BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, -- ulong options) -- : -- BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -- fGc(NULL), -- fOptions(options), -- fDitherCount(0), -- fDrawLock("BGLView draw lock"), -- fDisplayLock("BGLView display lock"), -- fClipInfo(NULL), -- fRenderer(NULL), -- fRoster(NULL), -- fDitherMap(NULL) --{ -- fRoster = new GLRendererRoster(this, options); --} -- -- --#if 0 --// TODO: implement BGLScreen class... -- -- --BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, -- status_t* error, bool debug) -- : -- BWindowScreen(name, screenMode, error, debug) --{ --} -- -- --BGLScreen::~BGLScreen() --{ --} -- -- --void --BGLScreen::LockGL() --{ --} -- -- --void --BGLScreen::UnlockGL() --{ --} -- -- --void --BGLScreen::SwapBuffers() --{ --} -- -- --void --BGLScreen::ErrorCallback(unsigned long errorCode) --{ -- // Mesa's GLenum is not ulong but uint! -- char msg[32]; -- sprintf(msg, "GL: Error code $%04lx.", errorCode); -- // debugger(msg); -- fprintf(stderr, "%s\n", msg); -- return; --} -- -- --void --BGLScreen::ScreenConnected(bool enabled) --{ --} -- -- --void --BGLScreen::FrameResized(float width, float height) --{ -- return BWindowScreen::FrameResized(width, height); --} -- -- --status_t --BGLScreen::Perform(perform_code d, void* arg) --{ -- return BWindowScreen::Perform(d, arg); --} -- -- --status_t --BGLScreen::Archive(BMessage* data, bool deep) const --{ -- return BWindowScreen::Archive(data, deep); --} -- -- --void --BGLScreen::MessageReceived(BMessage* msg) --{ -- BWindowScreen::MessageReceived(msg); --} -- -- --void --BGLScreen::Show() --{ -- BWindowScreen::Show(); --} -- -- --void --BGLScreen::Hide() --{ -- BWindowScreen::Hide(); --} -- -- --BHandler* --BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -- int32 form, const char* property) --{ -- return BWindowScreen::ResolveSpecifier(msg, index, specifier, -- form, property); --} -- -- --status_t --BGLScreen::GetSupportedSuites(BMessage* data) --{ -- return BWindowScreen::GetSupportedSuites(data); --} -- -- --//---- virtual reserved methods ---------- -- --void BGLScreen::_ReservedGLScreen1() {} --void BGLScreen::_ReservedGLScreen2() {} --void BGLScreen::_ReservedGLScreen3() {} --void BGLScreen::_ReservedGLScreen4() {} --void BGLScreen::_ReservedGLScreen5() {} --void BGLScreen::_ReservedGLScreen6() {} --void BGLScreen::_ReservedGLScreen7() {} --void BGLScreen::_ReservedGLScreen8() {} --#endif -- -- --const char* color_space_name(color_space space) --{ --#define C2N(a) case a: return #a -- -- switch (space) { -- C2N(B_RGB24); -- C2N(B_RGB32); -- C2N(B_RGBA32); -- C2N(B_RGB32_BIG); -- C2N(B_RGBA32_BIG); -- C2N(B_GRAY8); -- C2N(B_GRAY1); -- C2N(B_RGB16); -- C2N(B_RGB15); -- C2N(B_RGBA15); -- C2N(B_CMAP8); -- default: -- return "Unknown!"; -- }; -- --#undef C2N --}; -- -- --glview_direct_info::glview_direct_info() --{ -- // TODO: See direct_window_data() in app_server's ServerWindow.cpp -- direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); -- direct_connected = false; -- enable_direct_mode = false; --} -- -- --glview_direct_info::~glview_direct_info() --{ -- free(direct_info); --} -- -diff --git a/src/gallium/targets/libgl-haiku/SConscript b/src/gallium/targets/libgl-haiku/SConscript -deleted file mode 100644 -index 43d15c5..0000000 ---- a/src/gallium/targets/libgl-haiku/SConscript -+++ /dev/null -@@ -1,35 +0,0 @@ --####################################################################### --# SConscript for Haiku OpenGL kit -- --Import('*') -- --env = env.Clone() -- --env.Append(CPPPATH = [ -- '#/src/mapi', -- '#/src/mesa', -- '#/src/mesa/main', -- '#/include/HaikuGL', -- '/boot/system/develop/headers/private', -- Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers --]) -- --env.Prepend(LIBS = [ -- glapi --]) -- --sources = [ -- 'GLView.cpp', -- 'GLRenderer.cpp', -- 'GLRendererRoster.cpp', -- 'GLDispatcher.cpp', --] -- --# libGL.so --libgl = env.SharedLibrary( -- target ='GL', -- source = sources, -- SHLIBSUFFIX = env['SHLIBSUFFIX'], --) -- --env.Alias('libgl-haiku', libgl) -diff --git a/src/hgl/GLDispatcher.cpp b/src/hgl/GLDispatcher.cpp -new file mode 100644 -index 0000000..46b91d5 ---- /dev/null -+++ b/src/hgl/GLDispatcher.cpp -@@ -0,0 +1,72 @@ -+/* -+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Brian Paul -+ * Philippe Houdoin -+ * Alexander von Gluck IV -+ */ -+ -+ -+extern "C" { -+#include "glapi/glapi.h" -+#include "glapi/glapi_priv.h" -+ -+/* -+ * NOTE: this file portion implements C-based dispatch of the OpenGL entrypoints -+ * (glAccum, glBegin, etc). -+ * This code IS NOT USED if we're compiling on an x86 system and using -+ * the glapi_x86.S assembly code. -+ */ -+#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) -+ -+#define KEYWORD1 PUBLIC -+#define KEYWORD2 -+#define NAME(func) gl##func -+ -+#define DISPATCH(func, args, msg) \ -+ const struct _glapi_table* dispatch; \ -+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -+ (dispatch->func) args -+ -+#define RETURN_DISPATCH(func, args, msg) \ -+ const struct _glapi_table* dispatch; \ -+ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ -+ return (dispatch->func) args -+ -+#endif -+} -+ -+ -+/* NOTE: this file portion implement a thin OpenGL entrypoints dispatching -+ C++ wrapper class -+ */ -+ -+#include "GLDispatcher.h" -+ -+BGLDispatcher::BGLDispatcher() -+{ -+} -+ -+ -+BGLDispatcher::~BGLDispatcher() -+{ -+} -+ -+ -+status_t -+BGLDispatcher::CheckTable(const struct _glapi_table* table) -+{ -+ _glapi_check_table(table ? table : _glapi_get_dispatch()); -+ return B_OK; -+} -+ -+ -+status_t -+BGLDispatcher::SetTable(struct _glapi_table* table) -+{ -+ _glapi_set_dispatch(table); -+ return B_OK; -+} -diff --git a/src/hgl/GLDispatcher.h b/src/hgl/GLDispatcher.h -new file mode 100644 -index 0000000..44bca8c ---- /dev/null -+++ b/src/hgl/GLDispatcher.h -@@ -0,0 +1,109 @@ -+/* -+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Brian Paul -+ * Philippe Houdoin -+ */ -+#ifndef GLDISPATCHER_H -+#define GLDISPATCHER_H -+ -+ -+#include -+#include -+#include -+ -+#include "glheader.h" -+ -+extern "C" { -+#include "glapi/glapi.h" -+} -+ -+ -+class BGLDispatcher -+{ -+ // Private unimplemented copy constructors -+ BGLDispatcher(const BGLDispatcher &); -+ BGLDispatcher & operator=(const BGLDispatcher &); -+ -+ public: -+ BGLDispatcher(); -+ ~BGLDispatcher(); -+ -+ void SetCurrentContext(void* context); -+ void* CurrentContext(); -+ -+ struct _glapi_table* Table(); -+ status_t CheckTable( -+ const struct _glapi_table* dispatch = NULL); -+ status_t SetTable(struct _glapi_table* dispatch); -+ uint32 TableSize(); -+ -+ const _glapi_proc operator[](const char* functionName); -+ const char* operator[](uint32 offset); -+ -+ const _glapi_proc AddressOf(const char* functionName); -+ uint32 OffsetOf(const char* functionName); -+}; -+ -+ -+// Inlines methods -+inline void -+BGLDispatcher::SetCurrentContext(void* context) -+{ -+ _glapi_set_context(context); -+} -+ -+ -+inline void* -+BGLDispatcher::CurrentContext() -+{ -+ return _glapi_get_context(); -+} -+ -+ -+inline struct _glapi_table* -+BGLDispatcher::Table() -+{ -+ return _glapi_get_dispatch(); -+} -+ -+ -+inline uint32 -+BGLDispatcher::TableSize() -+{ -+ return _glapi_get_dispatch_table_size(); -+} -+ -+ -+inline const _glapi_proc -+BGLDispatcher::operator[](const char* functionName) -+{ -+ return _glapi_get_proc_address(functionName); -+} -+ -+ -+inline const char* -+BGLDispatcher::operator[](uint32 offset) -+{ -+ return _glapi_get_proc_name((GLuint) offset); -+} -+ -+ -+inline const _glapi_proc -+BGLDispatcher::AddressOf(const char* functionName) -+{ -+ return _glapi_get_proc_address(functionName); -+} -+ -+ -+inline uint32 -+BGLDispatcher::OffsetOf(const char* functionName) -+{ -+ return (uint32) _glapi_get_proc_offset(functionName); -+} -+ -+ -+#endif // GLDISPATCHER_H -diff --git a/src/hgl/GLRenderer.cpp b/src/hgl/GLRenderer.cpp -new file mode 100644 -index 0000000..4573a64 ---- /dev/null -+++ b/src/hgl/GLRenderer.cpp -@@ -0,0 +1,106 @@ -+/* -+ * Copyright 2006-2008, Philippe Houdoin. All rights reserved. -+ * Distributed under the terms of the MIT License. -+ */ -+ -+ -+#include -+ -+#include "GLRenderer.h" -+ -+#include "GLDispatcher.h" -+ -+ -+BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, -+ BGLDispatcher* dispatcher) -+ : -+ fRefCount(1), -+ fView(view), -+ fOptions(glOptions), -+ fDispatcher(dispatcher) -+{ -+} -+ -+ -+BGLRenderer::~BGLRenderer() -+{ -+ delete fDispatcher; -+} -+ -+ -+void -+BGLRenderer::Acquire() -+{ -+ atomic_add(&fRefCount, 1); -+} -+ -+ -+void -+BGLRenderer::Release() -+{ -+ if (atomic_add(&fRefCount, -1) < 1) -+ delete this; -+} -+ -+ -+void -+BGLRenderer::LockGL() -+{ -+} -+ -+ -+void -+BGLRenderer::UnlockGL() -+{ -+} -+ -+ -+void -+BGLRenderer::SwapBuffers(bool VSync) -+{ -+} -+ -+ -+void -+BGLRenderer::Draw(BRect updateRect) -+{ -+} -+ -+ -+status_t -+BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) -+{ -+ return B_ERROR; -+} -+ -+ -+status_t -+BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) -+{ -+ return B_ERROR; -+} -+ -+ -+void -+BGLRenderer::FrameResized(float width, float height) -+{ -+} -+ -+ -+void -+BGLRenderer::DirectConnected(direct_buffer_info* info) -+{ -+} -+ -+ -+void -+BGLRenderer::EnableDirectMode(bool enabled) -+{ -+} -+ -+ -+status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } -+status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } -diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp -new file mode 100644 -index 0000000..1712a87 ---- /dev/null -+++ b/src/hgl/GLRendererRoster.cpp -@@ -0,0 +1,224 @@ -+/* -+ * Copyright 2006-2012 Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Philippe Houdoin -+ * Alexander von Gluck IV -+ */ -+ -+ -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include "GLDispatcher.h" -+#include "GLRendererRoster.h" -+ -+#include -+#include -+ -+ -+extern "C" status_t _kern_get_safemode_option(const char* parameter, -+ char* buffer, size_t* _bufferSize); -+ -+ -+GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) -+ : -+ fNextID(0), -+ fView(view), -+ fOptions(options), -+ fSafeMode(false), -+ fABISubDirectory(NULL) -+{ -+ char parameter[32]; -+ size_t parameterLength = sizeof(parameter); -+ -+ if (_kern_get_safemode_option(B_SAFEMODE_SAFE_MODE, -+ parameter, ¶meterLength) == B_OK) { -+ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -+ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -+ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -+ fSafeMode = true; -+ } -+ -+ if (_kern_get_safemode_option(B_SAFEMODE_DISABLE_USER_ADD_ONS, -+ parameter, ¶meterLength) == B_OK) { -+ if (!strcasecmp(parameter, "enabled") || !strcasecmp(parameter, "on") -+ || !strcasecmp(parameter, "true") || !strcasecmp(parameter, "yes") -+ || !strcasecmp(parameter, "enable") || !strcmp(parameter, "1")) -+ fSafeMode = true; -+ } -+ -+ // We might run in compatibility mode on a system with a different ABI. The -+ // renderers matching our ABI can usually be found in respective -+ // subdirectories of the opengl add-ons directories. -+ system_info info; -+ if (get_system_info(&info) == B_OK -+ && (info.abi & B_HAIKU_ABI_MAJOR) -+ != (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR)) { -+ switch (B_HAIKU_ABI & B_HAIKU_ABI_MAJOR) { -+ case B_HAIKU_ABI_GCC_2: -+ fABISubDirectory = "gcc2"; -+ break; -+ case B_HAIKU_ABI_GCC_4: -+ fABISubDirectory = "gcc4"; -+ break; -+ } -+ } -+ -+ AddDefaultPaths(); -+} -+ -+ -+GLRendererRoster::~GLRendererRoster() -+{ -+ -+} -+ -+ -+BGLRenderer* -+GLRendererRoster::GetRenderer(int32 id) -+{ -+ RendererMap::const_iterator iterator = fRenderers.find(id); -+ if (iterator == fRenderers.end()) -+ return NULL; -+ -+ struct renderer_item item = iterator->second; -+ return item.renderer; -+} -+ -+ -+void -+GLRendererRoster::AddDefaultPaths() -+{ -+ // add user directories first, so that they can override system renderers -+ const directory_which paths[] = { -+ B_USER_NONPACKAGED_ADDONS_DIRECTORY, -+ B_USER_ADDONS_DIRECTORY, -+ B_SYSTEM_ADDONS_DIRECTORY, -+ }; -+ -+ for (uint32 i = fSafeMode ? 4 : 0; -+ i < sizeof(paths) / sizeof(paths[0]); i++) { -+ BPath path; -+ status_t status = find_directory(paths[i], &path, true); -+ if (status == B_OK && path.Append("opengl") == B_OK) -+ AddPath(path.Path()); -+ } -+} -+ -+ -+status_t -+GLRendererRoster::AddPath(const char* path) -+{ -+ BDirectory directory(path); -+ status_t status = directory.InitCheck(); -+ if (status < B_OK) -+ return status; -+ -+ // if a subdirectory for our ABI exists, use that instead -+ if (fABISubDirectory != NULL) { -+ BEntry entry(&directory, fABISubDirectory); -+ if (entry.IsDirectory()) { -+ status = directory.SetTo(&entry); -+ if (status != B_OK) -+ return status; -+ } -+ } -+ -+ node_ref nodeRef; -+ status = directory.GetNodeRef(&nodeRef); -+ if (status < B_OK) -+ return status; -+ -+ int32 count = 0; -+ int32 files = 0; -+ -+ entry_ref ref; -+ BEntry entry; -+ while (directory.GetNextRef(&ref) == B_OK) { -+ entry.SetTo(&ref); -+ if (entry.InitCheck() == B_OK && !entry.IsFile()) -+ continue; -+ -+ if (CreateRenderer(ref) == B_OK) -+ count++; -+ -+ files++; -+ } -+ -+ if (files != 0 && count == 0) -+ return B_BAD_VALUE; -+ -+ return B_OK; -+} -+ -+ -+status_t -+GLRendererRoster::AddRenderer(BGLRenderer* renderer, -+ image_id image, const entry_ref* ref, ino_t node) -+{ -+ renderer_item item; -+ item.renderer = renderer; -+ item.image = image; -+ item.node = node; -+ if (ref != NULL) -+ item.ref = *ref; -+ -+ try { -+ fRenderers[fNextID] = item; -+ } catch (...) { -+ return B_NO_MEMORY; -+ } -+ -+ renderer->fOwningRoster = this; -+ renderer->fID = fNextID++; -+ return B_OK; -+} -+ -+ -+status_t -+GLRendererRoster::CreateRenderer(const entry_ref& ref) -+{ -+ BEntry entry(&ref); -+ node_ref nodeRef; -+ status_t status = entry.GetNodeRef(&nodeRef); -+ if (status < B_OK) -+ return status; -+ -+ BPath path(&ref); -+ image_id image = load_add_on(path.Path()); -+ if (image < B_OK) -+ return image; -+ -+ BGLRenderer* (*instantiate_renderer) -+ (BGLView* view, ulong options, BGLDispatcher* dispatcher); -+ -+ status = get_image_symbol(image, "instantiate_gl_renderer", -+ B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); -+ if (status == B_OK) { -+ BGLRenderer* renderer -+ = instantiate_renderer(fView, fOptions, new BGLDispatcher()); -+ if (!renderer) { -+ unload_add_on(image); -+ return B_UNSUPPORTED; -+ } -+ -+ if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { -+ renderer->Release(); -+ // this will delete the renderer -+ unload_add_on(image); -+ } -+ return B_OK; -+ } -+ unload_add_on(image); -+ -+ return status; -+} -diff --git a/src/hgl/GLRendererRoster.h b/src/hgl/GLRendererRoster.h -new file mode 100644 -index 0000000..5c8da27 ---- /dev/null -+++ b/src/hgl/GLRendererRoster.h -@@ -0,0 +1,51 @@ -+/* -+ * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Philippe Houdoin -+ */ -+#ifndef _GLRENDERER_ROSTER_H -+#define _GLRENDERER_ROSTER_H -+ -+ -+#include -+ -+#include -+ -+ -+struct renderer_item { -+ BGLRenderer* renderer; -+ entry_ref ref; -+ ino_t node; -+ image_id image; -+}; -+ -+typedef std::map RendererMap; -+ -+ -+class GLRendererRoster { -+ public: -+ GLRendererRoster(BGLView* view, ulong options); -+ virtual ~GLRendererRoster(); -+ -+ BGLRenderer* GetRenderer(int32 id = 0); -+ -+ private: -+ void AddDefaultPaths(); -+ status_t AddPath(const char* path); -+ status_t AddRenderer(BGLRenderer* renderer, -+ image_id image, const entry_ref* ref, ino_t node); -+ status_t CreateRenderer(const entry_ref& ref); -+ -+ RendererMap fRenderers; -+ int32 fNextID; -+ BGLView* fView; -+ ulong fOptions; -+ bool fSafeMode; -+ const char* fABISubDirectory; -+ -+}; -+ -+ -+#endif /* _GLRENDERER_ROSTER_H */ -diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp -new file mode 100644 -index 0000000..9ae5b5c ---- /dev/null -+++ b/src/hgl/GLView.cpp -@@ -0,0 +1,643 @@ -+/* -+ * Copyright 2006-2012, Haiku. All rights reserved. -+ * Distributed under the terms of the MIT License. -+ * -+ * Authors: -+ * Jérôme Duval, korli@users.berlios.de -+ * Philippe Houdoin, philippe.houdoin@free.fr -+ * Stefano Ceccherini, burton666@libero.it -+ */ -+ -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include "interface/DirectWindowPrivate.h" -+#include "GLDispatcher.h" -+#include "GLRendererRoster.h" -+ -+ -+struct glview_direct_info { -+ direct_buffer_info* direct_info; -+ bool direct_connected; -+ bool enable_direct_mode; -+ -+ glview_direct_info(); -+ ~glview_direct_info(); -+}; -+ -+ -+BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, -+ ulong options) -+ : -+ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -+ // | B_FULL_UPDATE_ON_RESIZE) -+ fGc(NULL), -+ fOptions(options), -+ fDitherCount(0), -+ fDrawLock("BGLView draw lock"), -+ fDisplayLock("BGLView display lock"), -+ fClipInfo(NULL), -+ fRenderer(NULL), -+ fRoster(NULL), -+ fDitherMap(NULL) -+{ -+ fRoster = new GLRendererRoster(this, options); -+} -+ -+ -+BGLView::~BGLView() -+{ -+ delete fClipInfo; -+ if (fRenderer) -+ fRenderer->Release(); -+} -+ -+ -+void -+BGLView::LockGL() -+{ -+ // TODO: acquire the OpenGL API lock it on this glview -+ -+ fDisplayLock.Lock(); -+ if (fRenderer) -+ fRenderer->LockGL(); -+} -+ -+ -+void -+BGLView::UnlockGL() -+{ -+ if (fRenderer) -+ fRenderer->UnlockGL(); -+ fDisplayLock.Unlock(); -+ -+ // TODO: release the GL API lock to others glviews -+} -+ -+ -+void -+BGLView::SwapBuffers() -+{ -+ SwapBuffers(false); -+} -+ -+ -+void -+BGLView::SwapBuffers(bool vSync) -+{ -+ if (fRenderer) { -+ _LockDraw(); -+ fRenderer->SwapBuffers(vSync); -+ _UnlockDraw(); -+ } -+} -+ -+ -+BView* -+BGLView::EmbeddedView() -+{ -+ return NULL; -+} -+ -+ -+void* -+BGLView::GetGLProcAddress(const char* procName) -+{ -+ BGLDispatcher* glDispatcher = NULL; -+ -+ if (fRenderer) -+ glDispatcher = fRenderer->GLDispatcher(); -+ -+ if (glDispatcher) -+ return (void*)glDispatcher->AddressOf(procName); -+ -+ return NULL; -+} -+ -+ -+status_t -+BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) -+{ -+ if (!fRenderer) -+ return B_ERROR; -+ -+ if (!dest || !dest->Bounds().IsValid()) -+ return B_BAD_VALUE; -+ -+ return fRenderer->CopyPixelsOut(source, dest); -+} -+ -+ -+status_t -+BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) -+{ -+ if (!fRenderer) -+ return B_ERROR; -+ -+ if (!source || !source->Bounds().IsValid()) -+ return B_BAD_VALUE; -+ -+ return fRenderer->CopyPixelsIn(source, dest); -+} -+ -+ -+/*! Mesa's GLenum is not ulong but uint, so we can't use GLenum -+ without breaking this method signature. -+ Instead, we have to use the effective BeOS's SGI OpenGL GLenum type: -+ unsigned long. -+ */ -+void -+BGLView::ErrorCallback(unsigned long errorCode) -+{ -+ char msg[32]; -+ sprintf(msg, "GL: Error code $%04lx.", errorCode); -+ // TODO: under BeOS R5, it call debugger(msg); -+ fprintf(stderr, "%s\n", msg); -+} -+ -+ -+void -+BGLView::Draw(BRect updateRect) -+{ -+ if (fRenderer) { -+ _LockDraw(); -+ fRenderer->Draw(updateRect); -+ _UnlockDraw(); -+ return; -+ } -+ // TODO: auto-size and center the string -+ MovePenTo(8, 32); -+ DrawString("No OpenGL renderer available!"); -+} -+ -+ -+void -+BGLView::AttachedToWindow() -+{ -+ BView::AttachedToWindow(); -+ -+ fBounds = Bounds(); -+ for (BView* view = this; view != NULL; view = view->Parent()) -+ view->ConvertToParent(&fBounds); -+ -+ fRenderer = fRoster->GetRenderer(); -+ if (fRenderer != NULL) { -+ // Jackburton: The following code was commented because it doesn't look -+ // good in "direct" mode: -+ // when the window is moved, the app_server doesn't paint the view's -+ // background, and the stuff behind the window itself shows up. -+ // Setting the view color to black, instead, looks a bit more elegant. -+#if 0 -+ // Don't paint white window background when resized -+ SetViewColor(B_TRANSPARENT_32_BIT); -+#else -+ SetViewColor(0, 0, 0); -+#endif -+ -+ // Set default OpenGL viewport: -+ LockGL(); -+ glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight()); -+ UnlockGL(); -+ fRenderer->FrameResized(Bounds().IntegerWidth(), -+ Bounds().IntegerHeight()); -+ -+ if (fClipInfo) { -+ fRenderer->DirectConnected(fClipInfo->direct_info); -+ fRenderer->EnableDirectMode(fClipInfo->enable_direct_mode); -+ } -+ -+ return; -+ } -+ -+ fprintf(stderr, "no renderer found! \n"); -+ -+ // No Renderer, no rendering. Setup a minimal "No Renderer" string drawing -+ // context -+ SetFont(be_bold_font); -+ // SetFontSize(16); -+} -+ -+ -+void -+BGLView::AllAttached() -+{ -+ BView::AllAttached(); -+} -+ -+ -+void -+BGLView::DetachedFromWindow() -+{ -+ if (fRenderer) -+ fRenderer->Release(); -+ fRenderer = NULL; -+ -+ BView::DetachedFromWindow(); -+} -+ -+ -+void -+BGLView::AllDetached() -+{ -+ BView::AllDetached(); -+} -+ -+ -+void -+BGLView::FrameResized(float width, float height) -+{ -+ fBounds = Bounds(); -+ for (BView* v = this; v; v = v->Parent()) -+ v->ConvertToParent(&fBounds); -+ -+ if (fRenderer) { -+ LockGL(); -+ _LockDraw(); -+ _CallDirectConnected(); -+ fRenderer->FrameResized(width, height); -+ _UnlockDraw(); -+ UnlockGL(); -+ } -+ -+ BView::FrameResized(width, height); -+} -+ -+ -+status_t -+BGLView::Perform(perform_code d, void* arg) -+{ -+ return BView::Perform(d, arg); -+} -+ -+ -+status_t -+BGLView::Archive(BMessage* data, bool deep) const -+{ -+ return BView::Archive(data, deep); -+} -+ -+ -+void -+BGLView::MessageReceived(BMessage* msg) -+{ -+ BView::MessageReceived(msg); -+} -+ -+ -+void -+BGLView::SetResizingMode(uint32 mode) -+{ -+ BView::SetResizingMode(mode); -+} -+ -+ -+void -+BGLView::GetPreferredSize(float* _width, float* _height) -+{ -+ if (_width) -+ *_width = 0; -+ if (_height) -+ *_height = 0; -+} -+ -+ -+void -+BGLView::Show() -+{ -+ BView::Show(); -+} -+ -+ -+void -+BGLView::Hide() -+{ -+ BView::Hide(); -+} -+ -+ -+BHandler* -+BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -+ int32 form, const char* property) -+{ -+ return BView::ResolveSpecifier(msg, index, specifier, form, property); -+} -+ -+ -+status_t -+BGLView::GetSupportedSuites(BMessage* data) -+{ -+ return BView::GetSupportedSuites(data); -+} -+ -+ -+void -+BGLView::DirectConnected(direct_buffer_info* info) -+{ -+ if (fClipInfo == NULL) { -+ fClipInfo = new (std::nothrow) glview_direct_info(); -+ if (fClipInfo == NULL) -+ return; -+ } -+ -+ direct_buffer_info* localInfo = fClipInfo->direct_info; -+ -+ switch (info->buffer_state & B_DIRECT_MODE_MASK) { -+ case B_DIRECT_START: -+ fClipInfo->direct_connected = true; -+ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -+ _UnlockDraw(); -+ break; -+ -+ case B_DIRECT_MODIFY: -+ _LockDraw(); -+ memcpy(localInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); -+ _UnlockDraw(); -+ break; -+ -+ case B_DIRECT_STOP: -+ fClipInfo->direct_connected = false; -+ _LockDraw(); -+ break; -+ } -+ -+ if (fRenderer) -+ _CallDirectConnected(); -+} -+ -+ -+void -+BGLView::EnableDirectMode(bool enabled) -+{ -+ if (fRenderer) -+ fRenderer->EnableDirectMode(enabled); -+ if (fClipInfo == NULL) { -+ fClipInfo = new (std::nothrow) glview_direct_info(); -+ if (fClipInfo == NULL) -+ return; -+ } -+ -+ fClipInfo->enable_direct_mode = enabled; -+} -+ -+ -+void -+BGLView::_LockDraw() -+{ -+ if (!fClipInfo || !fClipInfo->enable_direct_mode) -+ return; -+ -+ fDrawLock.Lock(); -+} -+ -+ -+void -+BGLView::_UnlockDraw() -+{ -+ if (!fClipInfo || !fClipInfo->enable_direct_mode) -+ return; -+ -+ fDrawLock.Unlock(); -+} -+ -+ -+void -+BGLView::_CallDirectConnected() -+{ -+ if (!fClipInfo) -+ return; -+ -+ direct_buffer_info* localInfo = fClipInfo->direct_info; -+ direct_buffer_info* info = (direct_buffer_info*)malloc( -+ DIRECT_BUFFER_INFO_AREA_SIZE); -+ if (info == NULL) -+ return; -+ -+ memcpy(info, localInfo, DIRECT_BUFFER_INFO_AREA_SIZE); -+ -+ // Collect the rects into a BRegion, then clip to the view's bounds -+ BRegion region; -+ for (uint32 c = 0; c < localInfo->clip_list_count; c++) -+ region.Include(localInfo->clip_list[c]); -+ BRegion boundsRegion = fBounds.OffsetByCopy(localInfo->window_bounds.left, -+ localInfo->window_bounds.top); -+ info->window_bounds = boundsRegion.RectAtInt(0); -+ // window_bounds are now view bounds -+ region.IntersectWith(&boundsRegion); -+ -+ info->clip_list_count = region.CountRects(); -+ info->clip_bounds = region.FrameInt(); -+ -+ for (uint32 c = 0; c < info->clip_list_count; c++) -+ info->clip_list[c] = region.RectAtInt(c); -+ fRenderer->DirectConnected(info); -+ free(info); -+} -+ -+ -+//---- virtual reserved methods ---------- -+ -+ -+void BGLView::_ReservedGLView1() {} -+void BGLView::_ReservedGLView2() {} -+void BGLView::_ReservedGLView3() {} -+void BGLView::_ReservedGLView4() {} -+void BGLView::_ReservedGLView5() {} -+void BGLView::_ReservedGLView6() {} -+void BGLView::_ReservedGLView7() {} -+void BGLView::_ReservedGLView8() {} -+ -+ -+// #pragma mark - -+ -+ -+// BeOS compatibility: contrary to others BView's contructors, -+// BGLView one wants a non-const name argument. -+BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, -+ ulong options) -+ : -+ BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), -+ fGc(NULL), -+ fOptions(options), -+ fDitherCount(0), -+ fDrawLock("BGLView draw lock"), -+ fDisplayLock("BGLView display lock"), -+ fClipInfo(NULL), -+ fRenderer(NULL), -+ fRoster(NULL), -+ fDitherMap(NULL) -+{ -+ fRoster = new GLRendererRoster(this, options); -+} -+ -+ -+#if 0 -+// TODO: implement BGLScreen class... -+ -+ -+BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, -+ status_t* error, bool debug) -+ : -+ BWindowScreen(name, screenMode, error, debug) -+{ -+} -+ -+ -+BGLScreen::~BGLScreen() -+{ -+} -+ -+ -+void -+BGLScreen::LockGL() -+{ -+} -+ -+ -+void -+BGLScreen::UnlockGL() -+{ -+} -+ -+ -+void -+BGLScreen::SwapBuffers() -+{ -+} -+ -+ -+void -+BGLScreen::ErrorCallback(unsigned long errorCode) -+{ -+ // Mesa's GLenum is not ulong but uint! -+ char msg[32]; -+ sprintf(msg, "GL: Error code $%04lx.", errorCode); -+ // debugger(msg); -+ fprintf(stderr, "%s\n", msg); -+ return; -+} -+ -+ -+void -+BGLScreen::ScreenConnected(bool enabled) -+{ -+} -+ -+ -+void -+BGLScreen::FrameResized(float width, float height) -+{ -+ return BWindowScreen::FrameResized(width, height); -+} -+ -+ -+status_t -+BGLScreen::Perform(perform_code d, void* arg) -+{ -+ return BWindowScreen::Perform(d, arg); -+} -+ -+ -+status_t -+BGLScreen::Archive(BMessage* data, bool deep) const -+{ -+ return BWindowScreen::Archive(data, deep); -+} -+ -+ -+void -+BGLScreen::MessageReceived(BMessage* msg) -+{ -+ BWindowScreen::MessageReceived(msg); -+} -+ -+ -+void -+BGLScreen::Show() -+{ -+ BWindowScreen::Show(); -+} -+ -+ -+void -+BGLScreen::Hide() -+{ -+ BWindowScreen::Hide(); -+} -+ -+ -+BHandler* -+BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, -+ int32 form, const char* property) -+{ -+ return BWindowScreen::ResolveSpecifier(msg, index, specifier, -+ form, property); -+} -+ -+ -+status_t -+BGLScreen::GetSupportedSuites(BMessage* data) -+{ -+ return BWindowScreen::GetSupportedSuites(data); -+} -+ -+ -+//---- virtual reserved methods ---------- -+ -+void BGLScreen::_ReservedGLScreen1() {} -+void BGLScreen::_ReservedGLScreen2() {} -+void BGLScreen::_ReservedGLScreen3() {} -+void BGLScreen::_ReservedGLScreen4() {} -+void BGLScreen::_ReservedGLScreen5() {} -+void BGLScreen::_ReservedGLScreen6() {} -+void BGLScreen::_ReservedGLScreen7() {} -+void BGLScreen::_ReservedGLScreen8() {} -+#endif -+ -+ -+const char* color_space_name(color_space space) -+{ -+#define C2N(a) case a: return #a -+ -+ switch (space) { -+ C2N(B_RGB24); -+ C2N(B_RGB32); -+ C2N(B_RGBA32); -+ C2N(B_RGB32_BIG); -+ C2N(B_RGBA32_BIG); -+ C2N(B_GRAY8); -+ C2N(B_GRAY1); -+ C2N(B_RGB16); -+ C2N(B_RGB15); -+ C2N(B_RGBA15); -+ C2N(B_CMAP8); -+ default: -+ return "Unknown!"; -+ }; -+ -+#undef C2N -+}; -+ -+ -+glview_direct_info::glview_direct_info() -+{ -+ // TODO: See direct_window_data() in app_server's ServerWindow.cpp -+ direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); -+ direct_connected = false; -+ enable_direct_mode = false; -+} -+ -+ -+glview_direct_info::~glview_direct_info() -+{ -+ free(direct_info); -+} -+ -diff --git a/src/hgl/SConscript b/src/hgl/SConscript -new file mode 100644 -index 0000000..70db149 ---- /dev/null -+++ b/src/hgl/SConscript -@@ -0,0 +1,36 @@ -+####################################################################### -+# SConscript for Haiku OpenGL kit -+ -+Import('*') -+ -+env = env.Clone() -+ -+env.Append(CPPPATH = [ -+ '#/src/mapi', -+ '#/src/mesa', -+ '#/src/mesa/main', -+ '#/include/HaikuGL', -+ '/boot/system/develop/headers/private', -+ Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers -+]) -+ -+env.Prepend(LIBS = [ -+ glapi -+]) -+ -+sources = [ -+ 'GLView.cpp', -+ 'GLRenderer.cpp', -+ 'GLRendererRoster.cpp', -+ 'GLDispatcher.cpp', -+] -+ -+# libGL.so -+libgl = env.SharedLibrary( -+ target ='GL', -+ source = sources, -+ SHLIBSUFFIX = env['SHLIBSUFFIX'], -+) -+ -+env.Alias('libgl-haiku', libgl) -+Export('libgl') -diff --git a/src/mesa/drivers/haiku/swrast/SConscript b/src/mesa/drivers/haiku/swrast/SConscript -index ca0423e..aef7300 100644 ---- a/src/mesa/drivers/haiku/swrast/SConscript -+++ b/src/mesa/drivers/haiku/swrast/SConscript -@@ -16,6 +16,8 @@ env.Prepend(LIBS = [ - mesa, - ]) - -+env.Prepend(LIBS = [libgl]) -+ - sources = [ - 'SoftwareRast.cpp' - ] --- -1.8.3.4 - - -From 23cc377e1ac5046aae825580033c8ec23e80d670 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Tue, 21 Jan 2014 18:40:22 +0000 -Subject: hgl: atomic stores no longer need to be volatile - -* Our atomics were revamped to no longer require - volatile int pointers - -diff --git a/include/HaikuGL/GLRenderer.h b/include/HaikuGL/GLRenderer.h -index 7ffcc34..02a438d 100644 ---- a/include/HaikuGL/GLRenderer.h -+++ b/include/HaikuGL/GLRenderer.h -@@ -61,7 +61,7 @@ private: - virtual status_t _Reserved_Renderer_3(int32, void *); - virtual status_t _Reserved_Renderer_4(int32, void *); - -- volatile int32 fRefCount; // How much we're still usefull? -+ int32 fRefCount; // How much we're still usefull? - BGLView* fView; // Never forget who is the boss! - ulong fOptions; // Keep that tune in memory - BGLDispatcher* fDispatcher;// Our personal GL API call dispatcher --- -1.8.3.4 - - -From bcf7efda26051f122039df4c33e301fc6de59974 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Wed, 12 Feb 2014 20:11:25 +0000 -Subject: hgl: release add-ons on GLView destruction. - - -diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp -index 1712a87..3833b2c 100644 ---- a/src/hgl/GLRendererRoster.cpp -+++ b/src/hgl/GLRendererRoster.cpp -@@ -79,7 +79,14 @@ GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) - - GLRendererRoster::~GLRendererRoster() - { -- -+ RendererMap::iterator iterator = fRenderers.begin(); -+ for (; iterator != fRenderers.end(); iterator++) { -+ struct renderer_item item = iterator->second; -+ image_id image = item.image; -+ item.renderer->Release(); -+ // this will delete the renderer -+ unload_add_on(image); -+ } - } - - -@@ -91,6 +98,7 @@ GLRendererRoster::GetRenderer(int32 id) - return NULL; - - struct renderer_item item = iterator->second; -+ item.renderer->Acquire(); - return item.renderer; - } - -@@ -105,7 +113,7 @@ GLRendererRoster::AddDefaultPaths() - B_SYSTEM_ADDONS_DIRECTORY, - }; - -- for (uint32 i = fSafeMode ? 4 : 0; -+ for (uint32 i = fSafeMode ? 3 : 0; - i < sizeof(paths) / sizeof(paths[0]); i++) { - BPath path; - status_t status = find_directory(paths[i], &path, true); -diff --git a/src/hgl/GLView.cpp b/src/hgl/GLView.cpp -index 9ae5b5c..477b430 100644 ---- a/src/hgl/GLView.cpp -+++ b/src/hgl/GLView.cpp -@@ -57,8 +57,11 @@ BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode, - BGLView::~BGLView() - { - delete fClipInfo; -- if (fRenderer) -+ if (fRenderer) { - fRenderer->Release(); -+ fRenderer = NULL; -+ } -+ delete fRoster; - } - - --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.1.0.patchset b/sys-libs/mesa/patches/mesa-10.1.0.patchset deleted file mode 100644 index 1e55016a4..000000000 --- a/sys-libs/mesa/patches/mesa-10.1.0.patchset +++ /dev/null @@ -1,65 +0,0 @@ -From 14ba24e39946117b05fd97a077bad7eeda8790f5 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Wed, 19 Mar 2014 00:58:01 +0000 -Subject: [PATCH] haiku: Fix build through scons corrections and viewport fixes - -* Add HAVE_PTHREAD, we do have pthread support wrappers now - for non-native Haiku APIs. -* Viewport changed behavior recently breaking the build. - We fix this by looking at the gl_context ViewportArray - (Thanks Brian for the idea) ---- - scons/gallium.py | 5 +++++ - src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 12 +++++++++--- - 2 files changed, 14 insertions(+), 3 deletions(-) - -diff --git a/scons/gallium.py b/scons/gallium.py -index 70ee89b..9796c78 100755 ---- a/scons/gallium.py -+++ b/scons/gallium.py -@@ -269,6 +269,11 @@ def generate(env): - cppdefines += ['HAVE_ALIAS'] - else: - cppdefines += ['GLX_ALIAS_UNSUPPORTED'] -+ if env['platform'] == 'haiku': -+ cppdefines += [ -+ 'HAVE_PTHREAD', -+ 'HAVE_POSIX_MEMALIGN' -+ ] - if platform == 'windows': - cppdefines += [ - 'WIN32', -diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -index 1078cb7..52cd764 100644 ---- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -@@ -44,9 +44,15 @@ extern "C" { - - - static void --hgl_viewport(struct gl_context* glContext, GLint x, GLint y, -- GLsizei width, GLsizei height) -+hgl_viewport(struct gl_context* glContext) - { -+ // TODO: We should try to eliminate this function -+ -+ GLint x = glContext->ViewportArray[0].X; -+ GLint y = glContext->ViewportArray[0].Y; -+ GLint width = glContext->ViewportArray[0].Width; -+ GLint height = glContext->ViewportArray[0].Height; -+ - TRACE("%s(glContext: %p, x: %d, y: %d, w: %d, h: %d\n", __func__, - glContext, x, y, width, height); - -@@ -525,7 +531,7 @@ GalliumContext::ResizeViewport(int32 width, int32 height) - for (context_id i = 0; i < CONTEXT_MAX; i++) { - if (fContext[i] && fContext[i]->st) { - struct st_context *stContext = (struct st_context*)fContext[i]->st; -- _mesa_set_viewport(stContext->ctx, 0, 0, width, height); -+ _mesa_set_viewport(stContext->ctx, 0, 0, 0, width, height); - st_manager_validate_framebuffers(stContext); - } - } --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.1.1.patchset b/sys-libs/mesa/patches/mesa-10.1.1.patchset deleted file mode 100644 index c81b248ef..000000000 --- a/sys-libs/mesa/patches/mesa-10.1.1.patchset +++ /dev/null @@ -1,117 +0,0 @@ -From a0bfc0e62448df26e514b41de89aced988a6ab53 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Fri, 22 Aug 2014 20:42:37 +0200 -Subject: Fix for strings.h - - -diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy -index f939fe8..6629904 100644 ---- a/src/glsl/glsl_parser.yy -+++ b/src/glsl/glsl_parser.yy -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - #include "ast.h" -diff --git a/src/hgl/GLRendererRoster.cpp b/src/hgl/GLRendererRoster.cpp -index 1712a87..9c0717c 100644 ---- a/src/hgl/GLRendererRoster.cpp -+++ b/src/hgl/GLRendererRoster.cpp -@@ -23,6 +23,7 @@ - - #include - #include -+#include - - - extern "C" status_t _kern_get_safemode_option(const char* parameter, --- -1.8.3.4 - - -From edead798024ba52ea21c841ae9613e27754ea0e6 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 21 Mar 2015 18:19:16 +0000 -Subject: Fixed build with llvm 3.5 - - -diff --git a/scons/gallium.py b/scons/gallium.py -index 9796c78..1edd3ba 100755 ---- a/scons/gallium.py -+++ b/scons/gallium.py -@@ -329,6 +329,7 @@ def generate(env): - # Work around aliasing bugs - developers should comment this out - ccflags += ['-fno-strict-aliasing'] - ccflags += ['-g'] -+ cxxflags += ['-std=c++11'] - if env['build'] in ('checked', 'profile'): - # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling? - ccflags += [ -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp -index 1c886ea..b51fdf1 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp -+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp -@@ -56,10 +56,16 @@ - #include - #endif /* HAVE_LLVM >= 0x0301 */ - --#if HAVE_LLVM >= 0x0303 -+#if HAVE_LLVM >= 0x0305 -+#define OwningPtr std::unique_ptr -+#elif HAVE_LLVM >= 0x0303 - #include - #endif - -+#if HAVE_LLVM >= 0x0305 -+#include -+#endif -+ - #include "util/u_math.h" - #include "util/u_debug.h" - -@@ -226,17 +232,6 @@ disassemble(const void* func, llvm::raw_ostream & Out) - } - - #if HAVE_LLVM >= 0x0300 -- const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); -- OwningPtr DisAsm(T->createMCDisassembler(*STI)); --#else -- OwningPtr DisAsm(T->createMCDisassembler()); --#endif -- if (!DisAsm) { -- Out << "error: no disassembler for target " << Triple << "\n"; -- return 0; -- } -- --#if HAVE_LLVM >= 0x0300 - unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); - #else - int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); -@@ -256,6 +251,21 @@ disassemble(const void* func, llvm::raw_ostream & Out) - } - #endif - -+#if HAVE_LLVM >= 0x0305 -+ OwningPtr STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), "")); -+ OwningPtr MCCtx(new MCContext(AsmInfo.get(), MRI.get(), 0)); -+ OwningPtr DisAsm(T->createMCDisassembler(*STI, *MCCtx)); -+#elif HAVE_LLVM >= 0x0300 -+ const MCSubtargetInfo *STI = T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""); -+ OwningPtr DisAsm(T->createMCDisassembler(*STI)); -+#else -+ OwningPtr DisAsm(T->createMCDisassembler()); -+#endif -+ if (!DisAsm) { -+ Out << "error: no disassembler for target " << Triple << "\n"; -+ return 0; -+ } -+ - #if HAVE_LLVM >= 0x0301 - OwningPtr Printer( - T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.2.9.patchset b/sys-libs/mesa/patches/mesa-10.2.9.patchset deleted file mode 100644 index 9be88838f..000000000 --- a/sys-libs/mesa/patches/mesa-10.2.9.patchset +++ /dev/null @@ -1,38 +0,0 @@ -From 2307170a7f009bc41a24bdf430b5d48758b3b042 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Tue, 20 May 2014 19:20:58 -0500 -Subject: [PATCH] haiku: Add missing u_memory.h for FREE() - -Acked-by: Brian Paul ---- - src/gallium/targets/haiku-softpipe/GalliumContext.cpp | 1 + - src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -index 52cd764..d6b5f85 100644 ---- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp -@@ -26,6 +26,7 @@ extern "C" { - #include "state_tracker/st_gl_api.h" - #include "state_tracker/st_manager.h" - #include "state_tracker/sw_winsys.h" -+#include "util/u_memory.h" - #include "hgl_sw_winsys.h" - - #include "target-helpers/inline_sw_helper.h" -diff --git a/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp b/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp -index dd726ef..f367d9d 100644 ---- a/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp -+++ b/src/gallium/targets/haiku-softpipe/GalliumFramebuffer.cpp -@@ -16,6 +16,7 @@ extern "C" { - #include "main/renderbuffer.h" - #include "pipe/p_format.h" - #include "state_tracker/st_manager.h" -+#include "util/u_memory.h" - } - - #include "GalliumContext.h" --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.4.7.patchset b/sys-libs/mesa/patches/mesa-10.4.7.patchset deleted file mode 100644 index 835b2d47c..000000000 --- a/sys-libs/mesa/patches/mesa-10.4.7.patchset +++ /dev/null @@ -1,21 +0,0 @@ -From a295b3a477db9016698d30003a5983a033729747 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 21 Mar 2015 22:25:11 +0000 -Subject: Haiku: add missing include - - -diff --git a/src/gallium/state_trackers/hgl/SConscript b/src/gallium/state_trackers/hgl/SConscript -index 82a0ce0..d2389c8 100644 ---- a/src/gallium/state_trackers/hgl/SConscript -+++ b/src/gallium/state_trackers/hgl/SConscript -@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ - '#/src', - '#/src/mapi', - '#/src/mesa', -+ '#/include/HaikuGL', - ]) - - sources = [ --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-10.5.2.patchset b/sys-libs/mesa/patches/mesa-10.5.2.patchset deleted file mode 100644 index 725cb39ec..000000000 --- a/sys-libs/mesa/patches/mesa-10.5.2.patchset +++ /dev/null @@ -1,152 +0,0 @@ -From 4cf1425f9e4e1935b8660e6be0969919d37dcae8 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 4 Apr 2015 11:43:28 -0500 -Subject: [PATCH 1/2] Haiku: Fix build - -* Add missing #src include for util macros ---- - src/gallium/auxiliary/util/u_math.h | 2 +- - src/hgl/SConscript | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h -index 5db5b66..d4f955d 100644 ---- a/src/gallium/auxiliary/util/u_math.h -+++ b/src/gallium/auxiliary/util/u_math.h -@@ -528,7 +528,7 @@ unsigned ffs( unsigned u ) - - return i; - } --#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) -+#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID) || defined(__HAIKU__) - #define ffs __builtin_ffs - #define ffsll __builtin_ffsll - #endif -diff --git a/src/hgl/SConscript b/src/hgl/SConscript -index 70db149..71881f5 100644 ---- a/src/hgl/SConscript -+++ b/src/hgl/SConscript -@@ -6,6 +6,7 @@ Import('*') - env = env.Clone() - - env.Append(CPPPATH = [ -+ '#/src', - '#/src/mapi', - '#/src/mesa', - '#/src/mesa/main', --- -1.8.3.4 - -From 29dbd1148b6b114242586c4d619e406ae757e7ff Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 4 Apr 2015 11:44:21 -0500 -Subject: [PATCH 2/2] scons: Fix build by disabling OpenVG (cherry pick missed - in 10.5.2) - ---- - src/SConscript | 2 -- - src/gallium/SConscript | 1 - - src/gallium/targets/egl-static/SConscript | 11 ----------- - 3 files changed, 14 deletions(-) - -diff --git a/src/SConscript b/src/SConscript -index c25adc7..188ab08 100644 ---- a/src/SConscript -+++ b/src/SConscript -@@ -27,8 +27,6 @@ if env['platform'] in ['haiku']: - - SConscript('mesa/SConscript') - --SConscript('mapi/vgapi/SConscript') -- - if not env['embedded']: - if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'): - SConscript('glx/SConscript') -diff --git a/src/gallium/SConscript b/src/gallium/SConscript -index 25d0af6..baacd29 100644 ---- a/src/gallium/SConscript -+++ b/src/gallium/SConscript -@@ -62,7 +62,6 @@ SConscript([ - ]) - - if not env['embedded']: -- SConscript('state_trackers/vega/SConscript') - if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'sunos'): - SConscript([ - 'state_trackers/egl/SConscript', -diff --git a/src/gallium/targets/egl-static/SConscript b/src/gallium/targets/egl-static/SConscript -index e423d5d..bbeedaa 100644 ---- a/src/gallium/targets/egl-static/SConscript -+++ b/src/gallium/targets/egl-static/SConscript -@@ -14,7 +14,6 @@ env.Append(CPPPATH = [ - '#/src/gallium/include', - '#/src/gallium/winsys', - '#/src/gallium/state_trackers/egl', -- '#/src/gallium/state_trackers/vega', - '#/src/mesa', - ]) - -@@ -74,14 +73,6 @@ if env['gles']: - glapi_name = 'glapi' if env['platform'] != 'windows' else 'libglapi' - env.Prepend(LIBS = [glapi_name, glsl, mesa]) - --# OpenVG --if True: -- env.Append(CPPDEFINES = ['FEATURE_VG=1']) -- env.Prepend(LIBPATH = [openvg.dir]) -- # manually add LIBPREFIX on windows -- openvg_name = 'OpenVG' if env['platform'] != 'windows' else 'libOpenVG' -- env.Prepend(LIBS = [openvg_name, st_vega]) -- - if env['HAVE_X11']: - env.Prepend(LIBS = [ - ws_xlib, -@@ -107,8 +98,6 @@ egl_gallium = env.SharedLibrary( - source = sources, - ) - --env.Depends(egl_gallium, [openvg]) -- - egl_gallium = env.InstallSharedLibrary(egl_gallium, version=(1, 4, 0)) - - env.Alias('egl-gallium', egl_gallium) --- -1.8.3.4 - -From c62410aa7cb68813d83f8d40d601a382b2f0b970 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 4 Apr 2015 13:33:28 -0500 -Subject: [PATCH] state_tracker/hgl: Fix missing include directory - ---- - src/egl/drivers/haiku/SConscript | 1 + - src/gallium/state_trackers/hgl/SConscript | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/egl/drivers/haiku/SConscript b/src/egl/drivers/haiku/SConscript -index 9dd2f70..72bac1f 100644 ---- a/src/egl/drivers/haiku/SConscript -+++ b/src/egl/drivers/haiku/SConscript -@@ -8,6 +8,7 @@ env.Append(CPPDEFINES = [ - - env.Append(CPPPATH = [ - '#/include', -+ '#/include/HaikuGL', - '#/src/egl/main', - '#/src/loader', - ]) -diff --git a/src/gallium/state_trackers/hgl/SConscript b/src/gallium/state_trackers/hgl/SConscript -index 82a0ce0..d2389c8 100644 ---- a/src/gallium/state_trackers/hgl/SConscript -+++ b/src/gallium/state_trackers/hgl/SConscript -@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ - '#/src', - '#/src/mapi', - '#/src/mesa', -+ '#/include/HaikuGL', - ]) - - sources = [ --- -1.8.3.4 - diff --git a/sys-libs/mesa/patches/mesa-11.0.1.patchset b/sys-libs/mesa/patches/mesa-11.0.1.patchset deleted file mode 100644 index 3e9fb5be6..000000000 --- a/sys-libs/mesa/patches/mesa-11.0.1.patchset +++ /dev/null @@ -1,48 +0,0 @@ -From c35ec7ccdc1a308fc2dbc542bf9935302310673f Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 26 Sep 2015 11:39:09 -0500 -Subject: [PATCH] state_trackers/hgl: Fix missing include path - ---- - src/gallium/state_trackers/hgl/SConscript | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/gallium/state_trackers/hgl/SConscript b/src/gallium/state_trackers/hgl/SConscript -index 82a0ce0..d2389c8 100644 ---- a/src/gallium/state_trackers/hgl/SConscript -+++ b/src/gallium/state_trackers/hgl/SConscript -@@ -9,6 +9,7 @@ env.Append(CPPPATH = [ - '#/src', - '#/src/mapi', - '#/src/mesa', -+ '#/include/HaikuGL', - ]) - - sources = [ --- -2.2.2 - -From 50c6e31d33e7aec3896b415f656f67a36729eeb9 Mon Sep 17 00:00:00 2001 -From: Alexander von Gluck IV -Date: Sat, 26 Sep 2015 11:49:36 -0500 -Subject: [PATCH] egl: Fix missing Haiku include path - ---- - src/egl/SConscript | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/egl/SConscript b/src/egl/SConscript -index f8102db..8f8b11a 100644 ---- a/src/egl/SConscript -+++ b/src/egl/SConscript -@@ -8,6 +8,7 @@ env = env.Clone() - - env.Append(CPPPATH = [ - '#/include', -+ '#/include/HaikuGL', - '#/src/egl/main', - '#/src', - ]) --- -2.2.2 - diff --git a/sys-libs/mesa/patches/mesa-11.2.2.patchset b/sys-libs/mesa/patches/mesa-11.2.2.patchset deleted file mode 100644 index 8dc67f3eb..000000000 --- a/sys-libs/mesa/patches/mesa-11.2.2.patchset +++ /dev/null @@ -1,41 +0,0 @@ -From 322b34877fbeefdb0d25c04c6c43ab1d335fe666 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 19 Nov 2016 10:30:12 +0000 -Subject: Haiku patch - - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -index 30ef37c..28d7a0d 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp -@@ -110,7 +110,7 @@ static LLVMEnsureMultithreaded lLVMEnsureMultithreaded; - - } - --static once_flag init_native_targets_once_flag; -+static once_flag init_native_targets_once_flag = ONCE_FLAG_INIT; - - static void init_native_targets() - { -diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -index 89dd547..be73b29 100644 ---- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -+++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -@@ -105,8 +105,12 @@ hgl_winsys_convert_cs(enum pipe_format format) - - static struct sw_displaytarget* - hgl_winsys_displaytarget_create(struct sw_winsys* winsys, -- unsigned textureUsage, enum pipe_format format, unsigned width, -- unsigned height, unsigned alignment, unsigned* stride) -+ unsigned tex_usage, -+ enum pipe_format format, -+ unsigned width, unsigned height, -+ unsigned alignment, -+ const void *front_private, -+ unsigned *stride) - { - struct haiku_displaytarget* haikuDisplayTarget - = CALLOC_STRUCT(haiku_displaytarget); --- -2.2.2 - diff --git a/sys-libs/mesa/patches/mesa-12.0.4.patchset b/sys-libs/mesa/patches/mesa-12.0.4.patchset deleted file mode 100644 index 61ff6cafa..000000000 --- a/sys-libs/mesa/patches/mesa-12.0.4.patchset +++ /dev/null @@ -1,48 +0,0 @@ -From 60ca041bf3060a3c342f0b11498f9e0f615339ee Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 19 Nov 2016 10:30:12 +0000 -Subject: Haiku patch - - -diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h -index 7da7f53..236be36 100644 ---- a/src/gallium/auxiliary/util/u_debug.h -+++ b/src/gallium/auxiliary/util/u_debug.h -@@ -38,14 +38,13 @@ - #ifndef U_DEBUG_H_ - #define U_DEBUG_H_ - -+#include "os/os_misc.h" - - #if defined(PIPE_OS_HAIKU) - /* Haiku provides debug_printf in libroot with OS.h */ - #include - #endif - --#include "os/os_misc.h" -- - #include "pipe/p_format.h" - #include "pipe/p_defines.h" - -diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -index 89dd547..be73b29 100644 ---- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -+++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -@@ -105,8 +105,12 @@ hgl_winsys_convert_cs(enum pipe_format format) - - static struct sw_displaytarget* - hgl_winsys_displaytarget_create(struct sw_winsys* winsys, -- unsigned textureUsage, enum pipe_format format, unsigned width, -- unsigned height, unsigned alignment, unsigned* stride) -+ unsigned tex_usage, -+ enum pipe_format format, -+ unsigned width, unsigned height, -+ unsigned alignment, -+ const void *front_private, -+ unsigned *stride) - { - struct haiku_displaytarget* haikuDisplayTarget - = CALLOC_STRUCT(haiku_displaytarget); --- -2.2.2 - diff --git a/sys-libs/mesa/patches/mesa-13.0.4.patchset b/sys-libs/mesa/patches/mesa-13.0.4.patchset deleted file mode 100644 index 61ff6cafa..000000000 --- a/sys-libs/mesa/patches/mesa-13.0.4.patchset +++ /dev/null @@ -1,48 +0,0 @@ -From 60ca041bf3060a3c342f0b11498f9e0f615339ee Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 19 Nov 2016 10:30:12 +0000 -Subject: Haiku patch - - -diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h -index 7da7f53..236be36 100644 ---- a/src/gallium/auxiliary/util/u_debug.h -+++ b/src/gallium/auxiliary/util/u_debug.h -@@ -38,14 +38,13 @@ - #ifndef U_DEBUG_H_ - #define U_DEBUG_H_ - -+#include "os/os_misc.h" - - #if defined(PIPE_OS_HAIKU) - /* Haiku provides debug_printf in libroot with OS.h */ - #include - #endif - --#include "os/os_misc.h" -- - #include "pipe/p_format.h" - #include "pipe/p_defines.h" - -diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -index 89dd547..be73b29 100644 ---- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -+++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.c -@@ -105,8 +105,12 @@ hgl_winsys_convert_cs(enum pipe_format format) - - static struct sw_displaytarget* - hgl_winsys_displaytarget_create(struct sw_winsys* winsys, -- unsigned textureUsage, enum pipe_format format, unsigned width, -- unsigned height, unsigned alignment, unsigned* stride) -+ unsigned tex_usage, -+ enum pipe_format format, -+ unsigned width, unsigned height, -+ unsigned alignment, -+ const void *front_private, -+ unsigned *stride) - { - struct haiku_displaytarget* haikuDisplayTarget - = CALLOC_STRUCT(haiku_displaytarget); --- -2.2.2 - diff --git a/sys-libs/mesa/patches/mesa-9.0.1.patch b/sys-libs/mesa/patches/mesa-9.0.1.patch deleted file mode 100644 index 457c1ce1b..000000000 --- a/sys-libs/mesa/patches/mesa-9.0.1.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -Naur Mesa-9.0.1/scons/gallium.py Mesa-9.0.1-haiku/scons/gallium.py ---- Mesa-9.0.1/scons/gallium.py 2012-11-09 12:16:31.041680896 -0600 -+++ Mesa-9.0.1-haiku/scons/gallium.py 2012-12-19 16:03:56.564658176 -0600 -@@ -361,8 +361,7 @@ - ccflags += [ - '-mstackrealign', # ensure stack is aligned - '-march=i586', # Haiku target is Pentium -- '-mtune=i686', # use i686 where we can -- '-mmmx' # use mmx math where we can -+ '-mtune=i686' # use i686 where we can - ] - if env['machine'] == 'x86_64': - ccflags += ['-m64'] -diff -Naur Mesa-9.0.1/scons/llvm.py Mesa-9.0.1-haiku/scons/llvm.py ---- Mesa-9.0.1/scons/llvm.py 2012-08-31 18:33:41.041680896 -0500 -+++ Mesa-9.0.1-haiku/scons/llvm.py 2012-12-18 23:05:50.677642240 -0600 -@@ -183,6 +183,9 @@ - if llvm_version >= distutils.version.LooseVersion('3.1'): - components.append('mcjit') - -+ if llvm_version >= distutils.version.LooseVersion('3.2'): -+ env.Append(CXXFLAGS = ('-fno-rtti',)) -+ - env.ParseConfig('llvm-config --libs ' + ' '.join(components)) - env.ParseConfig('llvm-config --ldflags') - except OSError: -diff -Naur Mesa-9.0.1/src/gallium/auxiliary/Makefile Mesa-9.0.1-haiku/src/gallium/auxiliary/Makefile ---- Mesa-9.0.1/src/gallium/auxiliary/Makefile 2012-08-31 18:33:41.050331648 -0500 -+++ Mesa-9.0.1-haiku/src/gallium/auxiliary/Makefile 2012-12-18 23:06:31.179306496 -0600 -@@ -15,6 +15,10 @@ - $(GALLIVM_CPP_SOURCES) - endif - -+# LLVM >= 3.2 requires -fno-rtti -+ifeq ($(shell expr `echo $(LLVM_VERSION) | sed -e 's/\([0-9]\)\.\([0-9]\)/\10\2/g'` \>= 302),1) -+CXXFLAGS += -fno-rtti -+endif - - include ../Makefile.template - -diff -Naur Mesa-9.0.1/src/mesa/SConscript Mesa-9.0.1-haiku/src/mesa/SConscript ---- Mesa-9.0.1/src/mesa/SConscript 2012-11-09 12:16:31.015728640 -0600 -+++ Mesa-9.0.1-haiku/src/mesa/SConscript 2012-12-19 16:32:37.285736960 -0600 -@@ -371,7 +371,7 @@ - # - # Assembly sources - # --if env['gcc'] and env['platform'] not in ('darwin', 'windows'): -+if env['gcc'] and env['platform'] not in ('darwin', 'windows', 'haiku'): - if env['machine'] == 'x86': - env.Append(CPPDEFINES = [ - 'USE_X86_ASM', diff --git a/sys-libs/mesa/patches/mesa-9.0.2.patch b/sys-libs/mesa/patches/mesa-9.0.2.patch deleted file mode 100644 index 541ca854e..000000000 --- a/sys-libs/mesa/patches/mesa-9.0.2.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur Mesa-9.0.2/scons/llvm.py Mesa-9.0.2-haiku/scons/llvm.py ---- Mesa-9.0.2/scons/llvm.py 2013-01-22 18:09:32.066322432 +0000 -+++ Mesa-9.0.2-haiku/scons/llvm.py 2013-02-17 21:20:51.626262016 +0000 -@@ -183,6 +183,9 @@ - if llvm_version >= distutils.version.LooseVersion('3.1'): - components.append('mcjit') - -+ if llvm_version >= distutils.version.LooseVersion('3.2'): -+ env.Append(CXXFLAGS = ('-fno-rtti',)) -+ - env.ParseConfig('llvm-config --libs ' + ' '.join(components)) - env.ParseConfig('llvm-config --ldflags') - except OSError: -diff -Naur Mesa-9.0.2/src/mesa/SConscript Mesa-9.0.2-haiku/src/mesa/SConscript ---- Mesa-9.0.2/src/mesa/SConscript 2013-01-22 18:09:32.040370176 +0000 -+++ Mesa-9.0.2-haiku/src/mesa/SConscript 2013-02-17 21:20:22.510394368 +0000 -@@ -371,7 +371,7 @@ - # - # Assembly sources - # --if env['gcc'] and env['platform'] not in ('darwin', 'windows'): -+if env['gcc'] and env['platform'] not in ('darwin', 'windows', 'haiku'): - if env['machine'] == 'x86': - env.Append(CPPDEFINES = [ - 'USE_X86_ASM', diff --git a/sys-libs/mesa/patches/mesa-9.0.patch b/sys-libs/mesa/patches/mesa-9.0.patch deleted file mode 100644 index eac5cce5f..000000000 --- a/sys-libs/mesa/patches/mesa-9.0.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -Naur Mesa-9.0/src/mesa/sources.mak Mesa-9.0-haiku/src/mesa/sources.mak ---- Mesa-9.0/src/mesa/sources.mak 2012-08-31 23:36:09.036700160 +0000 -+++ Mesa-9.0-haiku/src/mesa/sources.mak 2012-10-09 13:17:15.991690752 +0000 -@@ -281,7 +281,6 @@ - $(SRCDIR)x86/x86_xform.c \ - $(SRCDIR)x86/3dnow.c \ - $(SRCDIR)x86/sse.c \ -- $(SRCDIR)x86/rtasm/x86sse.c \ - $(SRCDIR)sparc/sparc.c \ - $(SRCDIR)x86-64/x86-64.c - -diff -Naur Mesa-9.0/src/mesa/tnl/t_vertex_sse.c Mesa-9.0-haiku/src/mesa/tnl/t_vertex_sse.c ---- Mesa-9.0/src/mesa/tnl/t_vertex_sse.c 2012-08-31 23:33:41.058458112 +0000 -+++ Mesa-9.0-haiku/src/mesa/tnl/t_vertex_sse.c 2012-10-09 13:20:34.234356736 +0000 -@@ -36,7 +36,7 @@ - - #if defined(USE_SSE_ASM) - --#include "x86/rtasm/x86sse.h" -+#include "rtasm/rtasm_x86sse.h" - #include "x86/common_x86_asm.h" - - -@@ -356,7 +356,7 @@ - struct x86_reg vp0 = x86_make_reg(file_XMM, 1); - struct x86_reg vp1 = x86_make_reg(file_XMM, 2); - struct x86_reg temp2 = x86_make_reg(file_XMM, 3); -- GLubyte *fixup, *label; -+ GLuint fixup, label; - - /* Push a few regs? - */ -@@ -658,7 +658,8 @@ - p.identity = x86_make_reg(file_XMM, 6); - p.chan0 = x86_make_reg(file_XMM, 7); - -- if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) { -+ x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE); -+ if (p.func.caps == 0) { - vtx->emit = NULL; - return; - } diff --git a/sys-libs/mesa/patches/mesa-9.1.1.patch b/sys-libs/mesa/patches/mesa-9.1.1.patch deleted file mode 100644 index 65aa229e8..000000000 --- a/sys-libs/mesa/patches/mesa-9.1.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur Mesa-9.1.1/src/mesa/main/execmem.c Mesa-9.1.1-haiku/src/mesa/main/execmem.c ---- Mesa-9.1.1/src/mesa/main/execmem.c 2013-03-20 00:14:38.014417920 +0000 -+++ Mesa-9.1.1-haiku/src/mesa/main/execmem.c 2013-04-27 00:42:08.707264512 +0000 -@@ -36,7 +36,7 @@ - - - --#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) -+#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__) - - /* - * Allocate a large block of memory which can hold code then dole it out