inc_vulkan = include_directories('vulkan')
inc_d3d9 = include_directories('D3D9')
inc_gl_internal = include_directories('GL/internal')
+inc_haikugl = include_directories('HaikuGL')
if with_gles1
install_headers(
)
endif
+if with_platform_haiku
+ install_headers(
+ 'HaikuGL/GLRenderer.h', 'HaikuGL/GLView.h', 'HaikuGL/OpenGLKit.h',
+ subdir : 'opengl',
+ )
+endif
+
# Only install the headers if we are building a stand alone implementation and
# not an ICD enabled implementation
if with_gallium_opencl and not with_opencl_icd
else
error('Unknown architecture. Please pass -Ddri-drivers to set driver options. Patches gladly accepted to fix this.')
endif
- elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+ elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system())
# only swrast would make sense here, but gallium swrast is a much better default
_drivers = ''
else
else
error('Unknown architecture. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.')
endif
- elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+ elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system())
_drivers = 'swrast'
else
error('Unknown OS. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.')
else
error('Unknown architecture. Please pass -Dvulkan-drivers to set driver options. Patches gladly accepted to fix this.')
endif
- elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+ elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system())
# No vulkan driver supports windows or macOS currently
_vulkan_drivers = ''
else
_platforms = 'x11,wayland,drm,surfaceless'
elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
_platforms = 'x11,surfaceless'
+ elif ['haiku'].contains(host_machine.system())
+ _platforms = 'haiku'
else
error('Unknown OS. Please pass -Dplatforms to set platforms. Patches gladly accepted to fix this.')
endif
with_platform_x11 = _split.contains('x11')
with_platform_wayland = _split.contains('wayland')
with_platform_drm = _split.contains('drm')
+ with_platform_haiku = _split.contains('haiku')
with_platform_surfaceless = _split.contains('surfaceless')
egl_native_platform = _split[0]
endif
if with_glx == 'auto'
if with_dri
with_glx = 'dri'
+ elif with_platform_haiku
+ with_glx = 'disabled'
elif with_gallium
# Even when building just gallium drivers the user probably wants dri
with_glx = 'dri'
error('Vulkan drivers require dri3 for X11 support')
endif
if with_dri or with_gallium
- if with_glx == 'disabled' and not with_egl
+ if with_glx == 'disabled' and not with_egl and not with_platform_haiku
error('building dri or gallium drivers require at least one window system')
endif
endif
]
pre_args += '-DHAVE_ANDROID_PLATFORM'
endif
+if with_platform_haiku
+ pre_args += '-DHAVE_HAIKU_PLATFORM'
+endif
prog_python2 = find_program('python2')
has_mako = run_command(prog_python2, '-c', 'import mako')
c_args_for_egl = []
link_for_egl = []
deps_for_egl = []
-incs_for_egl = [
- inc_include, inc_src, inc_loader, inc_gbm, include_directories('main'),
-]
+incs_for_egl = [inc_include, inc_src, include_directories('main')]
+
files_egl = files(
'main/eglapi.c',
'main/eglapi.h',
'main/eglsync.h',
'main/eglentrypoint.h',
'main/egltypedefs.h',
- 'drivers/dri2/egl_dri2.c',
- 'drivers/dri2/egl_dri2.h',
- 'drivers/dri2/egl_dri2_fallbacks.h',
)
g_egldispatchstubs_c = custom_target(
capture : true,
)
+if with_dri2
+ files_egl += files(
+ 'drivers/dri2/egl_dri2.c',
+ 'drivers/dri2/egl_dri2.h',
+ 'drivers/dri2/egl_dri2_fallbacks.h',
+ )
+ c_args_for_egl += [
+ '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
+ '-D_EGL_BUILT_IN_DRIVER_DRI2',
+ ]
+endif
+
if with_platform_x11
files_egl += files('drivers/dri2/platform_x11.c')
if with_dri3
endif
if with_platform_drm
files_egl += files('drivers/dri2/platform_drm.c')
- link_for_egl += libgbm
- incs_for_egl += include_directories('../gbm/main')
+ link_for_egl += [libloader, libgbm, libxmlconfig]
+ incs_for_egl += [inc_loader, inc_gbm, include_directories('../gbm/main')]
+ deps_for_egl += dep_libdrm
endif
if with_platform_surfaceless
files_egl += files('drivers/dri2/platform_surfaceless.c')
deps_for_egl += dep_android
files_egl += files('drivers/dri2/platform_android.c')
endif
+if with_platform_haiku
+ incs_for_egl += inc_haikugl
+ c_args_for_egl += [
+ '-D_EGL_BUILT_IN_DRIVER_HAIKU',
+ ]
+ files_egl += files('drivers/haiku/egl_haiku.cpp')
+ link_for_egl += libgl
+ deps_for_egl += cpp.find_library('be')
+endif
# TODO: glvnd
c_args : [
c_vis_args,
c_args_for_egl,
- '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
- '-D_EGL_BUILT_IN_DRIVER_DRI2',
'-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()),
],
include_directories : incs_for_egl,
libswkmsdri = []
endif
subdir('winsys/sw/wrapper')
+if with_platform_haiku
+ subdir('winsys/sw/hgl')
+endif
if with_gallium_swr
if meson.version().version_compare('< 0.44.0')
error('SWR requires meson 0.44.0 or greater.')
if with_gallium_st_nine
subdir('state_trackers/nine')
endif
+if with_platform_haiku
+ subdir('state_trackers/hgl')
+endif
if with_gallium_opencl
# TODO: this isn't really clover specific, but ATM clover is the only
# consumer
if with_gallium_xa
subdir('targets/xa')
endif
+if with_platform_haiku
+ subdir('targets/haiku-softpipe')
+endif
if with_gallium_st_nine
subdir('targets/d3dadapter9')
endif
--- /dev/null
+# Copyright © 2017 Dylan Baker
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+files_libsthgl = files(
+ 'bitmap_wrapper.cpp',
+ 'bitmap_wrapper.h',
+ 'hgl_context.h',
+ 'hgl.c',
+)
+
+libsthgl_c_args = []
+if with_gallium_softpipe
+ libsthgl_c_args += '-DGALLIUM_SOFTPIPE'
+endif
+
+libsthgl = static_library(
+ 'sthgl',
+ files_libsthgl,
+ include_directories : [
+ inc_include, inc_haikugl, inc_util, inc_mesa, inc_mapi, inc_src,
+ inc_gallium, inc_gallium_aux
+ ],
+ c_args : [c_vis_args, libsthgl_c_args],
+)
--- /dev/null
+# Copyright © 2017 Dylan Baker
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libswpipe = shared_library(
+ 'swpipe',
+ files('SoftwareRenderer.cpp', 'GalliumContext.cpp'),
+ include_directories : [
+ inc_common, inc_util, inc_haikugl, inc_gallium_drivers, inc_gallium_winsys,
+ include_directories('../../state_trackers/hgl'),
+ include_directories('/boot/system/develop/headers/private')
+ ],
+ c_args : [c_vis_args],
+ cpp_args : [cpp_vis_args],
+ link_args : [ld_args_bsymbolic, ld_args_gc_sections],
+ link_with : [
+ libglapi, libswhgl, libsthgl, libtrace, librbug, libmesa_util, libcompiler,
+ libmesa_gallium, libglsl, libnir, libgallium, libgl
+ ],
+ dependencies : [
+ driver_swrast, cpp.find_library('be'), cpp.find_library('translation'),
+ cpp.find_library('network'), dep_unwind
+ ]
+)
--- /dev/null
+# Copyright © 2017 Dylan Baker
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libswhgl = static_library(
+ 'swhgl',
+ files('hgl_sw_winsys.c'),
+ c_args : c_vis_args,
+ include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux,
+ include_directories('../../../state_trackers/hgl')
+ ],
+ build_by_default : false,
+)
--- /dev/null
+# Copyright © 2017 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libgl = shared_library(
+ 'GL',
+ files(
+ 'GLView.cpp', 'GLRenderer.cpp', 'GLRendererRoster.cpp', 'GLDispatcher.cpp',
+ ),
+ link_args : [ld_args_bsymbolic, ld_args_gc_sections],
+ include_directories : [
+ inc_src, inc_mapi, inc_mesa, inc_include, inc_glapi, inc_haikugl,
+ inc_gl_internal, include_directories('/system/develop/headers/private')
+ ],
+ link_with : [libglapi_static, libglapi],
+ dependencies : cpp.find_library('be'),
+ install : true,
+)
+
+# TODO: We need some tests here
description : 'Mesa OpenGL ES 1.1 CM library',
version : meson.project_version(),
libraries : libglesv1_cm,
- libraries_private : '-lm -ldl -lpthread -pthread',
+ libraries_private : gl_priv_libs,
)
if with_tests
description : 'Mesa OpenGL ES 2.0 library',
version : meson.project_version(),
libraries : libgles2,
- libraries_private : '-lm -ldl -lpthread -pthread',
+ libraries_private : gl_priv_libs,
)
if with_tests
endif
subdir('mesa')
subdir('loader')
-subdir('glx')
+if with_platform_haiku
+ subdir('hgl')
+endif
+if with_glx != 'disabled'
+ subdir('glx')
+endif
if with_gbm
subdir('gbm')
else