Hello community, here is the log from the commit of package waffle for openSUSE:Factory checked in at 2020-04-04 12:24:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/waffle (Old) and /work/SRC/openSUSE:Factory/.waffle.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "waffle" Sat Apr 4 12:24:46 2020 rev:5 rq:791026 version:1.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/waffle/waffle.changes 2019-06-12 13:17:28.140617246 +0200 +++ /work/SRC/openSUSE:Factory/.waffle.new.3248/waffle.changes 2020-04-04 12:25:34.463941254 +0200 @@ -1,0 +2,12 @@ +Thu Apr 2 11:34:18 UTC 2020 - Stefan Dirsch <[email protected]> + +- bugfix release 1.6.1 + * wflinfo: Correctly install the bash completion file + * GLX/WGL: Handle ARB_create_context appropriatelly + * Wayland: Build fix for -fno-common, default with GCC10 + * Surfaceless: Implement window_resize +- added tests to cover above issues +- addressing the -fno-common build issue, required us to bump the + wayland-client requirement to v1.10 + +------------------------------------------------------------------- Old: ---- waffle-1.6.0.tar.xz waffle-1.6.0.tar.xz.asc New: ---- waffle-1.6.1.tar.xz waffle-1.6.1.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ waffle.spec ++++++ --- /var/tmp/diff_new_pack.jCL397/_old 2020-04-04 12:25:35.871942464 +0200 +++ /var/tmp/diff_new_pack.jCL397/_new 2020-04-04 12:25:35.875942468 +0200 @@ -1,7 +1,7 @@ # # spec file for package waffle # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,14 +20,14 @@ %define _minorVersion 0 %define libname lib%{name}-%{_majorVersion}-%{_minorVersion} Name: waffle -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: C library defering selection of GL API and window system until runtime License: BSD-2-Clause Group: Development/Libraries/X11 URL: http://people.freedesktop.org/~chadversary/waffle/index.html -Source0: http://www.waffle-gl.org/files/release/%{name}-%{version}/%{name}-%{version}.tar.xz -Source1: http://www.waffle-gl.org/files/release/%{name}-%{version}/%{name}-%{version}.tar.xz.asc +Source0: https://gitlab.freedesktop.org/mesa/waffle/-/raw/website/files/release/%{name}-%{version}/%{name}-%{version}.tar.xz +Source1: https://gitlab.freedesktop.org/mesa/waffle/-/raw/website/files/release/%{name}-%{version}/%{name}-%{version}.tar.xz.asc Source2: %{name}.keyring BuildRequires: cmake BuildRequires: gcc-c++ @@ -99,7 +99,7 @@ %{_docdir}/waffle-%{_majorVersion}/README.md %dir %{_docdir}/waffle-%{_majorVersion}/release-notes %{_docdir}/waffle-%{_majorVersion}/release-notes/*.txt -%{_docdir}/waffle-%{_majorVersion}/release-notes/waffle-1.6.0.md +%{_docdir}/waffle-%{_majorVersion}/release-notes/waffle-1.6.*.md %{_bindir}/wflinfo /usr/share/bash-completion/completions/wflinfo ++++++ waffle-1.6.0.tar.xz -> waffle-1.6.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/.gitignore new/waffle-1.6.1/.gitignore --- old/waffle-1.6.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/waffle-1.6.1/.gitignore 2020-03-31 13:47:39.000000000 +0200 @@ -0,0 +1,54 @@ +# ---------------------------------------------- +# CMake +# ---------------------------------------------- + +cmake_install.cmake +CMakeFiles + +/install_manifest.txt +/CMakeCache.txt +/CPackConfig.cmake +/CPackSourceConfig.cmake + +# ---------------------------------------------- +# Ninja +# ---------------------------------------------- + +/.ninja_deps +/.ninja_log +/build.ninja +/rules.ninja + +# ---------------------------------------------- +# Make +# ---------------------------------------------- + +Makefile + +# ---------------------------------------------- +# Build Artifacts +# ---------------------------------------------- + +*.a +*.so + +/bin/gl_basic +/bin/gl_basic_test +/bin/simple-x11-egl +/bin/wflinfo +/doc/html/man/*.1.html +/doc/html/man/*.3.html +/doc/html/man/*.7.html +/examples/gl_basic +/examples/simple-x11-egl +/html/ +/lib/ +/libcmocka.a +/src/waffle/libwaffle_static.a +/tests/functional/gl_basic_test +/tests/unittests/waffle-unittest +/tests/wcore_attrib_list_unittest +/tests/wcore_config_attrs_unittest +/tests/wcore_error_unittest +/third_party/cmocka/config.h +/waffle-1.pc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/.gitlab-ci/build-meson.sh new/waffle-1.6.1/.gitlab-ci/build-meson.sh --- old/waffle-1.6.0/.gitlab-ci/build-meson.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/waffle-1.6.1/.gitlab-ci/build-meson.sh 2020-03-31 13:47:39.000000000 +0200 @@ -0,0 +1,43 @@ +#!/bin/bash +set -eu + +case $1 in + x11) + platform_option=(-Dglx=enabled -Dx11_egl=enabled) + test_wrapper=(xvfb-run -a -w10) + ;; + wayland) + platform_option=(-Dwayland=enabled) + #TODO: find something like xvfb + test_wrapper=(:) + ;; + gbm) + platform_option=(-Dgbm=enabled) + test_wrapper=(:) + ;; + surfaceless) + platform_option=(-Dsurfaceless_egl=enabled) + test_wrapper=(:) + ;; +esac + +rm -rf _build + +set -x + +meson _build \ + --wrap-mode nofallback \ + --prefix "$PWD"/install \ + --buildtype debug \ + --auto-features disabled \ + -D build-tests=true \ + -D build-manpages=true \ + -D build-htmldocs=true \ + -D build-examples=true \ + "${platform_option[@]}" + +ninja -C _build -j4 + +"${test_wrapper[@]}" ninja -C _build test + +ninja -C _build install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/.gitlab-ci.yml new/waffle-1.6.1/.gitlab-ci.yml --- old/waffle-1.6.0/.gitlab-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/waffle-1.6.1/.gitlab-ci.yml 2020-03-31 13:47:39.000000000 +0200 @@ -0,0 +1,106 @@ +variables: + UPSTREAM_REPO: mesa/waffle + +include: + - project: 'wayland/ci-templates' + ref: f69acac60d5dde0410124fd5674764600821b7a6 + file: '/templates/debian.yml' + +stages: + - container + - build + + +# When to automatically run the CI +.ci-run-policy: + retry: + max: 2 + when: + - runner_system_failure + # Cancel CI run if a newer commit is pushed to the same branch + interruptible: true + + +# Debian 10 based x86 build image +x86_build: + stage: container + extends: + - .debian@container-ifnot-exists + - .ci-run-policy + variables: + DEBIAN_VERSION: buster-slim + REPO_SUFFIX: $CI_JOB_NAME + # no need to pull the whole repo to build the container image + GIT_STRATEGY: none + DEBIAN_TAG: &x86_build "2019-11-22" + DEBIAN_DEBS: >- + bash-completion + ca-certificates + cmake + docbook-xsl + docbook-xml + g++ + gcc + libcmocka-dev + libegl1-mesa-dev + libgbm-dev + libgl1-mesa-dev + libudev-dev + libwayland-dev + libx11-dev + libxcb1-dev + meson + pkg-config + xauth + xsltproc + xvfb +.use-x86_build: + variables: + TAG: *x86_build + image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG" + needs: + - x86_build + + +# BUILD + +.build: + extends: .ci-run-policy + stage: build + variables: + GIT_DEPTH: 100 + +meson: + extends: + - .build + - .use-x86_build + script: + - bash .gitlab-ci/build-meson.sh x11 + - bash .gitlab-ci/build-meson.sh wayland + - bash .gitlab-ci/build-meson.sh gbm + - bash .gitlab-ci/build-meson.sh surfaceless + artifacts: + when: on_failure + paths: + - _build/meson-logs/*.txt + +cmake: + extends: + - .build + - .use-x86_build + script: + - cmake + -G Ninja + -S . -B _build + -DCMAKE_INSTALL_PREFIX=`pwd`/install + -DCMAKE_BUILD_TYPE=Debug + -Dwaffle_has_gbm=1 + -Dwaffle_has_glx=1 + -Dwaffle_has_x11_egl=1 + -Dwaffle_has_wayland=1 + -Dwaffle_build_manpages=1 + -Dwaffle_build_htmldocs=1 + -Dwaffle_build_examples=1 + - ninja -C _build -j4 + - ninja -C _build check + - ninja -C _build install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/Android.mk new/waffle-1.6.1/Android.mk --- old/waffle-1.6.0/Android.mk 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/Android.mk 2020-03-31 13:47:39.000000000 +0200 @@ -8,7 +8,7 @@ # waffle_major_version := 1 waffle_minor_version := 6 -waffle_patch_version := 0 +waffle_patch_version := 1 waffle_api_version := 0x0106 waffle_android_major_version := $(word 1, $(subst ., , $(PLATFORM_VERSION))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/CMakeLists.txt new/waffle-1.6.1/CMakeLists.txt --- old/waffle-1.6.0/CMakeLists.txt 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/CMakeLists.txt 2020-03-31 13:47:39.000000000 +0200 @@ -195,7 +195,7 @@ install( FILES "shell-completion/bash/wflinfo" - DESTINATION "${BASH_COMPLETION_COMPLETIONSDIR}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}" COMPONENT shell-completion ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/cmake/Modules/WaffleDefineCompilerFlags.cmake new/waffle-1.6.1/cmake/Modules/WaffleDefineCompilerFlags.cmake --- old/waffle-1.6.0/cmake/Modules/WaffleDefineCompilerFlags.cmake 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/cmake/Modules/WaffleDefineCompilerFlags.cmake 2020-03-31 13:47:39.000000000 +0200 @@ -60,7 +60,9 @@ endif() if(egl_FOUND) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${egl_CFLAGS_OTHER}") + foreach(FLAG ${egl_CFLAGS_OTHER}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}") + endforeach() endif(egl_FOUND) if(MINGW) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/cmake/Modules/WaffleDefineVersion.cmake new/waffle-1.6.1/cmake/Modules/WaffleDefineVersion.cmake --- old/waffle-1.6.0/cmake/Modules/WaffleDefineVersion.cmake 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/cmake/Modules/WaffleDefineVersion.cmake 2020-03-31 13:47:39.000000000 +0200 @@ -40,7 +40,7 @@ # set(waffle_major_version "1") set(waffle_minor_version "6") -set(waffle_patch_version "0") +set(waffle_patch_version "1") set(waffle_version "${waffle_major_version}.${waffle_minor_version}.${waffle_patch_version}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/cmake/Modules/WaffleFindDependencies.cmake new/waffle-1.6.1/cmake/Modules/WaffleFindDependencies.cmake --- old/waffle-1.6.0/cmake/Modules/WaffleFindDependencies.cmake 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/cmake/Modules/WaffleFindDependencies.cmake 2020-03-31 13:47:39.000000000 +0200 @@ -70,7 +70,7 @@ waffle_pkg_config(gl gl) # waffle_has_wayland - waffle_pkg_config(wayland-client wayland-client>=1) + waffle_pkg_config(wayland-client wayland-client>=1.10) waffle_pkg_config(wayland-egl wayland-egl>=9.1) # waffle_has_x11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/cmake/Modules/WaffleValidateOptions.cmake new/waffle-1.6.1/cmake/Modules/WaffleValidateOptions.cmake --- old/waffle-1.6.0/cmake/Modules/WaffleValidateOptions.cmake 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/cmake/Modules/WaffleValidateOptions.cmake 2020-03-31 13:47:39.000000000 +0200 @@ -119,7 +119,7 @@ if(waffle_has_wayland) if(NOT wayland-client_FOUND) set(wayland_missing_deps - "${wayland_missing_deps} wayland-client>=1" + "${wayland_missing_deps} wayland-client>=1.10" ) endif() if(NOT wayland-egl_FOUND) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/doc/release-notes/waffle-1.6.1.md new/waffle-1.6.1/doc/release-notes/waffle-1.6.1.md --- old/waffle-1.6.0/doc/release-notes/waffle-1.6.1.md 1970-01-01 01:00:00.000000000 +0100 +++ new/waffle-1.6.1/doc/release-notes/waffle-1.6.1.md 2020-03-31 13:47:39.000000000 +0200 @@ -0,0 +1,56 @@ +# Waffle 1.6.1 Release Notes + +## Fixes since 1.6.0 + +* wflinfo: Install bash completion file correctly + +* GLX/WGL: Correctly handle ARB_create_context + +* Wayland: Require wayland-client v1.10 +* Wayland: Resolve build issues with -fno-common, default with GCC10 + +* Tests: Add new tests - context API, profile, robustness, debug + +* GitLab-CI: Introduction and small fixes + + +## Features since 1.6.0 + +All new features introduced in minor releases are *minor* and introduce no +instability. + +* surfaceless_egl: Implement resize functionality + Add support for the waffle_window_resize() function when using the EGL + surfaceless platform. This is achieved by recreating the backing pbuffer + with the new size, and rebinding it to the current context. + + +## Changes since 1.6.0 + +Adrian Negreanu (1): + WaffleDefineCompilerFlags: FindPkgConfig variables are lists + +Alexandros Frantzis (1): + surfaceless_egl: Implement resize functionality + +Emil Velikov (10): + gitlab-ci: bump xvfb wait time + glx: correctly handle ARB_create_context lack/presence + wgl: correctly handle ARB_create_context lack/presence + func: add context API tests + func: add profile tests + func: actually check the GL* version created + func: add robust tests + func: add more debug tests + wayland: bump required version to 1.10 + wayland: rework extern symbols handling + +Eric Engestrom (2): + gl_basic_test: avoid reading uninitialised platform + gitlab-ci: introduce pre-merge CI + +Kenneth Graunke (1): + CMake: Install bash completions into prefix + +Rafael Antognolli (1): + meson: Redefine 'datadir' instead of 'prefix'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/meson.build new/waffle-1.6.1/meson.build --- old/waffle-1.6.0/meson.build 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/meson.build 2020-03-31 13:47:39.000000000 +0200 @@ -27,7 +27,7 @@ project( 'waffle', ['c'], - version : '1.6.0', + version : '1.6.1', license : 'BSD2', meson_version : '>= 0.49', default_options : ['c_std=c99', 'buildtype=debugoptimized'], @@ -88,7 +88,7 @@ dep_gl = dependency('gl', required : get_option('glx')) dep_egl = dependency('egl', required : get_option('x11_egl')) dep_wayland_client = dependency( - 'wayland-client', version : '>= 1.0', required : get_option('wayland'), + 'wayland-client', version : '>= 1.10', required : get_option('wayland'), ) dep_wayland_egl = dependency( 'wayland-egl', version : '>= 9.1', required : get_option('wayland'), @@ -113,7 +113,7 @@ 'shell-completion/bash/wflinfo', install_dir : dep_bash.get_pkgconfig_variable( 'completionsdir', - define_variable : ['prefix', get_option('prefix')]), + define_variable : ['datadir', get_option('datadir')]), ) endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/glx/glx_config.c new/waffle-1.6.1/src/waffle/glx/glx_config.c --- old/waffle-1.6.0/src/waffle/glx/glx_config.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/glx/glx_config.c 2020-03-31 13:47:39.000000000 +0200 @@ -60,30 +60,44 @@ assert(wcore_config_attrs_version_ge(attrs, 30)); } - if (attrs->context_debug && !dpy->ARB_create_context) { + if (!dpy->ARB_create_context && + glx_context_needs_arb_create_context(attrs)) { + const char *gl = ""; + const char *fwd_compat = ""; + const char *debug = ""; + const char *robust = ""; + + // XXX: Keep in sync with glx_context_needs_arb_create_context() + if (attrs->context_api != WAFFLE_CONTEXT_OPENGL) + gl = " - a OpenGL ES* context\n"; + else if (wcore_config_attrs_version_ge(attrs, 32)) + gl = " - a OpenGL 3.2+ context\n"; + + if (attrs->context_forward_compatible) + fwd_compat = " - a forward-compatible context\n"; + + if (attrs->context_debug) + debug = " - a debug context\n"; + + if (attrs->context_robust) + robust = " - a robust access context\n"; + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "GLX_ARB_create_context is required in order to " - "request a debug context"); + "GLX_ARB_create_context is required to create:\n" + "%s%s%s%s", gl, fwd_compat, debug, robust); return false; } if (attrs->context_robust && !dpy->ARB_create_context_robustness) { wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "GLX_ARB_create_context_robustness is required in order to " + "GLX_ARB_create_context_robustness is required to " "request a robust access context"); return false; } switch (attrs->context_api) { case WAFFLE_CONTEXT_OPENGL: - if (glx_context_needs_arb_create_context(attrs) && - !dpy->ARB_create_context) { - wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "GLX_ARB_create_context is required in order to " - "request an OpenGL version greater or equal than 3.2"); - return false; - } - else if (wcore_config_attrs_version_ge(attrs, 32) && !dpy->ARB_create_context_profile) { + if (wcore_config_attrs_version_ge(attrs, 32) && !dpy->ARB_create_context_profile) { wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, "GLX_ARB_create_context_profile is required " "to create a context with version >= 3.2"); @@ -94,13 +108,6 @@ attrs->context_profile == WAFFLE_CONTEXT_COMPATIBILITY_PROFILE); } - if (attrs->context_forward_compatible && !dpy->ARB_create_context) { - wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "GLX_ARB_create_context is required in order to " - "request a forward-compatible context"); - return false; - } - return true; case WAFFLE_CONTEXT_OPENGL_ES1: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/glx/glx_context.c new/waffle-1.6.1/src/waffle/glx/glx_context.c --- old/waffle-1.6.0/src/waffle/glx/glx_context.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/glx/glx_context.c 2020-03-31 13:47:39.000000000 +0200 @@ -170,20 +170,15 @@ { GLXContext ctx; GLXContext real_share_ctx = share_ctx ? share_ctx->glx : NULL; + const struct wcore_config_attrs *attrs = &config->wcore.attrs; struct glx_display *dpy = glx_display(config->wcore.display); struct glx_platform *platform = glx_platform(dpy->wcore.platform); - // Use ARB_create_context when we have - // - OpenGL version 1.0, or - // - OpenGL version 3.2 or greater, or - // - OpenGL with fwd_compat, or - // - Debug context - // - // The first one of the four is optional, the remainder hard requirement - // for the use of ARB_create_context. + // Optionally use ARB_create_context for OpenGL 1.0, if available. if (dpy->ARB_create_context && - (wcore_config_attrs_version_eq(&config->wcore.attrs, 10) || - glx_context_needs_arb_create_context(&config->wcore.attrs))) { + (glx_context_needs_arb_create_context(attrs) || + (attrs->context_api == WAFFLE_CONTEXT_OPENGL && + wcore_config_attrs_version_eq(attrs, 10)))) { bool ok; // Choose a large size to prevent accidental overflow. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/glx/glx_context.h new/waffle-1.6.1/src/waffle/glx/glx_context.h --- old/waffle-1.6.0/src/waffle/glx/glx_context.h 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/glx/glx_context.h 2020-03-31 13:47:39.000000000 +0200 @@ -58,16 +58,30 @@ glx_context_get_native(struct wcore_context *wc_self); +// XXX: Keep in sync with glx_config_check_context_attrs() static inline bool glx_context_needs_arb_create_context(const struct wcore_config_attrs *attrs) { - if (attrs->context_api == WAFFLE_CONTEXT_OPENGL && - (wcore_config_attrs_version_ge(attrs, 32) || - attrs->context_forward_compatible)) + // Any of the following require the ARB extension, since the data is + // passed as attributes. + + // Using any GLES* profile, + if (attrs->context_api != WAFFLE_CONTEXT_OPENGL) + return true; + + // explicitly requesting OpenGL version (>=3.2), + if (wcore_config_attrs_version_ge(attrs, 32)) + return true; + + // ... or any of the context flags. + if (attrs->context_forward_compatible) return true; if (attrs->context_debug) return true; + if (attrs->context_robust) + return true; + return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_platform.c new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_platform.c --- old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_platform.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_platform.c 2020-03-31 13:47:39.000000000 +0200 @@ -138,6 +138,7 @@ .create = sl_window_create, .destroy = sl_window_destroy, .show = sl_window_show, + .resize = sl_window_resize, .swap_buffers = wegl_surface_swap_buffers, .get_native = NULL, // unsupported by platform }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_window.c new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_window.c --- old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_window.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_window.c 2020-03-31 13:47:39.000000000 +0200 @@ -28,8 +28,10 @@ #include "wcore_attrib_list.h" #include "wcore_error.h" +#include "wcore_tinfo.h" #include "wegl_config.h" +#include "wegl_util.h" #include "sl_display.h" #include "sl_platform.h" @@ -78,6 +80,8 @@ if (!ok) goto error; + self->wc_config = wc_config; + return &self->wegl.wcore; error: @@ -90,3 +94,37 @@ { return true; } + +bool +sl_window_resize(struct wcore_window *wc_self, + int32_t width, int32_t height) +{ + struct wcore_display *wc_dpy = wc_self->display; + struct wcore_platform *wc_plat = wc_self->display->platform; + struct sl_window *self = sl_window(wegl_surface(wc_self)); + struct wegl_surface new_wegl; + struct wcore_context *wc_ctx; + struct wcore_tinfo *tinfo; + bool ok = true; + + // Create a new pbuffer for the resized window. + ok = wegl_pbuffer_init(&new_wegl, self->wc_config, width, height); + if (!ok) + return false; + + tinfo = wcore_tinfo_get(); + wc_ctx = tinfo->current_context; + + ok = wegl_make_current(wc_plat, wc_dpy, &new_wegl.wcore, wc_ctx); + if (!ok) + goto error; + + // Everything went fine, so teardown the old pbuffer, and set the new one. + wegl_surface_teardown(&self->wegl); + self->wegl = new_wegl; + return true; + +error: + wegl_surface_teardown(&new_wegl); + return false; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_window.h new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_window.h --- old/waffle-1.6.0/src/waffle/surfaceless_egl/sl_window.h 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/surfaceless_egl/sl_window.h 2020-03-31 13:47:39.000000000 +0200 @@ -33,6 +33,7 @@ struct sl_window { struct wegl_surface wegl; + struct wcore_config *wc_config; }; DEFINE_CONTAINER_CAST_FUNC(sl_window, @@ -51,3 +52,7 @@ bool sl_window_show(struct wcore_window *wc_self); + +bool +sl_window_resize(struct wcore_window *wc_self, + int32_t width, int32_t height); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wayland/wayland_display.c new/waffle-1.6.1/src/waffle/wayland/wayland_display.c --- old/waffle-1.6.0/src/waffle/wayland/wayland_display.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wayland/wayland_display.c 2020-03-31 13:47:39.000000000 +0200 @@ -30,7 +30,6 @@ // The wrapper must be included before wayland-client.h #include "wayland_wrapper.h" -#include <wayland-client.h> #undef container_of #include "wcore_error.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wayland/wayland_sym.h new/waffle-1.6.1/src/waffle/wayland/wayland_sym.h --- old/waffle-1.6.0/src/waffle/wayland/wayland_sym.h 1970-01-01 01:00:00.000000000 +0100 +++ new/waffle-1.6.1/src/waffle/wayland/wayland_sym.h 2020-03-31 13:47:39.000000000 +0200 @@ -0,0 +1,28 @@ +WAFFLE_WAYLAND_INTERFACE(wl_compositor_interface) +WAFFLE_WAYLAND_INTERFACE(wl_registry_interface) +WAFFLE_WAYLAND_INTERFACE(wl_shell_interface) +WAFFLE_WAYLAND_INTERFACE(wl_shell_surface_interface) +WAFFLE_WAYLAND_INTERFACE(wl_surface_interface) + + +WAFFLE_WAYLAND_SYM(struct wl_display *, wl_display_connect, (const char *name)) +WAFFLE_WAYLAND_SYM(void, wl_display_disconnect, (struct wl_display *display)) + +WAFFLE_WAYLAND_SYM(int, wl_display_roundtrip, (struct wl_display *display)) + +WAFFLE_WAYLAND_SYM(void, wl_proxy_destroy, (struct wl_proxy *proxy)) + +WAFFLE_WAYLAND_SYM(int, wl_proxy_add_listener, (struct wl_proxy *proxy, + void (**implementation)(void), + void *data)) + +WAFFLE_WAYLAND_SYM(void, wl_proxy_marshal, (struct wl_proxy *p, + uint32_t opcode, ...)) + +WAFFLE_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor, + (struct wl_proxy *proxy, uint32_t opcode, + const struct wl_interface *interface, ...)) + +WAFFLE_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned, + (struct wl_proxy *proxy, uint32_t opcode, + const struct wl_interface *interface, uint32_t version, ...)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wayland/wayland_wrapper.c new/waffle-1.6.1/src/waffle/wayland/wayland_wrapper.c --- old/waffle-1.6.0/src/waffle/wayland/wayland_wrapper.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wayland/wayland_wrapper.c 2020-03-31 13:47:39.000000000 +0200 @@ -50,6 +50,14 @@ static const char *libwl_client_filename = "libwayland-client.so.0"; +#define WAFFLE_WAYLAND_INTERFACE(iface) \ + const struct wl_interface *wfl_##iface = NULL; +#define WAFFLE_WAYLAND_SYM(rc, fn, params) \ + pfn_##fn wfl_##fn = NULL; +#include "wayland_sym.h" +#undef WAFFLE_WAYLAND_SYM +#undef WAFFLE_WAYLAND_INTERFACE + bool wayland_wrapper_teardown(void) { @@ -69,52 +77,38 @@ return ok; } +// On failure the caller of wayland_wrapper_init will trigger it's own +// destruction which will execute wayland_wrapper_teardown. bool wayland_wrapper_init(void) { - bool ok = true; - dl_wl_client = dlopen(libwl_client_filename, RTLD_LAZY | RTLD_LOCAL); if (!dl_wl_client) { wcore_errorf(WAFFLE_ERROR_FATAL, "dlopen(\"%s\") failed: %s", libwl_client_filename, dlerror()); - ok = false; - goto error; + return false; } -#define RETRIEVE_WL_CLIENT_SYMBOL(S) \ - wfl_##S = (__typeof__(wfl_##S))dlsym(dl_wl_client, #S); \ - if (!wfl_##S) { \ +#define WAFFLE_WAYLAND_INTERFACE(iface) \ + wfl_##iface = (struct wl_interface *)dlsym(dl_wl_client, #iface); \ + if (!wfl_##iface) { \ + wcore_errorf(WAFFLE_ERROR_FATAL, \ + "dlsym(\"%s\", \"" #iface "\") failed: %s", \ + libwl_client_filename, dlerror()); \ + return false; \ + } +#define WAFFLE_WAYLAND_SYM(rc, fn, params) \ + wfl_##fn = (pfn_##fn)dlsym(dl_wl_client, #fn); \ + if (!wfl_##fn) { \ wcore_errorf(WAFFLE_ERROR_FATAL, \ - "dlsym(\"%s\", \"" #S "\") failed: %s", \ + "dlsym(\"%s\", \"" #fn "\") failed: %s", \ libwl_client_filename, dlerror()); \ - ok = false; \ - goto error; \ + return false; \ } +#include "wayland_sym.h" +#undef WAFFLE_WAYLAND_SYM +#undef WAFFLE_WAYLAND_INTERFACE - RETRIEVE_WL_CLIENT_SYMBOL(wl_compositor_interface); - RETRIEVE_WL_CLIENT_SYMBOL(wl_registry_interface); - RETRIEVE_WL_CLIENT_SYMBOL(wl_shell_interface); - RETRIEVE_WL_CLIENT_SYMBOL(wl_shell_surface_interface); - RETRIEVE_WL_CLIENT_SYMBOL(wl_surface_interface); - - RETRIEVE_WL_CLIENT_SYMBOL(wl_display_connect); - RETRIEVE_WL_CLIENT_SYMBOL(wl_display_disconnect); - RETRIEVE_WL_CLIENT_SYMBOL(wl_display_roundtrip); - RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_destroy); - RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_add_listener); - RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_marshal); - RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_marshal_constructor); -#if WAYLAND_VERSION_MAJOR == 1 && \ - (WAYLAND_VERSION_MINOR > 9 || \ - (WAYLAND_VERSION_MINOR == 9 && WAYLAND_VERSION_MICRO >= 91)) - RETRIEVE_WL_CLIENT_SYMBOL(wl_proxy_marshal_constructor_versioned); -#endif -#undef RETRIEVE_WL_CLIENT_SYMBOL - -error: - // On failure the caller of wayland_wrapper_init will trigger it's own - // destruction which will execute wayland_wrapper_teardown. - return ok; + return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wayland/wayland_wrapper.h new/waffle-1.6.1/src/waffle/wayland/wayland_wrapper.h --- old/waffle-1.6.0/src/waffle/wayland/wayland_wrapper.h 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wayland/wayland_wrapper.h 2020-03-31 13:47:39.000000000 +0200 @@ -27,7 +27,6 @@ #include <stdbool.h> -#include "wayland-version.h" #include "wayland-util.h" bool @@ -37,57 +36,29 @@ wayland_wrapper_teardown(void); -// Data symbols -const struct wl_interface *wfl_wl_compositor_interface; -const struct wl_interface *wfl_wl_registry_interface; -const struct wl_interface *wfl_wl_shell_interface; -const struct wl_interface *wfl_wl_shell_surface_interface; -const struct wl_interface *wfl_wl_surface_interface; - - // Forward declaration of the structs required by the functions struct wl_proxy; struct wl_display; -// Functions -struct wl_display * -(*wfl_wl_display_connect)(const char *name); - -void -(*wfl_wl_display_disconnect)(struct wl_display *display); - -int -(*wfl_wl_display_roundtrip)(struct wl_display *display); - +// Data symbols +#define WAFFLE_WAYLAND_INTERFACE(iface) \ + extern const struct wl_interface *wfl_##iface; -void -(*wfl_wl_proxy_destroy)(struct wl_proxy *proxy); - -int -(*wfl_wl_proxy_add_listener)(struct wl_proxy *proxy, - void (**implementation)(void), void *data); - -void -(*wfl_wl_proxy_marshal)(struct wl_proxy *p, uint32_t opcode, ...); - -struct wl_proxy * -(*wfl_wl_proxy_marshal_constructor)(struct wl_proxy *proxy, - uint32_t opcode, - const struct wl_interface *interface, - ...); - -struct wl_proxy * -(*wfl_wl_proxy_marshal_constructor_versioned)(struct wl_proxy *proxy, - uint32_t opcode, - const struct wl_interface *interface, - uint32_t version, - ...); +// Functions +#define WAFFLE_WAYLAND_SYM(rc, fn, params) \ + typedef rc (*pfn_##fn) params; \ + extern pfn_##fn wfl_##fn; +#include "wayland_sym.h" +#undef WAFFLE_WAYLAND_SYM +#undef WAFFLE_WAYLAND_INTERFACE #ifdef _WAYLAND_CLIENT_H #error Do not include wayland-client.h ahead of wayland_wrapper.h #endif +#include <wayland-client-core.h> + #define wl_compositor_interface (*wfl_wl_compositor_interface) #define wl_registry_interface (*wfl_wl_registry_interface) #define wl_shell_interface (*wfl_wl_shell_interface) @@ -102,3 +73,5 @@ #define wl_proxy_marshal (*wfl_wl_proxy_marshal) #define wl_proxy_marshal_constructor (*wfl_wl_proxy_marshal_constructor) #define wl_proxy_marshal_constructor_versioned (*wfl_wl_proxy_marshal_constructor_versioned) + +#include <wayland-client-protocol.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wgl/wgl_config.c new/waffle-1.6.1/src/waffle/wgl/wgl_config.c --- old/waffle-1.6.0/src/waffle/wgl/wgl_config.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wgl/wgl_config.c 2020-03-31 13:47:39.000000000 +0200 @@ -65,10 +65,31 @@ assert(wcore_config_attrs_version_ge(attrs, 30)); } - if (attrs->context_debug && !dpy->ARB_create_context) { + if (!dpy->ARB_create_context && + wgl_context_needs_arb_create_context(attrs)) { + const char *gl = ""; + const char *fwd_compat = ""; + const char *debug = ""; + const char *robust = ""; + + // XXX: Keep in sync with glx_context_needs_arb_create_context() + if (attrs->context_api != WAFFLE_CONTEXT_OPENGL) + gl = " - a OpenGL ES* context\n"; + else if (wcore_config_attrs_version_ge(attrs, 32)) + gl = " - a OpenGL 3.2+ context\n"; + + if (attrs->context_forward_compatible) + fwd_compat = " - a forward-compatible context\n"; + + if (attrs->context_debug) + debug = " - a debug context\n"; + + if (attrs->context_robust) + robust = " - a robust access context\n"; + wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "WGL_ARB_create_context is required in order to " - "request a debug context"); + "WGL_ARB_create_context is required to create:\n" + "%s%s%s%s", gl, fwd_compat, debug, robust); return false; } @@ -81,14 +102,7 @@ switch (attrs->context_api) { case WAFFLE_CONTEXT_OPENGL: - if (wgl_context_needs_arb_create_context(attrs) && - !dpy->ARB_create_context) { - wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "WGL_ARB_create_context is required in order to " - "request an OpenGL version greater or equal than 3.2"); - return false; - } - else if (wcore_config_attrs_version_ge(attrs, 32) && !dpy->ARB_create_context_profile) { + if (wcore_config_attrs_version_ge(attrs, 32) && !dpy->ARB_create_context_profile) { wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, "WGL_ARB_create_context_profile is required " "to create a context with version >= 3.2"); @@ -99,13 +113,6 @@ attrs->context_profile == WAFFLE_CONTEXT_COMPATIBILITY_PROFILE); } - if (attrs->context_forward_compatible && !dpy->ARB_create_context) { - wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, - "WGL_ARB_create_context is required in order to " - "request a forward-compatible context"); - return false; - } - return true; case WAFFLE_CONTEXT_OPENGL_ES1: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wgl/wgl_context.c new/waffle-1.6.1/src/waffle/wgl/wgl_context.c --- old/waffle-1.6.0/src/waffle/wgl/wgl_context.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wgl/wgl_context.c 2020-03-31 13:47:39.000000000 +0200 @@ -153,20 +153,15 @@ struct wgl_context *share_ctx) { struct wgl_display *dpy = wgl_display(config->wcore.display); + const struct wcore_config_attrs *attrs = &config->wcore.attrs; HGLRC real_share_ctx = share_ctx ? share_ctx->hglrc : NULL; HGLRC hglrc; - // Use ARB_create_context when we have - // - OpenGL version 1.0, or - // - OpenGL version 3.2 or greater, or - // - OpenGL with fwd_compat, or - // - Debug context - // - // The first one of the four is optional, the remainder hard requirement - // for the use of ARB_create_context. + // Optionally use ARB_create_context for OpenGL 1.0, if available. if (dpy->ARB_create_context && - (wcore_config_attrs_version_eq(&config->wcore.attrs, 10) || - wgl_context_needs_arb_create_context(&config->wcore.attrs))) { + (wgl_context_needs_arb_create_context(attrs) || + (attrs->context_api == WAFFLE_CONTEXT_OPENGL && + wcore_config_attrs_version_eq(attrs, 10)))) { bool ok; // Choose a large size to prevent accidental overflow. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/src/waffle/wgl/wgl_context.h new/waffle-1.6.1/src/waffle/wgl/wgl_context.h --- old/waffle-1.6.0/src/waffle/wgl/wgl_context.h 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/src/waffle/wgl/wgl_context.h 2020-03-31 13:47:39.000000000 +0200 @@ -53,16 +53,30 @@ bool wgl_context_destroy(struct wcore_context *wc_self); +// XXX: Keep in sync with wgl_config_check_context_attrs() static inline bool wgl_context_needs_arb_create_context(const struct wcore_config_attrs *attrs) { - if (attrs->context_api == WAFFLE_CONTEXT_OPENGL && - (wcore_config_attrs_version_ge(attrs, 32) || - attrs->context_forward_compatible)) + // Any of the following require the ARB extension, since the data is + // passed as attributes. + + // Using any GLES* profile, + if (attrs->context_api != WAFFLE_CONTEXT_OPENGL) + return true; + + // explicitly requesting OpenGL version (>=3.2), + if (wcore_config_attrs_version_ge(attrs, 32)) + return true; + + // ... or any of the context flags. + if (attrs->context_forward_compatible) return true; if (attrs->context_debug) return true; + if (attrs->context_robust) + return true; + return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/waffle-1.6.0/tests/functional/gl_basic_test.c new/waffle-1.6.1/tests/functional/gl_basic_test.c --- old/waffle-1.6.0/tests/functional/gl_basic_test.c 2019-06-07 01:26:28.000000000 +0200 +++ new/waffle-1.6.1/tests/functional/gl_basic_test.c 2020-03-31 13:47:39.000000000 +0200 @@ -104,6 +104,7 @@ typedef double GLdouble; /* double precision float */ typedef double GLclampd; /* double precision float in [0,1] */ +#define GL_NO_ERROR 0x0000 #define GL_VERSION 0x1F02 #define GL_UNSIGNED_BYTE 0x1401 #define GL_UNSIGNED_INT 0x1405 @@ -112,6 +113,7 @@ #define GL_RGBA 0x1908 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_CONTEXT_FLAGS 0x821e +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 @@ -260,6 +262,7 @@ .profile = WAFFLE_DONT_CARE, \ .forward_compatible = false, \ .debug = false, \ + .robust = false, \ .alpha = false, \ .expect_error = WAFFLE_NO_ERROR, \ __VA_ARGS__ \ @@ -272,6 +275,7 @@ int32_t expect_error; bool forward_compatible; bool debug; + bool robust; bool alpha; }; @@ -285,6 +289,7 @@ int32_t expect_error = args.expect_error; bool context_forward_compatible = args.forward_compatible; bool context_debug = args.debug; + bool context_robust = args.robust; bool alpha = args.alpha; int32_t config_attrib_list[64]; @@ -317,6 +322,10 @@ config_attrib_list[i++] = WAFFLE_CONTEXT_DEBUG; config_attrib_list[i++] = true; } + if (context_robust) { + config_attrib_list[i++] = WAFFLE_CONTEXT_ROBUST_ACCESS; + config_attrib_list[i++] = true; + } config_attrib_list[i++] = WAFFLE_RED_SIZE; config_attrib_list[i++] = 8; config_attrib_list[i++] = WAFFLE_GREEN_SIZE; @@ -379,20 +388,69 @@ assert_true(waffle_get_current_window() == ts->window); assert_true(waffle_get_current_context() == ts->ctx); - const char *version_str; + const char *version_str, *expected_version_str; int major, minor, count; ASSERT_GL(version_str = (const char *) glGetString(GL_VERSION)); assert_true(version_str != NULL); - while (*version_str != '\0' && !isdigit(*version_str)) - version_str++; + switch (waffle_context_api) { + case WAFFLE_CONTEXT_OPENGL: + expected_version_str = ""; + break; + case WAFFLE_CONTEXT_OPENGL_ES1: + expected_version_str = "OpenGL ES-CM "; + break; + case WAFFLE_CONTEXT_OPENGL_ES2: + case WAFFLE_CONTEXT_OPENGL_ES3: + expected_version_str = "OpenGL ES "; + break; + default: + assert_true(0); + break; + } + + const size_t version_str_len = strlen(expected_version_str); + assert_true(strncmp(version_str, expected_version_str, version_str_len) == 0); + version_str += version_str_len; count = sscanf(version_str, "%d.%d", &major, &minor); assert_true(count == 2); assert_true(major >= 0); assert_true(minor >= 0 && minor < 10); + if (context_version != WAFFLE_DONT_CARE) { + int expected_major = context_version / 10; + int expected_minor = context_version % 10; + + assert_true(major >= expected_major); + assert_true(minor >= expected_minor || major > expected_major); + } + + const char *profile_suffix = ""; + + if (waffle_context_api == WAFFLE_CONTEXT_OPENGL) { + switch (context_profile) { + case WAFFLE_CONTEXT_CORE_PROFILE: + profile_suffix = " (Core Profile)"; + break; + case WAFFLE_CONTEXT_COMPATIBILITY_PROFILE: + profile_suffix = " (Compatibility Profile)"; + break; + case WAFFLE_DONT_CARE: + break; + default: + assert_true(0); + break; + } + } + + char profile_str[30]; // 30 should be enough ;-) + sprintf(profile_str, "%d.%d%s", major, minor, profile_suffix); + + const size_t profile_str_len = strlen(profile_str); + assert_true(strncmp(version_str, profile_str, profile_str_len) == 0); + int version_10x = 10 * major + minor; if ((waffle_context_api == WAFFLE_CONTEXT_OPENGL && version_10x >= 30) || @@ -411,6 +469,21 @@ } } + // GL_ROBUST_ACCESS comes with the following extensions + // GL_ARB_robustness + // GL_EXT_robustness + // GL_KHR_robustness + // + // To keep it simple, assume the correct extension is there if + // glGetError is happy ;-) + if (context_robust) { + GLint robust_flag = 0; + glGetIntegerv(GL_CONTEXT_ROBUST_ACCESS, &robust_flag); + + if (glGetError() == GL_NO_ERROR) + assert_true(robust_flag); + } + // Draw. ASSERT_GL(glClearColor(RED_F, GREEN_F, BLUE_F, ALPHA_F)); ASSERT_GL(glClear(GL_COLOR_BUFFER_BIT)); @@ -453,15 +526,24 @@ .expect_error=WAFFLE_##error); \ } -#define test_gl_debug(error) \ -static void test_gl_basic_gl_debug(void **state) \ +#define test_XX_debug(context_api, waffle_api, error) \ +static void test_gl_basic_##context_api##_debug(void **state) \ { \ gl_basic_draw(state, \ - .api=WAFFLE_CONTEXT_OPENGL, \ + .api=WAFFLE_CONTEXT_##waffle_api, \ .debug=true, \ .expect_error=WAFFLE_##error); \ } +#define test_XX_robust(context_api, waffle_api, error) \ +static void test_gl_basic_##context_api##_robust(void **state) \ +{ \ + gl_basic_draw(state, \ + .api=WAFFLE_CONTEXT_##waffle_api, \ + .robust=true, \ + .expect_error=WAFFLE_##error); \ +} + #define test_glXX(waffle_version, error) \ static void test_gl_basic_gl##waffle_version(void **state) \ { \ @@ -502,6 +584,28 @@ .expect_error=WAFFLE_##error); \ } +#define test_glXX_core_debug(waffle_version, error) \ +static void test_gl_basic_gl##waffle_version##_core_debug(void **state) \ +{ \ + gl_basic_draw(state, \ + .api=WAFFLE_CONTEXT_OPENGL, \ + .version=waffle_version, \ + .profile=WAFFLE_CONTEXT_CORE_PROFILE, \ + .debug=true, \ + .expect_error=WAFFLE_##error); \ +} + +#define test_glXX_core_robust(waffle_version, error) \ +static void test_gl_basic_gl##waffle_version##_core_robust(void **state) \ +{ \ + gl_basic_draw(state, \ + .api=WAFFLE_CONTEXT_OPENGL, \ + .version=waffle_version, \ + .profile=WAFFLE_CONTEXT_CORE_PROFILE, \ + .robust=true, \ + .expect_error=WAFFLE_##error); \ +} + #define test_glXX_compat(waffle_version, error) \ static void test_gl_basic_gl##waffle_version##_compat(void **state) \ { \ @@ -512,6 +616,28 @@ .expect_error=WAFFLE_##error); \ } +#define test_glXX_compat_debug(waffle_version, error) \ +static void test_gl_basic_gl##waffle_version##_compat_debug(void **state) \ +{ \ + gl_basic_draw(state, \ + .api=WAFFLE_CONTEXT_OPENGL, \ + .version=waffle_version, \ + .profile=WAFFLE_CONTEXT_COMPATIBILITY_PROFILE, \ + .debug=true, \ + .expect_error=WAFFLE_##error); \ +} + +#define test_glXX_compat_robust(waffle_version, error) \ +static void test_gl_basic_gl##waffle_version##_compat_robust(void **state) \ +{ \ + gl_basic_draw(state, \ + .api=WAFFLE_CONTEXT_OPENGL, \ + .version=waffle_version, \ + .profile=WAFFLE_CONTEXT_COMPATIBILITY_PROFILE, \ + .robust=true, \ + .expect_error=WAFFLE_##error); \ +} + #define test_glesXX(api_version, waffle_version, error) \ static void test_gl_basic_gles##waffle_version(void **state) \ { \ @@ -539,6 +665,7 @@ unit_test_make(test_gl_basic_gl_rgba), \ unit_test_make(test_gl_basic_gl_fwdcompat), \ unit_test_make(test_gl_basic_gl_debug), \ + unit_test_make(test_gl_basic_gl_robust), \ \ unit_test_make(test_gl_basic_gl10), \ unit_test_make(test_gl_basic_gl11), \ @@ -557,6 +684,8 @@ \ unit_test_make(test_gl_basic_gl32_core), \ unit_test_make(test_gl_basic_gl32_core_fwdcompat), \ + unit_test_make(test_gl_basic_gl32_core_debug), \ + unit_test_make(test_gl_basic_gl32_core_robust), \ unit_test_make(test_gl_basic_gl33_core), \ unit_test_make(test_gl_basic_gl40_core), \ unit_test_make(test_gl_basic_gl41_core), \ @@ -564,6 +693,8 @@ unit_test_make(test_gl_basic_gl43_core), \ \ unit_test_make(test_gl_basic_gl32_compat), \ + unit_test_make(test_gl_basic_gl32_compat_debug), \ + unit_test_make(test_gl_basic_gl32_compat_robust), \ unit_test_make(test_gl_basic_gl33_compat), \ unit_test_make(test_gl_basic_gl40_compat), \ unit_test_make(test_gl_basic_gl41_compat), \ @@ -573,17 +704,23 @@ unit_test_make(test_gl_basic_gles1_rgb), \ unit_test_make(test_gl_basic_gles1_rgba), \ unit_test_make(test_gl_basic_gles1_fwdcompat), \ + unit_test_make(test_gl_basic_gles1_robust), \ + unit_test_make(test_gl_basic_gles1_debug), \ unit_test_make(test_gl_basic_gles10), \ unit_test_make(test_gl_basic_gles11), \ \ unit_test_make(test_gl_basic_gles2_rgb), \ unit_test_make(test_gl_basic_gles2_rgba), \ unit_test_make(test_gl_basic_gles2_fwdcompat), \ + unit_test_make(test_gl_basic_gles2_debug), \ + unit_test_make(test_gl_basic_gles2_robust), \ unit_test_make(test_gl_basic_gles20), \ \ unit_test_make(test_gl_basic_gles3_rgb), \ unit_test_make(test_gl_basic_gles3_rgba), \ unit_test_make(test_gl_basic_gles3_fwdcompat), \ + unit_test_make(test_gl_basic_gles3_debug), \ + unit_test_make(test_gl_basic_gles3_robust), \ unit_test_make(test_gl_basic_gles30), \ \ }; \ @@ -612,7 +749,8 @@ // test_XX_fwdcompat(gl, OPENGL, ERROR_BAD_ATTRIBUTE) -test_gl_debug(NO_ERROR) +test_XX_debug(gl, OPENGL, NO_ERROR) +test_XX_robust(gl, OPENGL, NO_ERROR) test_glXX(30, NO_ERROR) test_glXX_fwdcompat(30, NO_ERROR) @@ -621,6 +759,8 @@ test_glXX_core(32, NO_ERROR) test_glXX_core_fwdcompat(32, NO_ERROR) +test_glXX_core_debug(32, NO_ERROR) +test_glXX_core_robust(32, NO_ERROR) test_glXX_core(33, NO_ERROR) test_glXX_core(40, NO_ERROR) test_glXX_core(41, NO_ERROR) @@ -628,6 +768,8 @@ test_glXX_core(43, NO_ERROR) test_glXX_compat(32, NO_ERROR) +test_glXX_compat_debug(32, NO_ERROR) +test_glXX_compat_robust(32, NO_ERROR) test_glXX_compat(33, NO_ERROR) test_glXX_compat(40, NO_ERROR) test_glXX_compat(41, NO_ERROR) @@ -636,15 +778,21 @@ test_XX_rgb(gles1, OPENGL_ES1, NO_ERROR) test_XX_rgba(gles1, OPENGL_ES1, NO_ERROR) +test_XX_debug(gles1, OPENGL_ES1, NO_ERROR) +test_XX_robust(gles1, OPENGL_ES1, NO_ERROR) test_glesXX(1, 10, NO_ERROR) test_glesXX(1, 11, NO_ERROR) test_XX_rgb(gles2, OPENGL_ES2, NO_ERROR) test_XX_rgba(gles2, OPENGL_ES2, NO_ERROR) +test_XX_debug(gles2, OPENGL_ES2, NO_ERROR) +test_XX_robust(gles2, OPENGL_ES2, NO_ERROR) test_glesXX(2, 20, NO_ERROR) test_XX_rgb(gles3, OPENGL_ES3, NO_ERROR) test_XX_rgba(gles3, OPENGL_ES3, NO_ERROR) +test_XX_debug(gles3, OPENGL_ES3, NO_ERROR) +test_XX_robust(gles3, OPENGL_ES3, NO_ERROR) test_glesXX(3, 30, NO_ERROR) // @@ -749,13 +897,18 @@ #undef test_glesXX +#undef test_glXX_compat_robust +#undef test_glXX_compat_debug #undef test_glXX_compat +#undef test_glXX_core_robust +#undef test_glXX_core_debug #undef test_glXX_core_fwdcompat #undef test_glXX_core #undef test_glXX_fwdcompat #undef test_glXX -#undef test_gl_debug +#undef test_XX_robust +#undef test_XX_debug #undef test_XX_fwdcompat #undef test_XX_rgba #undef test_XX_rgb @@ -886,10 +1039,11 @@ /// @return true on success. static bool -parse_args(int argc, char *argv[], int *platform) +parse_args(int argc, char *argv[], int *out_platform) { bool ok; bool loop_get_opt = true; + int platform = 0; #ifdef __APPLE__ removeXcodeArgs(&argc, argv); @@ -907,7 +1061,7 @@ case '?': goto error_unrecognized_arg; case OPT_PLATFORM: - ok = enum_map_translate_str(platform_map, optarg, platform); + ok = enum_map_translate_str(platform_map, optarg, &platform); if (!ok) { usage_error_printf("'%s' is not a valid platform", optarg); @@ -926,10 +1080,11 @@ goto error_unrecognized_arg; } - if (!*platform) { + if (!platform) { usage_error_printf("--platform is required"); } + *out_platform = platform; return true; error_unrecognized_arg: ++++++ waffle.keyring ++++++ Binary files /var/tmp/diff_new_pack.jCL397/_old and /var/tmp/diff_new_pack.jCL397/_new differ
