diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-29 10:51:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-01-29 10:51:18 +0000 |
commit | 726e4bceb8bf5b8123eda80e45a9fdeb016f3790 (patch) | |
tree | 32ed745d6aeb44b4c130f647e49d6627320a3857 /lib/mesa/src/glx | |
parent | 5c0a71df6e14d3ae04cc0faa6dad6e5d0a01d27a (diff) |
Import Mesa 18.3.2
Diffstat (limited to 'lib/mesa/src/glx')
-rw-r--r-- | lib/mesa/src/glx/apple/apple_glx_log.c | 1 | ||||
-rw-r--r-- | lib/mesa/src/glx/apple/meson.build | 61 | ||||
-rw-r--r-- | lib/mesa/src/glx/dri2_priv.h | 5 | ||||
-rw-r--r-- | lib/mesa/src/glx/dri_common.h | 2 | ||||
-rw-r--r-- | lib/mesa/src/glx/drisw_priv.h | 8 | ||||
-rw-r--r-- | lib/mesa/src/glx/glx_error.h | 6 | ||||
-rw-r--r-- | lib/mesa/src/glx/glxcurrent.c | 27 | ||||
-rw-r--r-- | lib/mesa/src/glx/glxext.c | 13 | ||||
-rw-r--r-- | lib/mesa/src/glx/glxextensions.c | 5 | ||||
-rw-r--r-- | lib/mesa/src/glx/indirect_glx.c | 16 | ||||
-rw-r--r-- | lib/mesa/src/glx/meson.build | 172 | ||||
-rw-r--r-- | lib/mesa/src/glx/tests/fake_glx_screen.cpp | 12 | ||||
-rw-r--r-- | lib/mesa/src/glx/tests/indirect_api.cpp | 4 | ||||
-rw-r--r-- | lib/mesa/src/glx/tests/meson.build | 54 | ||||
-rw-r--r-- | lib/mesa/src/glx/windows/meson.build | 68 |
15 files changed, 419 insertions, 35 deletions
diff --git a/lib/mesa/src/glx/apple/apple_glx_log.c b/lib/mesa/src/glx/apple/apple_glx_log.c index a3f446c26..ea39d3095 100644 --- a/lib/mesa/src/glx/apple/apple_glx_log.c +++ b/lib/mesa/src/glx/apple/apple_glx_log.c @@ -97,6 +97,7 @@ void _apple_glx_vlog(int level, const char *file, const char *function, fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ", _asl_level_string(level), file, line, function, thread); vfprintf(stderr, fmt, args2); + va_end(args2); } msg = asl_new(ASL_TYPE_MSG); diff --git a/lib/mesa/src/glx/apple/meson.build b/lib/mesa/src/glx/apple/meson.build new file mode 100644 index 000000000..c6b1d617c --- /dev/null +++ b/lib/mesa/src/glx/apple/meson.build @@ -0,0 +1,61 @@ +# Copyright © 2017 Jon Turney + +# 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. + +# library for native GL on macos +files_libappleglx = files( + 'apple_cgl.c', + 'apple_cgl.h', + 'appledri.c', + 'appledri.h', + 'appledristr.h', + 'apple_glapi.c', + 'apple_glx.c', + 'apple_glx_context.c', + 'apple_glx_context.h', + 'apple_glx_drawable.c', + 'apple_glx_drawable.h', + 'apple_glx.h', + 'apple_glx_log.c', + 'apple_glx_log.h', + 'apple_glx_pbuffer.c', + 'apple_glx_pixmap.c', + 'apple_glx_surface.c', + 'apple_visual.c', + 'apple_visual.h', + 'apple_xgl_api.h', + 'apple_xgl_api_read.c', + 'apple_xgl_api_stereo.c', + 'apple_xgl_api_viewport.c', + 'glx_empty.c', +) + +dep_xplugin = null_dep +if with_dri_platform == 'apple' + dep_xplugin = meson.get_compiler('c').find_library('Xplugin') +endif + +libappleglx = static_library( + 'glxapple', + [files_libappleglx, glapitable_h], + include_directories: [inc_mesa, inc_glx, inc_src, inc_include, inc_glapi], + dependencies: [dep_xext, dep_xplugin], + c_args: [c_vis_args], + build_by_default: false, +) diff --git a/lib/mesa/src/glx/dri2_priv.h b/lib/mesa/src/glx/dri2_priv.h index 30ab2cdd8..a93551b14 100644 --- a/lib/mesa/src/glx/dri2_priv.h +++ b/lib/mesa/src/glx/dri2_priv.h @@ -30,6 +30,9 @@ * Kristian Høgsberg (krh@redhat.com) */ +#ifndef DRI2_PRIV_H +#define DRI2_PRIV_H + #ifdef __cplusplus extern "C" { #endif @@ -82,3 +85,5 @@ dri2_interop_export_object(struct glx_context *ctx, #ifdef __cplusplus } #endif + +#endif diff --git a/lib/mesa/src/glx/dri_common.h b/lib/mesa/src/glx/dri_common.h index 947d33177..4d97ff82b 100644 --- a/lib/mesa/src/glx/dri_common.h +++ b/lib/mesa/src/glx/dri_common.h @@ -78,6 +78,6 @@ extern bool dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, unsigned *major_ver, unsigned *minor_ver, uint32_t *render_type, uint32_t *flags, unsigned *api, - int *reset, unsigned *error); + int *reset, int *release, unsigned *error); #endif /* _DRI_COMMON_H */ diff --git a/lib/mesa/src/glx/drisw_priv.h b/lib/mesa/src/glx/drisw_priv.h index 5d4790031..259fc864f 100644 --- a/lib/mesa/src/glx/drisw_priv.h +++ b/lib/mesa/src/glx/drisw_priv.h @@ -23,6 +23,11 @@ * SOFTWARE. */ +#ifndef DRISW_PRIV_H +#define DRISW_PRIV_H + +#include <X11/extensions/XShm.h> + struct drisw_display { __GLXDRIdisplay base; @@ -62,6 +67,7 @@ struct drisw_drawable __DRIdrawable *driDrawable; XVisualInfo *visinfo; XImage *ximage; + XShmSegmentInfo shminfo; }; _X_HIDDEN int @@ -70,3 +76,5 @@ drisw_query_renderer_integer(struct glx_screen *base, int attribute, _X_HIDDEN int drisw_query_renderer_string(struct glx_screen *base, int attribute, const char **value); + +#endif diff --git a/lib/mesa/src/glx/glx_error.h b/lib/mesa/src/glx/glx_error.h index 5d3992672..6a2f32aa5 100644 --- a/lib/mesa/src/glx/glx_error.h +++ b/lib/mesa/src/glx/glx_error.h @@ -26,6 +26,10 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ + +#ifndef GLX_ERROR_H +#define GLX_ERROR_H + #include <stdbool.h> #include <stdint.h> #include <X11/Xlib.h> @@ -45,3 +49,5 @@ _X_HIDDEN void __glXSendErrorForXcb(Display * dpy, #ifdef __cplusplus } #endif + +#endif diff --git a/lib/mesa/src/glx/glxcurrent.c b/lib/mesa/src/glx/glxcurrent.c index d1193265f..2b9c708c3 100644 --- a/lib/mesa/src/glx/glxcurrent.c +++ b/lib/mesa/src/glx/glxcurrent.c @@ -36,8 +36,8 @@ #include <pthread.h> #include "glxclient.h" - #include "glapi.h" +#include "glx_error.h" /* ** We setup some dummy structures here so that the API can be used @@ -165,21 +165,6 @@ glXGetCurrentDrawable(void) return gc->currentDrawable; } -static void -__glXGenerateError(Display * dpy, XID resource, - BYTE errorCode, CARD16 minorCode) -{ - xError error; - - error.errorCode = errorCode; - error.resourceID = resource; - error.sequenceNumber = dpy->request; - error.type = X_Error; - error.majorCode = __glXSetupForCommand(dpy); - error.minorCode = minorCode; - _XError(dpy, &error); -} - /** * Make a particular context current. * @@ -209,6 +194,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, return True; } + /* can't have only one be 0 */ + if (!!draw != !!read) { + __glXUnlock(); + __glXSendError(dpy, BadMatch, None, X_GLXMakeContextCurrent, True); + return False; + } + if (oldGC != &dummyContext) { if (--oldGC->thread_refcount == 0) { oldGC->vtable->unbind(oldGC, gc); @@ -228,7 +220,8 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, if (gc->vtable->bind(gc, oldGC, draw, read) != Success) { __glXSetCurrentContextNull(); __glXUnlock(); - __glXGenerateError(dpy, None, GLXBadContext, X_GLXMakeContextCurrent); + __glXSendError(dpy, GLXBadContext, None, X_GLXMakeContextCurrent, + False); return GL_FALSE; } diff --git a/lib/mesa/src/glx/glxext.c b/lib/mesa/src/glx/glxext.c index 5f23d3717..cef819203 100644 --- a/lib/mesa/src/glx/glxext.c +++ b/lib/mesa/src/glx/glxext.c @@ -343,9 +343,12 @@ static GLint convert_from_x_visual_type(int visualType) { static const int glx_visual_types[] = { - GLX_STATIC_GRAY, GLX_GRAY_SCALE, - GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, - GLX_TRUE_COLOR, GLX_DIRECT_COLOR + [StaticGray] = GLX_STATIC_GRAY, + [GrayScale] = GLX_GRAY_SCALE, + [StaticColor] = GLX_STATIC_COLOR, + [PseudoColor] = GLX_PSEUDO_COLOR, + [TrueColor] = GLX_TRUE_COLOR, + [DirectColor] = GLX_DIRECT_COLOR, }; if (visualType < ARRAY_SIZE(glx_visual_types)) @@ -402,8 +405,6 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count, #endif } - config->sRGBCapable = GL_FALSE; - /* ** Additional properties may be in a list at the end ** of the reply. They are in pairs of property type @@ -660,6 +661,8 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, */ m->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; #endif + /* Older X servers don't send this so we default it here. */ + m->sRGBCapable = GL_FALSE; __glXInitializeVisualConfigFromTags(m, nprops, props, tagged_only, GL_TRUE); m->screen = screen; diff --git a/lib/mesa/src/glx/glxextensions.c b/lib/mesa/src/glx/glxextensions.c index 6882e442f..e85a8c928 100644 --- a/lib/mesa/src/glx/glxextensions.c +++ b/lib/mesa/src/glx/glxextensions.c @@ -132,6 +132,7 @@ struct extension_info /* *INDENT-OFF* */ static const struct extension_info known_glx_extensions[] = { + { GLX(ARB_context_flush_control), VER(0,0), Y, N, N, N }, { GLX(ARB_create_context), VER(0,0), Y, N, N, N }, { GLX(ARB_create_context_profile), VER(0,0), Y, N, N, N }, { GLX(ARB_create_context_robustness), VER(0,0), Y, N, N, N }, @@ -151,7 +152,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N }, { GLX(INTEL_swap_event), VER(0,0), Y, N, N, N }, { GLX(MESA_copy_sub_buffer), VER(0,0), Y, N, N, N }, - { GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, Y, N }, + { GLX(MESA_multithread_makecurrent),VER(0,0), Y, N, N, Y }, { GLX(MESA_query_renderer), VER(0,0), Y, N, N, Y }, { GLX(MESA_swap_control), VER(0,0), Y, N, N, Y }, { GLX(NV_float_buffer), VER(0,0), N, N, N, N }, @@ -160,8 +161,6 @@ static const struct extension_info known_glx_extensions[] = { { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N }, { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N }, { GLX(SGIX_pbuffer), VER(1,3), Y, Y, N, N }, - { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, - { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, { GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N }, { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N }, { GLX(SGI_swap_control), VER(0,0), Y, N, N, N }, diff --git a/lib/mesa/src/glx/indirect_glx.c b/lib/mesa/src/glx/indirect_glx.c index 4302a8ff2..cfae12f6c 100644 --- a/lib/mesa/src/glx/indirect_glx.c +++ b/lib/mesa/src/glx/indirect_glx.c @@ -62,13 +62,13 @@ indirect_destroy_context(struct glx_context *gc) } static Bool -SendMakeCurrentRequest(Display * dpy, CARD8 opcode, - GLXContextID gc_id, GLXContextTag gc_tag, - GLXDrawable draw, GLXDrawable read, - GLXContextTag *out_tag) +SendMakeCurrentRequest(Display * dpy, GLXContextID gc_id, + GLXContextTag gc_tag, GLXDrawable draw, + GLXDrawable read, GLXContextTag *out_tag) { xGLXMakeCurrentReply reply; Bool ret; + int opcode = __glXSetupForCommand(dpy); LockDisplay(dpy); @@ -136,7 +136,6 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old, { GLXContextTag tag; Display *dpy = gc->psc->dpy; - int opcode = __glXSetupForCommand(dpy); Bool sent; if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy) { @@ -146,7 +145,7 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old, tag = 0; } - sent = SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, + sent = SendMakeCurrentRequest(dpy, gc->xid, tag, draw, read, &gc->currentContextTag); if (!IndirectAPI) @@ -160,7 +159,6 @@ static void indirect_unbind_context(struct glx_context *gc, struct glx_context *new) { Display *dpy = gc->psc->dpy; - int opcode = __glXSetupForCommand(dpy); if (gc == new) return; @@ -170,8 +168,8 @@ indirect_unbind_context(struct glx_context *gc, struct glx_context *new) * to send a request to the dpy to unbind the previous context. */ if (!new || new->isDirect || new->psc->dpy != dpy) { - SendMakeCurrentRequest(dpy, opcode, None, - gc->currentContextTag, None, None, NULL); + SendMakeCurrentRequest(dpy, None, gc->currentContextTag, None, None, + NULL); gc->currentContextTag = 0; } } diff --git a/lib/mesa/src/glx/meson.build b/lib/mesa/src/glx/meson.build new file mode 100644 index 000000000..a61f959e8 --- /dev/null +++ b/lib/mesa/src/glx/meson.build @@ -0,0 +1,172 @@ +# 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. + +inc_glx = include_directories('.') + +subdir('apple') +if with_dri_platform == 'windows' + subdir('windows') +endif + +files_libglx = files( + 'clientattrib.c', + 'clientinfo.c', + 'compsize.c', + 'create_context.c', + 'eval.c', + 'glxclient.h', + 'glxcmds.c', + 'glxconfig.c', + 'glxconfig.h', + 'glxcurrent.c', + 'glx_error.c', + 'glx_error.h', + 'glxext.c', + 'glxextensions.c', + 'glxextensions.h', + 'glxhash.c', + 'glxhash.h', + 'glx_pbuffer.c', + 'glx_query.c', + 'indirect_glx.c', + 'indirect_init.h', + 'indirect_texture_compression.c', + 'indirect_transpose_matrix.c', + 'indirect_vertex_array.c', + 'indirect_vertex_array.h', + 'indirect_vertex_array_priv.h', + 'indirect_vertex_program.c', + 'indirect_window_pos.c', + 'packrender.h', + 'packsingle.h', + 'pixel.c', + 'pixelstore.c', + 'query_renderer.c', + 'render2.c', + 'renderpix.c', + 'single2.c', + 'singlepix.c', + 'vertarr.c', +) + +extra_libs_libglx = [] +extra_deps_libgl = [] +extra_ld_args_libgl = [] + +if with_dri + files_libglx += files( + 'dri_common.c', + 'dri_common.h', + 'dri_common_query_renderer.c', + 'dri_common_interop.c', + 'xfont.c', + 'drisw_glx.c', + 'drisw_priv.h', + ) +endif + +# dri2 +if with_dri and with_dri_platform == 'drm' and dep_libdrm.found() + files_libglx += files( + 'dri2.c', + 'dri2_glx.c', + 'dri2.h', + 'dri2_priv.h', + 'dri_glx.c', + 'dri_sarea.h', + 'XF86dri.c', + 'xf86dri.h', + 'xf86dristr.h', + ) +endif + +if with_dri3 + files_libglx += files('dri3_glx.c', 'dri3_priv.h') +endif + +if with_dri_platform == 'apple' + files_libglx += files('applegl_glx.c') + extra_libs_libglx += libappleglx +elif with_dri_platform == 'windows' + files_libglx += files('driwindows_glx.c') + extra_libs_libglx += [ + libwindowsdri, + libwindowsglx, + ] + extra_deps_libgl = [ + meson.get_compiler('c').find_library('gdi32'), + meson.get_compiler('c').find_library('opengl32') + ] + extra_ld_args_libgl = '-Wl,--disable-stdcall-fixup' +endif + +if not with_glvnd + gl_lib_name = 'GL' + gl_lib_version = '1.2.0' +else + gl_lib_name = 'GLX_mesa' + gl_lib_version = '0.0.0' + files_libglx += files( + 'g_glxglvnddispatchfuncs.c', + 'g_glxglvnddispatchindices.h', + 'glxglvnd.c', + 'glxglvnd.h', + 'glxglvnddispatchfuncs.h', + ) +endif + +gl_lib_cargs = [ + '-D_REENTRANT', + '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path), +] + +libglx = static_library( + 'glx', + [files_libglx, glx_generated], + include_directories : [inc_common, inc_glapi, inc_loader, inc_gl_internal], + c_args : [ + c_vis_args, gl_lib_cargs, + '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]), + ], + link_with : [ + libloader, libloader_dri3_helper, libmesa_util, libxmlconfig, + extra_libs_libglx, + ], + dependencies : [dep_libdrm, dep_dri2proto, dep_glproto, dep_x11, dep_glvnd], +) + +libgl = shared_library( + gl_lib_name, + [], + link_with : [libglapi_static, libglapi], + link_whole : libglx, + link_args : [ld_args_bsymbolic, ld_args_gc_sections, extra_ld_args_libgl], + dependencies : [ + dep_libdrm, dep_dl, dep_m, dep_thread, dep_x11, dep_xcb_glx, dep_xcb, + dep_x11_xcb, dep_xcb_dri2, dep_xext, dep_xfixes, dep_xdamage, dep_xxf86vm, + extra_deps_libgl, + ], + version : gl_lib_version, + install : true, +) + +if with_tests + subdir('tests') +endif diff --git a/lib/mesa/src/glx/tests/fake_glx_screen.cpp b/lib/mesa/src/glx/tests/fake_glx_screen.cpp index 801f54a6f..ca0ca3680 100644 --- a/lib/mesa/src/glx/tests/fake_glx_screen.cpp +++ b/lib/mesa/src/glx/tests/fake_glx_screen.cpp @@ -75,6 +75,18 @@ indirect_create_context_attribs(struct glx_screen *base, return indirect_create_context(base, config_base, shareList, 0); } +#ifdef GLX_USE_APPLEGL +#warning Indirect GLX tests are not built +extern "C" struct glx_context * +applegl_create_context(struct glx_screen *base, + struct glx_config *config_base, + struct glx_context *shareList, + int renderType) +{ + return indirect_create_context(base, config_base, shareList, renderType); +} +#endif + /* This is necessary so that we don't have to link with glxcurrent.c * which would require us to link with X libraries and what not. */ diff --git a/lib/mesa/src/glx/tests/indirect_api.cpp b/lib/mesa/src/glx/tests/indirect_api.cpp index 34304a185..b9a4ca065 100644 --- a/lib/mesa/src/glx/tests/indirect_api.cpp +++ b/lib/mesa/src/glx/tests/indirect_api.cpp @@ -705,6 +705,8 @@ void __indirect_glFramebufferTextureLayer(void) { } } /*@}*/ +#ifndef GLX_USE_APPLEGL + class IndirectAPI : public ::testing::Test { public: virtual void SetUp(); @@ -1518,3 +1520,5 @@ TEST_F(IndirectAPI, EXT_texture_array) { EXPECT_EQ((_glapi_proc) __indirect_glFramebufferTextureLayer, table[_glapi_get_proc_offset("glFramebufferTextureLayerEXT")]); } + +#endif diff --git a/lib/mesa/src/glx/tests/meson.build b/lib/mesa/src/glx/tests/meson.build new file mode 100644 index 000000000..e59b42d19 --- /dev/null +++ b/lib/mesa/src/glx/tests/meson.build @@ -0,0 +1,54 @@ +# 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. + +if with_shared_glapi + files_glx_test = files( + 'clientinfo_unittest.cpp', + 'create_context_unittest.cpp', + 'enum_sizes.cpp', + 'fake_glx_screen.cpp', + 'fake_glx_screen.h', + 'indirect_api.cpp', + 'mock_xdisplay.h', + 'query_renderer_unittest.cpp', + ) + if with_dri2 + files_glx_test += files('query_renderer_implementation_unittest.cpp') + endif + + test( + 'dispatch-index-check', + files('dispatch-index-check'), + suite : ['glx'], + ) + test( + 'glx-test', + executable( + 'glx-test', + [files_glx_test, glx_indirect_size_h, main_dispatch_h], + link_with : [libglx, libglapi], + include_directories : [ + inc_src, inc_include, inc_mesa, inc_mapi, inc_gl_internal, + inc_glx, + ], + dependencies : [dep_libdrm, dep_glproto, dep_thread, idep_gtest] + ), + ) +endif diff --git a/lib/mesa/src/glx/windows/meson.build b/lib/mesa/src/glx/windows/meson.build new file mode 100644 index 000000000..153f41ab7 --- /dev/null +++ b/lib/mesa/src/glx/windows/meson.build @@ -0,0 +1,68 @@ +# Copyright © 2017 Jon Turney + +# 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. + +# protocol defines for the Windows-DRI server extension + +files_windowsdriproto = files( + 'windowsdriconst.h', + 'windowsdristr.h', + ) + +install_headers( + files_windowsdriproto, + subdir: 'X11/extensions', +) + +pkg.generate( + name : 'windowsdriproto', + description : 'Windows-DRI extension headers', + version : '1.0.0', +) + +# library for using the Windows-DRI server extension +files_libwindowsdri = files( + 'xwindowsdri.c', + 'xwindowsdri.h', +) + +libwindowsdri = static_library( + 'driwindows', + [files_libwindowsdri, files_windowsdriproto], + dependencies: dep_xext, + build_by_default: false, +) + +# library for native GL on windows +files_libwindowsglx = files( + 'windowsgl.c', + 'windowsgl.h', + 'windowsgl_internal.h', + 'windows_drawable.c', + 'wgl.c', + 'wgl.h', +) + +libwindowsglx = static_library( + 'glxwindows', + [files_libwindowsglx, files_windowsdriproto], + include_directories: [inc_include, inc_src, inc_glapi], + c_args : [c_vis_args], + build_by_default: false, +) |