diff options
322 files changed, 9343 insertions, 6914 deletions
diff --git a/X11/xtrans/Xtransint.h b/X11/xtrans/Xtransint.h index 1f32f0cae..ec5a77203 100644 --- a/X11/xtrans/Xtransint.h +++ b/X11/xtrans/Xtransint.h @@ -72,10 +72,6 @@ from The Open Group. # define XTRANSDEBUG 1 #endif -#if XTRANS_SEND_FDS && !(defined(linux) || defined(__sun)) -#error "FD passing support only on Linux & Solaris" -#endif - #ifdef WIN32 # define _WILLWINSOCK_ #endif diff --git a/X11/xtrans/Xtransutil.c b/X11/xtrans/Xtransutil.c index a6928bb87..63f0fc355 100644 --- a/X11/xtrans/Xtransutil.c +++ b/X11/xtrans/Xtransutil.c @@ -306,24 +306,12 @@ static jmp_buf env; #ifdef SIGALRM static volatile int nameserver_timedout = 0; -static -#ifdef RETSIGTYPE /* set by autoconf AC_TYPE_SIGNAL */ -RETSIGTYPE -#else /* Imake */ -#ifdef SIGNALRETURNSINT -int -#else -void -#endif -#endif +static void nameserver_lost(int sig _X_UNUSED) { nameserver_timedout = 1; longjmp (env, -1); /* NOTREACHED */ -#ifdef SIGNALRETURNSINT - return -1; /* for picky compilers */ -#endif } #endif /* SIGALARM */ diff --git a/X11/xtrans/xtrans.m4 b/X11/xtrans/xtrans.m4 index d84442e86..fe128b47e 100644 --- a/X11/xtrans/xtrans.m4 +++ b/X11/xtrans/xtrans.m4 @@ -29,12 +29,12 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_SEARCH_LIBS(socket, [socket]) AC_SEARCH_LIBS(gethostbyname, [nsl]) if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then - AC_HAVE_LIBRARY([ws2_32]) + AC_CHECK_LIB([ws2_32],[main]) fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems AC_ARG_ENABLE(ipv6, - AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), + AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), [IPV6CONN=$enableval], [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) AC_MSG_CHECKING([if IPv6 support should be built]) @@ -100,13 +100,12 @@ AC_INCLUDES_DEFAULT # that use Xtrans functions AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_TYPE_SIGNAL]) [case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; esac] AC_ARG_ENABLE(unix-transport, - AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), + AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), [UNIXCONN=$enableval], [UNIXCONN=$unixdef]) AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) if test "$UNIXCONN" = "yes"; then @@ -114,7 +113,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ fi AC_MSG_RESULT($UNIXCONN) AC_ARG_ENABLE(tcp-transport, - AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), + AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), [TCPCONN=$enableval], [TCPCONN=yes]) AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) AC_MSG_RESULT($TCPCONN) @@ -127,7 +126,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, - AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), + AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), [LOCALCONN=$enableval], [LOCALCONN=$localdef]) AC_MSG_CHECKING([if Xtrans should support os-specific local connections]) AC_MSG_RESULT($LOCALCONN) @@ -145,7 +144,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], [AC_REQUIRE([XTRANS_TCP_FLAGS]) AC_ARG_ENABLE(secure-rpc, - AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), + AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), [SECURE_RPC=$enableval], [SECURE_RPC="try"]) if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then diff --git a/fontconfig/autogen.sh b/fontconfig/autogen.sh index 1482e401c..29c1fd26c 100644 --- a/fontconfig/autogen.sh +++ b/fontconfig/autogen.sh @@ -24,10 +24,19 @@ LIBTOOLIZE=${LIBTOOLIZE-libtoolize} AUTOMAKE=${AUTOMAKE-automake} AUTOHEADER=${AUTOHEADER-autoheader} AUTOCONF=${AUTOCONF-autoconf} +GPERF=${GPERF-gperf} LIBTOOLIZE_FLAGS="--copy --force" DIE=0 +($GPERF --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have gperf installed to compile $PROJECT." + echo "Install the appropriate package for your distribution." + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + have_libtool=false if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then libtool_version=`$LIBTOOLIZE --version | sed 's/^.* \([0-9][.][0-9.]*\)[^ ]*$/\1/'` diff --git a/fontconfig/conf.d/10-no-sub-pixel.conf b/fontconfig/conf.d/10-no-sub-pixel.conf index cf1246561..635847c40 100644 --- a/fontconfig/conf.d/10-no-sub-pixel.conf +++ b/fontconfig/conf.d/10-no-sub-pixel.conf @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> -<!-- Enable sub-pixel rendering --> +<!-- Disable sub-pixel rendering --> <match target="pattern"> <!-- This configuration is available on the major desktop environments. diff --git a/fontconfig/conf.d/30-metric-aliases.conf b/fontconfig/conf.d/30-metric-aliases.conf index d0d9ea2e0..49a960247 100644 --- a/fontconfig/conf.d/30-metric-aliases.conf +++ b/fontconfig/conf.d/30-metric-aliases.conf @@ -22,8 +22,11 @@ Microsoft fonts: Liberation fonts: Google CrOS core fonts: StarOffice fo ================ ====================== ======================= ================= ============== Arial Liberation Sans Arimo Albany Albany AMT Arial Narrow Liberation Sans Narrow -Times New Roman Liberation Serif Cousine Thorndale Thorndale AMT -Courier New Liberation Mono Tinos Cumberland Cumberland AMT +Times New Roman Liberation Serif Tinos Thorndale Thorndale AMT +Courier New Liberation Mono Cousine Cumberland Cumberland AMT +Cambria Caladea +Calibri Carlito +Symbol SymbolNeu Microsoft fonts: Other fonts: ================ ============ @@ -307,7 +310,26 @@ but in an order preferring similar designs first. We do this in three steps: </default> </alias> + <alias binding="same"> + <family>Caladea</family> + <default> + <family>Cambria</family> + </default> + </alias> + <alias binding="same"> + <family>Carlito</family> + <default> + <family>Calibri</family> + </default> + </alias> + + <alias binding="same"> + <family>SymbolNeu</family> + <default> + <family>Symbol</family> + </default> + </alias> <!-- Accept the other group as fallback --> @@ -494,4 +516,25 @@ but in an order preferring similar designs first. We do this in three steps: </accept> </alias> + <alias binding="same"> + <family>Cambria</family> + <accept> + <family>Caladea</family> + </accept> + </alias> + + <alias binding="same"> + <family>Calibri</family> + <accept> + <family>Carlito</family> + </accept> + </alias> + + <alias binding="same"> + <family>Symbol</family> + <accept> + <family>SymbolNeu</family> + </accept> + </alias> + </fontconfig> diff --git a/fontconfig/configure.ac b/fontconfig/configure.ac index 44789149b..728a55099 100644 --- a/fontconfig/configure.ac +++ b/fontconfig/configure.ac @@ -148,52 +148,42 @@ AC_TYPE_PID_T # Checks for library functions. AC_FUNC_VPRINTF AC_FUNC_MMAP -AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat]) +AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink regcomp regerror regexec regfree fstatvfs fstatfs lstat]) dnl AC_CHECK_FUNCS doesn't check for header files. dnl posix_fadvise() may be not available in older libc. -fc_saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $WARN_CFLAGS -Werror" -AC_MSG_CHECKING([for posix_fadvise]) -AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include <fcntl.h> - int main(void) { - return posix_fadvise(0, 0, 0, 0); - } - ]])],[ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_POSIX_FADVISE], [1], [Define to 1 if you have the 'posix_fadvise' function.]) - ],[AC_MSG_RESULT([no])]) +AC_CHECK_SYMBOL([posix_fadvise], [fcntl.h], [fc_func_posix_fadvise=1], [fc_func_posix_fadvise=0]) +AC_DEFINE_UNQUOTED([HAVE_POSIX_FADVISE], [$fc_func_posix_fadvise], [Define to 1 if you have the 'posix_fadivse' function.]) if test "$os_win32" = "no"; then AC_MSG_CHECKING([for scandir]) - AC_LINK_IFELSE([AC_LANG_SOURCE([[ + fc_saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $WARN_CFLAGS -Werror" + AC_TRY_COMPILE([ #include <dirent.h> - int comp(const struct dirent **, const struct dirent **); - int comp(const struct dirent **a, const struct dirent **b) { return 0; } - int main(void) { - struct dirent **d; - return scandir(".", &d, 0, &comp) >= 0; - } - ]])],[ + int main(void); + ], [ + int (* comp) (const struct dirent **, const struct dirent **) = 0; + struct dirent **d; + return scandir(".", &d, 0, comp) >= 0; + ], [ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_SCANDIR], [1], [Define to 1 if you have the 'scandir' function.]) + ], [ + AC_TRY_COMPILE([ + #include <dirent.h> + int main(void); + ], [ + int (* comp) (const void *, const void *) = 0; + struct dirent **d; + return scandir(".", &d, 0, comp) >= 0; + ], [ AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SCANDIR], [1], [Define to 1 if you have the 'scandir' function.]) + AC_DEFINE([HAVE_SCANDIR_VOID_P], [1], [Define to 1 if you have the 'scandir' function with int (* compar)(const void *, const void *)]) ],[ - AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include <dirent.h> - int comp(const void *, const void *); - int comp(const void *a, const void *b) { return 0; } - int main(void) { - struct dirent **d; - return scandir(".", &d, 0, &comp) >= 0; - } - ]])],[ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SCANDIR_VOID_P], [1], [Define to 1 if you have the 'scandir' function with int (* compar)(const void *, const void *)]) - ],[ - AC_MSG_ERROR([ + AC_MSG_ERROR([ *** No scandir function available.]) - ]) ]) + ]) fi CFLAGS="$fc_saved_CFLAGS" @@ -531,7 +521,7 @@ AC_ARG_WITH(cache-dir, case $fc_cachedir in no|yes) if test "$os_win32" = "yes"; then - fc_cachedir="WINDOWSTEMPDIR_FONTCONFIG_CACHE" + fc_cachedir="LOCAL_APPDATA_FONTCONFIG_CACHE" else fc_cachedir='${localstatedir}/cache/${PACKAGE}' fi diff --git a/fontconfig/m4/ac_check_symbol.m4 b/fontconfig/m4/ac_check_symbol.m4 new file mode 100644 index 000000000..41c15286a --- /dev/null +++ b/fontconfig/m4/ac_check_symbol.m4 @@ -0,0 +1,48 @@ +dnl @synopsis AC_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]) +dnl +dnl a wrapper around AC_EGREP_HEADER the shellvar $ac_found will hold +dnl the HEADER-name that had been containing the symbol. This value is +dnl shown to the user. +dnl +dnl @category C +dnl @author Guido U. Draheim <guidod@gmx.de> +dnl @version 2006-10-13 +dnl @license GPLWithACException + +AC_DEFUN([AC_CHECK_SYMBOL], +[AC_MSG_CHECKING([for $1 in $2]) +AC_CACHE_VAL(ac_cv_func_$1, +[AC_REQUIRE_CPP()dnl +changequote(, )dnl +symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]" +changequote([, ])dnl +ac_found=no +for ac_header in $2 ; do + ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' ` + if test $ac_found != "yes" ; then + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] ) + fi + fi +done +if test "$ac_found" != "no" ; then + AC_MSG_RESULT($ac_found) + ifelse([$3], , :, [$3]) +else + AC_MSG_RESULT(no) + ifelse([$4], , , [$4 +])dnl +fi +])]) + +dnl AC_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]]) +AC_DEFUN([AC_CHECK_SYMBOLS], +[for ac_func in $1 +do +P4_CHECK_SYMBOL($ac_func, $2, +[changequote(, )dnl + ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'` +changequote([, ])dnl + AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl +done +]) diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index c7f243749..10eacffdf 100644 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -573,7 +573,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) { #if defined(HAVE_MMAP) || defined(__CYGWIN__) cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0); -#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) +#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED); #endif if (cache == MAP_FAILED) diff --git a/fontconfig/src/fcdefault.c b/fontconfig/src/fcdefault.c index c6397c0c2..4beda7c00 100644 --- a/fontconfig/src/fcdefault.c +++ b/fontconfig/src/fcdefault.c @@ -149,7 +149,7 @@ retry: #else # if defined (HAVE_GETEXECNAME) const char *p = getexecname (); -# else +# elif defined (HAVE_READLINK) char buf[PATH_MAX + 1]; int len; char *p = NULL; @@ -160,6 +160,8 @@ retry: buf[len] = '\0'; p = buf; } +# else + char *p = NULL; # endif if (p) { diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c index 627aa1a16..93e013f9b 100644 --- a/fontconfig/src/fcmatch.c +++ b/fontconfig/src/fcmatch.c @@ -743,6 +743,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr { FcBool ret = FcFalse; FcCharSet *cs; + int i; cs = 0; if (trim || csp) @@ -752,7 +753,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr goto bail; } - while (nnode--) + for (i = 0; i < nnode; i++) { FcSortNode *node = *n++; FcBool adds_chars = FcFalse; @@ -776,7 +777,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr * If this font isn't a subset of the previous fonts, * add it to the list */ - if (!trim || adds_chars) + if (!i || !trim || adds_chars) { FcPatternReference (node->pattern); if (FcDebug () & FC_DBG_MATCHV) diff --git a/gl/configure.ac b/gl/configure.ac index 04511930e..7b0c60899 100644 --- a/gl/configure.ac +++ b/gl/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([GLProto], [1.4.16], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([GLProto], [1.4.17], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) # Require xorg-macros: XORG_DEFAULT_OPTIONS diff --git a/gl/glxtokens.h b/gl/glxtokens.h index 5e6bbea11..a95082e47 100644 --- a/gl/glxtokens.h +++ b/gl/glxtokens.h @@ -107,6 +107,8 @@ extern "C" { /* GLX_RENDER_TYPE bits */ #define GLX_RGBA_BIT 0x00000001 #define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 /* GLX_DRAWABLE_TYPE bits */ #define GLX_WINDOW_BIT 0x00000001 diff --git a/libX11/include/X11/Xlib.h b/libX11/include/X11/Xlib.h index 65f253cd4..2bffa76de 100644 --- a/libX11/include/X11/Xlib.h +++ b/libX11/include/X11/Xlib.h @@ -58,23 +58,11 @@ typedef unsigned long wchar_t; #endif #endif -#if defined(ISC) && defined(USE_XMBTOWC) -#define wctomb(a,b) _Xwctomb(a,b) -#define mblen(a,b) _Xmblen(a,b) -#ifndef USE_XWCHAR_STRING -#define mbtowc(a,b,c) _Xmbtowc(a,b,c) -#endif -#endif extern int _Xmblen( -#ifdef ISC - char const *str, - size_t len -#else char *str, int len -#endif ); /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in @@ -3999,13 +3987,8 @@ extern void XSetAuthorization( extern int _Xmbtowc( wchar_t * /* wstr */, -#ifdef ISC - char const * /* str */, - size_t /* len */ -#else char * /* str */, int /* len */ -#endif ); extern int _Xwctomb( diff --git a/libX11/modules/om/generic/omGeneric.c b/libX11/modules/om/generic/omGeneric.c index 7122bb762..0d202c0f6 100644 --- a/libX11/modules/om/generic/omGeneric.c +++ b/libX11/modules/om/generic/omGeneric.c @@ -833,7 +833,7 @@ parse_omit_name( return True; /* This may mot be needed anymore as XListFonts() takes care of this */ - while (num_fields < 12) { + if (num_fields < 12) { if ((last - buf) > (XLFD_MAX_LEN - 2)) return -1; *last = '*'; diff --git a/libX11/src/xlibi18n/lcStd.c b/libX11/src/xlibi18n/lcStd.c index 87f6b60b3..9d452bcae 100644 --- a/libX11/src/xlibi18n/lcStd.c +++ b/libX11/src/xlibi18n/lcStd.c @@ -199,13 +199,8 @@ _Xlcwcstombs( int _Xmbtowc( wchar_t *wstr, -#ifdef ISC - char const *str, - size_t len -#else char *str, int len -#endif ) { return _Xlcmbtowc((XLCd) NULL, wstr, str, len); @@ -213,13 +208,8 @@ _Xmbtowc( int _Xmblen( -#ifdef ISC - char const *str, - size_t len -#else char *str, int len -#endif ) { return _Xmbtowc((wchar_t *) NULL, str, len); diff --git a/libXft/src/xftglyphs.c b/libXft/src/xftglyphs.c index 2f3dc5a6b..4b5fb82e5 100644 --- a/libXft/src/xftglyphs.c +++ b/libXft/src/xftglyphs.c @@ -21,10 +21,10 @@ */ #include "xftint.h" -#include <freetype/ftoutln.h> -#include <freetype/ftlcdfil.h> +#include FT_OUTLINE_H +#include FT_LCD_FILTER_H -#include <freetype/ftsynth.h> +#include FT_SYNTHESIS_H /* * Validate the memory info for a font diff --git a/libXmu/src/ShapeWidg.c b/libXmu/src/ShapeWidg.c index 32388ee46..3ca711648 100644 --- a/libXmu/src/ShapeWidg.c +++ b/libXmu/src/ShapeWidg.c @@ -201,7 +201,7 @@ ShapeEllipseOrRoundedRectangle(Widget w, Bool ellipse, int ew, int eh) GC gc; unsigned long mask; - if (width < 3 || width < 3) + if (width < 3 || height < 3) return; width += w->core.border_width << 1; height += w->core.border_width << 1; diff --git a/libxcb/NEWS b/libxcb/NEWS index 533d72b87..d0198f59c 100644 --- a/libxcb/NEWS +++ b/libxcb/NEWS @@ -1,6 +1,43 @@ +Release 1.10 (2013-12-XX) +========================= +* Bump libxcb-xkb SONAME due to ABI break introduced in 1.9.2 +* Enable libxcb-xkb by default +* Bump libxcb-sync SONAME +* c_client.py: Fix _sizeof() functions +* c_client.py: Do not create pointers in unions +* c_client.py: Always initialize xcb_align_to +* Re-introduce xcb_ge_event_t (deprecated, xcb_ge_generic_event_t should be + used instead) +* Fix alignment issues in FD passing code +* Fix poll() if POLLIN == ROLLRDNORM|POLLRDBAND +* Use /usr/spool/sockets/X11/ on HP-UX for UNIX sockets +* Make xsltproc optional + +Release 1.9.3 (2013-11-07) +========================== +* Check if we need to define _XOPEN_SOURCE for struct msghdr.msg_control +* Add configure option to enable or disable fd passing with sendmsg +* Switch to using the CMSG_* macros for FD passing +* Initialize automake earlier (bugfix for #66413) + +Release 1.9.2 (2013-11-07) +========================== +* Add Present extension +* Add DRI3 library +* Add event queue splitting +* Add support for receiving fds in replies +* Add xcb_send_fd API +* Remove xcb_ge_event_t from xcb.h +* c_client.py: Inject full_sequence into GE events +* c_client.py: Handle multiple expr. in a bitcase + +Release 1.9.1 (2013-05-30) +========================== +* Fix python code to work with python-3 +* Security fix for integer overflow in read_packet() [CVE-2013-2064] + Release 1.9 (2012-10-05) ======================== - * Always include "config.h" at the start of all C source files. * Add AC_USE_SYSTEM_EXTENSIONS to allow use of more system functionality * Return connection failure if display string specifies non-existent screen diff --git a/libxcb/configure.ac b/libxcb/configure.ac index 87804ba26..294bd1a92 100644 --- a/libxcb/configure.ac +++ b/libxcb/configure.ac @@ -41,7 +41,7 @@ fi AC_SUBST(HTML_CHECK_RESULT) # Checks for pkg-config packages -PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.9) +PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.10) NEEDED="pthread-stubs xau >= 0.99.2" PKG_CHECK_MODULES(NEEDED, $NEEDED) diff --git a/libxcb/src/Makefile.am b/libxcb/src/Makefile.am index 346ee03cc..f2875dd18 100644 --- a/libxcb/src/Makefile.am +++ b/libxcb/src/Makefile.am @@ -139,7 +139,7 @@ endif EXTSOURCES += sync.c if BUILD_SYNC lib_LTLIBRARIES += libxcb-sync.la -libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@ +libxcb_sync_la_LDFLAGS = -version-info 1:0:0 -no-undefined @lt_enable_auto_import@ libxcb_sync_la_LIBADD = $(XCB_LIBS) nodist_libxcb_sync_la_SOURCES = sync.c sync.h endif @@ -179,7 +179,7 @@ endif EXTSOURCES += xinput.c if BUILD_XINPUT lib_LTLIBRARIES += libxcb-xinput.la -libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined @lt_enable_auto_import@ +libxcb_xinput_la_LDFLAGS = -version-info 1:0:1 -no-undefined @lt_enable_auto_import@ libxcb_xinput_la_LIBADD = $(XCB_LIBS) nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h endif @@ -187,7 +187,7 @@ endif EXTSOURCES += xkb.c if BUILD_XKB lib_LTLIBRARIES += libxcb-xkb.la -libxcb_xkb_la_LDFLAGS = -version-info 0:0:0 -no-undefined +libxcb_xkb_la_LDFLAGS = -version-info 1:0:0 -no-undefined libxcb_xkb_la_LIBADD = $(XCB_LIBS) nodist_libxcb_xkb_la_SOURCES = xkb.c xkb.h endif diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py index 72800045e..99fd307b0 100644 --- a/libxcb/src/c_client.py +++ b/libxcb/src/c_client.py @@ -1061,8 +1061,8 @@ def _c_serialize_helper(context, complex_type, if context in ('unserialize', 'unpack', 'sizeof') and not self.var_followed_by_fixed_fields: code_lines.append('%s xcb_block_len += sizeof(%s);' % (space, self.c_type)) code_lines.append('%s xcb_tmp += xcb_block_len;' % space) - # probably not needed - #_c_serialize_helper_insert_padding(context, code_lines, space, False) + code_lines.append('%s xcb_buffer_len += xcb_block_len;' % space) + code_lines.append('%s xcb_block_len = 0;' % space) count += _c_serialize_helper_fields(context, self, code_lines, temp_vars, diff --git a/libxcb/src/xcb.h b/libxcb/src/xcb.h index 63864dc37..e62c985d5 100644 --- a/libxcb/src/xcb.h +++ b/libxcb/src/xcb.h @@ -141,6 +141,26 @@ typedef struct { } xcb_generic_event_t; /** + * @brief GE event + * + * An event as sent by the XGE extension. The length field specifies the + * number of 4-byte blocks trailing the struct. + * + * @deprecated Since some fields in this struct have unfortunate names, it is + * recommended to use xcb_ge_generic_event_t instead. + */ +typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t pad0; /**< Padding */ + uint16_t sequence; /**< Sequence number */ + uint32_t length; + uint16_t event_type; + uint16_t pad1; + uint32_t pad[5]; /**< Padding */ + uint32_t full_sequence; /**< full sequence */ +} xcb_ge_event_t; + +/** * @brief Generic error. * * A generic error structure. diff --git a/libxcb/src/xcb_in.c b/libxcb/src/xcb_in.c index fd6c2efd2..95087be4e 100644 --- a/libxcb/src/xcb_in.c +++ b/libxcb/src/xcb_in.c @@ -918,11 +918,13 @@ int _xcb_in_read(xcb_connection_t *c) #if HAVE_SENDMSG struct cmsghdr *hdr; - for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { - if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { - int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); - memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int)); - c->in.in_fd.nfd += nfd; + if (msg.msg_controllen >= sizeof (struct cmsghdr)) { + for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { + if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { + int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); + memcpy(&c->in.in_fd.fd[c->in.in_fd.nfd], CMSG_DATA(hdr), nfd * sizeof (int)); + c->in.in_fd.nfd += nfd; + } } } #endif diff --git a/libxcb/xcb-proto/NEWS b/libxcb/xcb-proto/NEWS index ebe184532..50ced6186 100644 --- a/libxcb/xcb-proto/NEWS +++ b/libxcb/xcb-proto/NEWS @@ -1,3 +1,64 @@ +Release 1.10 (2013-12-XX) +========================= +* xkb: comment out portions that libxcb doesn't handle properly +* Present: Remove reference to nonexistent enum +* sync: Add missing namespace for the INT64 struct +* sync: VALUETYPE and TESTTYPE are enum +* xinput: Add XI2 event enum. for event selection +* Rename ge events to GeGeneric events to avoid clash with libxcb + +Release 1.9 (2013-11-07) +======================== +* Add Present protocol specification +* Add DRI3 +* Add MIT-SHM AttachFd and CreateSegment requests +* Add support for file descriptor request fields +* Define X generic event structure +* Add CARD64/INT64 protocol types +* XKB: Rewrite AXOption +* XKB: Fix values of AXFBOpt enum +* xkb: Fix struct ExtensionDeviceNotify +* xkb: Pad structs CommonDoodad and SALockDeviceBtn +* randr: Fix GetProviderProperty reply +* Enforce a bit or value in enum items +* xkb: Add missing LedClass and BellClass enum values +* xkb: Add missing 'supported' field to GetNamedIndicator reply +* xkb: Unify Overlay1Behavior and Overlay2Behavior +* xkb: Change DfltBtnAbsolute to the value used by the server +* xkb: Fix key type map entry field order +* xkb: Work around alignment problems in GetNames and GetMap replies +* xinput: Use BARRIER from xfixes +* xinput: Unlock uninterpreted lists +* xinput: Add XI v2.3 +* xinput: Add XI v2.2 +* xinput: Add XI v2.1 +* xinput: Add XI v2.0 +* xinput: Add XI v1.5 +* xinput: Cleanup implementation of XI up to v1.4 +* Add support for X Generic Extension events +* sync: Change value list param of CreateAlarm and ChangeAlarm into switch +* res: Add ClientIdMask enum +* res: Fix and rename list in ClientIdValue +* randr: Add provider object support (RandR v1.4) +* xtest: Version bump 2.1..2.2 +* glx: Version bump 1.3..1.4 +* composite: Version bump 0.3..0.4 +* xfixes: Rename enum DirectionMask to BarrierDirec. +* XKB: Correct enum to mask +* screensaver: Use enum and mask attributes +* screensaver: Remove wrong fields from Notify event +* Prototype for XRes v1.2 +* XKB: Fix calculation in GetIndicatorMap +* XKB: Fix GetKbdByName +* Allow multiple <enumref> in a <bitcase> +* XKB: Change CARD8 to char where ASCII is expected +* XKB: Fix VirtualMods +* XKB: Fix SymInterpret +* XKB: Fix CountedString16 padding +* xkb: Revert half of d42d791 XKB: Fix broken events +* xfixes: Update to version 5 +* autogen.sh: Implement GNOME Build API + Release 1.8 (2012-10-05) ======================== * dri2: Update to DRI2 1.4 diff --git a/libxcb/xcb-proto/src/xinput.xml b/libxcb/xcb-proto/src/xinput.xml index dd3f18438..fa115bdcd 100644 --- a/libxcb/xcb-proto/src/xinput.xml +++ b/libxcb/xcb-proto/src/xinput.xml @@ -1790,10 +1790,10 @@ authorization from the authors. <eventcopy name="DeviceMotionNotify" number="5" ref="DeviceKeyPress" /> <event name="DeviceFocusIn" number="6"> - <field type="BYTE" name="detail" enum="NotifyDetail" /> + <field type="BYTE" name="detail" enum="xproto:NotifyDetail" /> <field type="TIMESTAMP" name="time" /> <field type="WINDOW" name="window" /> - <field type="BYTE" name="mode" enum="NotifyMode" /> + <field type="BYTE" name="mode" enum="xproto:NotifyMode" /> <field type="CARD8" name="device_id" /> <pad bytes="18" /> </event> @@ -2003,8 +2003,8 @@ authorization from the authors. <field type="TIMESTAMP" name="time" altenum="Time" /> <!-- event specific fields --> <field type="DeviceId" name="sourceid" altenum="Device" /> - <field type="CARD8" name="mode" enum="NotifyMode" /> - <field type="CARD8" name="detail" enum="NotifyDetail" /> + <field type="CARD8" name="mode" enum="xinput:NotifyMode" /> + <field type="CARD8" name="detail" enum="xinput:NotifyDetail" /> <field type="WINDOW" name="root" /> <field type="WINDOW" name="event" /> <field type="WINDOW" name="child" /> diff --git a/libxcb/xcb-proto/src/xproto.xml b/libxcb/xcb-proto/src/xproto.xml index defa11e6e..07795682c 100644 --- a/libxcb/xcb-proto/src/xproto.xml +++ b/libxcb/xcb-proto/src/xproto.xml @@ -1080,7 +1080,7 @@ The number of keycodes altered. </doc> </event> - <event name="ge" number="35" xge="true"> + <event name="GeGeneric" number="35" xge="true"> <pad bytes="22" /> <doc> <brief>generic event (with length)</brief> diff --git a/mesalib/Makefile.am b/mesalib/Makefile.am index 361fb5122..4780510ad 100644 --- a/mesalib/Makefile.am +++ b/mesalib/Makefile.am @@ -36,7 +36,6 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION) EXTRA_FILES = \ aclocal.m4 \ configure \ - VERSION \ bin/ar-lib \ bin/compile \ bin/config.sub \ @@ -46,6 +45,7 @@ EXTRA_FILES = \ bin/ltmain.sh \ bin/missing \ bin/ylwrap \ + bin/test-driver \ src/glsl/glsl_parser.cpp \ src/glsl/glsl_parser.h \ src/glsl/glsl_lexer.cpp \ diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 8c52535e6..f75325d33 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -28,7 +28,7 @@ AC_SUBST([OSMESA_VERSION]) dnl Versions for external dependencies LIBDRM_REQUIRED=2.4.24 -LIBDRM_RADEON_REQUIRED=2.4.49 +LIBDRM_RADEON_REQUIRED=2.4.50 LIBDRM_INTEL_REQUIRED=2.4.49 LIBDRM_NVVIEUX_REQUIRED=2.4.33 LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41" @@ -231,6 +231,12 @@ AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CXXFLAGS]) dnl +dnl Optional flags, check for compiler support +dnl +AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0]) +AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1]) + +dnl dnl Hacks to enable 32 or 64 bit build dnl AC_ARG_ENABLE([32-bit], @@ -761,6 +767,9 @@ AC_SUBST([MESA_LLVM]) # Check for libdrm PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED], [have_libdrm=yes], [have_libdrm=no]) +if test "x$have_libdrm" = xyes; then + DEFINES="$DEFINES -DHAVE_LIBDRM" +fi PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED], have_libudev=yes, have_libudev=no) @@ -833,7 +842,7 @@ xyesno) dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8" if test x"$enable_dri3" = xyes; then - dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence" + dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= 1.1" fi # add xf86vidmode if available @@ -1439,6 +1448,8 @@ for plat in $egl_platforms; do drm) test "x$enable_gbm" = "xno" && AC_MSG_ERROR([EGL platform drm needs gbm]) + test "x$have_libdrm" != xyes && + AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED]) ;; android|fbdev|gdi|null) @@ -1541,6 +1552,7 @@ strip_unwanted_llvm_flags() { -e 's/-O.\>//g' \ -e 's/-g\>//g' \ -e 's/-Wall\>//g' \ + -e 's/-fcolor-diagnostics\>//g' \ -e 's/-fomit-frame-pointer\>//g' } @@ -1938,7 +1950,7 @@ AC_SUBST([XVMC_MAJOR], 1) AC_SUBST([XVMC_MINOR], 0) AC_SUBST([XA_MAJOR], 2) -AC_SUBST([XA_MINOR], 0) +AC_SUBST([XA_MINOR], 1) AC_SUBST([XA_TINY], 0) AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY") diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 059ae9840..f98a54a78 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -30,14 +30,15 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi GL_EXT_texture_shared_exponent DONE (swrast) Float depth buffers (GL_ARB_depth_buffer_float) DONE () Framebuffer objects (GL_ARB_framebuffer_object) DONE (r300, swrast) - Half-float DONE (r300, swrast) - Non-normalized Integer texture/framebuffer formats DONE () - 1D/2D Texture arrays DONE () + GL_ARB_half_float_pixel DONE (r300, swrast) + GL_ARB_half_float_vertex DONE (r300, swrast) + GL_EXT_texture_integer DONE () + GL_EXT_texture_array DONE () Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (swrast) GL_EXT_texture_compression_rgtc DONE (r300, swrast) - Red and red/green texture formats DONE (r300, swrast) + GL_ARB_texture_rg DONE (r300, swrast) Transform feedback (GL_EXT_transform_feedback) DONE () - Vertex array objects (GL_APPLE_vertex_array_object) DONE + Vertex array objects (GL_ARB_vertex_array_object) DONE (all drivers) sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE () glClearBuffer commands DONE glGetStringi command DONE @@ -45,6 +46,7 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi glVertexAttribI commands DONE Depth format cube textures DONE () GLX_ARB_create_context (GLX 1.4 is required) DONE + Multisample anti-aliasing DONE (r300) GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi diff --git a/mesalib/docs/devinfo.html b/mesalib/docs/devinfo.html index b495097c9..a9d8b4f7d 100644 --- a/mesalib/docs/devinfo.html +++ b/mesalib/docs/devinfo.html @@ -17,7 +17,7 @@ <h1>Development Notes</h1> -<h2>Adding Extentions</h2> +<h2>Adding Extensions</h2> <p> To add a new GL extension to Mesa you have to do at least the following. @@ -190,11 +190,26 @@ you should add an appropriate note to the commit message. Here are some examples of such a note: </p> <ul> - <li>NOTE: This is a candidate for the 9.0 branch.</li> - <li>NOTE: This is a candidate for the 8.0 and 9.0 branches.</li> - <li>NOTE: This is a candidate for the stable branches.</li> + <li>CC: <mesa-stable@lists.freedesktop.org></li> + <li>CC: "9.2 10.0" <mesa-stable@lists.freedesktop.org></li> + <li>CC: "10.0" <mesa-stable@lists.freedesktop.org></li> </ul> +Simply adding the CC to the mesa-stable list address is adequate to nominate +the commit for the most-recently-created stable branch. It is only necessary +to specify a specific branch name, (such as "9.2 10.0" or "10.0" in the +examples above), if you want to nominate the commit for an older stable +branch. And, as in these examples, you can nominate the commit for the older +branch in addition to the more recent branch, or nominate the commit +exclusively for the older branch. + +This "CC" syntax for patch nomination will cause patches to automatically be +copied to the mesa-stable@ mailing list when you use "git send-email" to send +patches to the mesa-dev@ mailing list. Also, if you realize that a commit +should be nominate for the stable branch after it has already been commited, +you can send a note directly to the mesa-stable@lists.freedesktop.org where +the Mesa stable-branch maintainers will receive it. Be sure to mention the +commit ID of the commit of interest (as it appears in the mesa master branch). <h2>Cherry-picking candidates for a stable branch</h2> diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html index 3b8dd31cd..e26e9e5b7 100644 --- a/mesalib/docs/index.html +++ b/mesalib/docs/index.html @@ -16,6 +16,20 @@ <h1>News</h1> +<h2>December 12, 2013</h2> +<p> +<a href="relnotes/10.0.1.html">Mesa 10.0.1</a> +and <a href="relnotes/9.2.5.html">Mesa 9.2.5</a> are released. +These are both bug-fix releases +</p> + +<h2>November 30, 2013</h2> +<p> +<a href="relnotes/10.0.html">Mesa 10.0</a> is released. +This is a new development release. +See the release notes for more information about the release. +</p> + <h2>November 27, 2013</h2> <p> <a href="relnotes/9.2.4.html">Mesa 9.2.4</a> is released. diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index 24c0153b2..70e5862fa 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -22,7 +22,9 @@ The release notes summarize what's new or changed in each Mesa release. <ul> <li><a href="relnotes/10.1.html">10.1 release notes</a> +<li><a href="relnotes/10.0.1.html">10.0.1 release notes</a> <li><a href="relnotes/10.0.html">10.0 release notes</a> +<li><a href="relnotes/9.2.5.html">9.2.5 release notes</a> <li><a href="relnotes/9.2.4.html">9.2.4 release notes</a> <li><a href="relnotes/9.2.3.html">9.2.3 release notes</a> <li><a href="relnotes/9.2.2.html">9.2.2 release notes</a> diff --git a/mesalib/docs/relnotes/10.0.1.html b/mesalib/docs/relnotes/10.0.1.html new file mode 100644 index 000000000..b3f900b5f --- /dev/null +++ b/mesalib/docs/relnotes/10.0.1.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>Mesa Release Notes</title> + <link rel="stylesheet" type="text/css" href="../mesa.css"> +</head> +<body> + +<div class="header"> + <h1>The Mesa 3D Graphics Library</h1> +</div> + +<iframe src="../contents.html"></iframe> +<div class="content"> + +<h1>Mesa 10.0.1 Release Notes / (December 12, 2013)</h1> + +<p> +Mesa 10.0.1 is a bug fix release which fixes bugs found since the 10.0 release. +</p> +<p> +Mesa 10.0.1 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is <strong>only</strong> available if requested at context creation +because compatibility contexts not supported. +</p> + + +<h2>MD5 checksums</h2> +<pre> +0a72ca5b36046a658bf6038326ff32ed MesaLib-10.0.1.tar.bz2 +01bde35c912e504ba62caf1ef9f7022c MesaLib-10.0.1.tar.gz +59a174a11a89e6b1b8ee9c3f7e3c388c MesaLib-10.0.1.zip +</pre> + + +<h2>New features</h2> +<p>None</p> + +<h2>Bug fixes</h2> + +<p>This list is likely incomplete.</p> + +<ul> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a "empty declaration warning" in 9.2</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70250">Bug 70250</a> - weston-terminal rendering corrupted with output transform 90 and 270</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70601">Bug 70601</a> - [SNB Bisected]Piglit spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float fails</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72230">Bug 72230</a> - Unable to extract MesaLib-10.0.0.tar.{gz,bz2} with bsdtar</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</li> + +</ul> + +<h2>Changes</h2> + +<p>The full set of changes can be viewed by using the following git command:</p> + +<pre> + git log mesa-10.0..mesa-10.0.1 +</pre> + +<p>Axel Davy (2):</p> +<ul> + <li>egl/wayland: Flush the wl_display at the end of SwapBuffers</li> + <li>Enable throttling in SwapBuffers</li> +</ul> + +<p>Chad Versace (2):</p> +<ul> + <li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li> + <li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li> +</ul> + +<p>Dave Airlie (1):</p> +<ul> + <li>swrast: fix readback regression since inversion fix</li> +</ul> + +<p>Emil Velikov (1):</p> +<ul> + <li>automake: include only one copy VERSION in tarball</li> +</ul> + +<p>Ian Romanick (3):</p> +<ul> + <li>docs: Add 10.0 release md5sums</li> + <li>Remove a057b83 from the pick list</li> + <li>glsl: Don't emit empty declaration warning for a struct specifier</li> +</ul> + +<p>Ilia Mirkin (8):</p> +<ul> + <li>mesa: don't leak performance monitors on context destroy</li> + <li>nv50: Fix GPU_READING/WRITING bit removal</li> + <li>nouveau: avoid leaking fences while waiting</li> + <li>nv50: wait on the buf's fence before sticking it into pushbuf</li> + <li>nv50: enable h264 and mpeg4 for nv98+ (vp3, vp4.0)</li> + <li>nouveau/video: update h264 picparm field names based on usage</li> + <li>nouveau/video: update a few more h264 picparm field names</li> + <li>nv50: report 15 max inputs for fragment programs</li> +</ul> + +<p>Jordan Justen (1):</p> +<ul> + <li>dri megadriver_stub: add compatibility for older DRI loaders</li> +</ul> + +<p>Kristian Høgsberg (2):</p> +<ul> + <li>egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers</li> + <li>egl/wayland: Send commit after flushing the driver context</li> +</ul> + +<p>Maarten Lankhorst (1):</p> +<ul> + <li>nouveau: Fix compiler warning regression</li> +</ul> + +<p>Paul Berry (1):</p> +<ul> + <li>i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.</li> +</ul> + +<p>Thomas Hellstrom (1):</p> +<ul> + <li>st/xa: Bump major version number to 2</li> +</ul> + +<p>Tom Stellard (2):</p> +<ul> + <li>r300/compiler/tests: Fix segfault</li> + <li>r300/compiler/tests: Fix line length check in test parser</li> +</ul> + +</div> +</body> +</html> diff --git a/mesalib/docs/relnotes/10.0.html b/mesalib/docs/relnotes/10.0.html index 1e4f7716f..4622f456f 100644 --- a/mesalib/docs/relnotes/10.0.html +++ b/mesalib/docs/relnotes/10.0.html @@ -14,7 +14,7 @@ <iframe src="../contents.html"></iframe> <div class="content"> -<h1>Mesa 10.0 Release Notes / TBD</h1> +<h1>Mesa 10.0 Release Notes / (November 30th, 2013)</h1> <p> Mesa 10.0 is a new development release. @@ -33,7 +33,9 @@ because compatibility contexts are not supported. <h2>MD5 checksums</h2> <pre> -TBD. +b38626b96c664db67a534d7859682436 MesaLib-10.0.0.tar.gz +f3fe55d9735bea158bbe97ed9a0da819 MesaLib-10.0.0.tar.bz2 +c6ee1ce51e3bf35947d2978b872daf51 MesaLib-10.0.0.zip </pre> @@ -61,7 +63,75 @@ Note: some of the new features are only available with certain drivers. <h2>Bug fixes</h2> -TBD. +<p>Attempts have been made to <b>not</b> include bugs fixed in previous 9.2 +releases or bugs that were regressions during 10.0 development. This list is +likely incomplete.</p> + +<ul> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47755">Bug 47755</a> - [glsl-compiler] no error checking when Interpolation qualifier for built-in variable is different in vertex and fragment shader</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=52171">Bug 52171</a> - [gallium/r600/clover] Simple benchmarks failed to run</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53077">Bug 53077</a> - [IVB] Output error with msaa when both of framebuffer and source color's alpha are not 1</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54867">Bug 54867</a> - bug in r300 compiler</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60929">Bug 60929</a> - [r600-llvm] mono games with opengl are blocking on start</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62698">Bug 62698</a> - [bisected] WebGL demo "Consumed": texstate.c:628: update_texture_state: Assertion „__builtin_popcount(enabledTargets) == 1“ failed.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64225">Bug 64225</a> - bfgminer --scyte generates Segmentation Fault on Northern Island</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64226">Bug 64226</a> - python-opencl package generate segmentation fault at pipe_r600.so</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64261">Bug 64261</a> - [SNB Bisected]Ogles3conform GL3Tests_color_buffer_float_color_buffer_float_clamp_fixed.test fail</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66806">Bug 66806</a> - [softpipe] glxgears floating point exception</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67921">Bug 67921</a> - [bisected commit 883987] crosscompiling fails with util/u_cpu_detect.c:247:4: error: 'asm' undeclared (first use in this function)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68162">Bug 68162</a> - [radeonsi] texture rendering is broken in Source-Engine games</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68451">Bug 68451</a> - Texture flicker in native Dota2 in mesa 9.2.0rc1</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68503">Bug 68503</a> - Graphical glitches in Serious Sam 3 when SB is enabled</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68792">Bug 68792</a> - Problems during playback of h264 files using UVD and VLC on AMD E-350 CPU</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68845">Bug 68845</a> - VDPAU/UVD regression</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69078">Bug 69078</a> - Modern Warfare (1, 2 and 3) broken in Wine on SNB</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69321">Bug 69321</a> - starting openCL crashes/boots system</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70042">Bug 70042</a> - Major texture flickering in Dota 2 (r600g on HD 6950)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70088">Bug 70088</a> - Glamor on r600g crashes Xserver</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70123">Bug 70123</a> - Freeze caused by 'winsys/radeon: remove cs_queue_empty' commit</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70327">Bug 70327</a> - Casting floating point variable to integer not working properly while constant gets converted properly</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70891">Bug 70891</a> - CL_INVALID_BUILD_OPTIONS results in CL_INVALID_DEVICE when asking for build log</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70913">Bug 70913</a> - [PIGLIT,radeonsi] crash in "spec/EXT_framebuffer_multisample/sample-alpha-to-coverage 4 depth" (buffer overflow)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71022">Bug 71022</a> - configure: error: Expat required for DRI.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71110">Bug 71110</a> - xorg_driver.c:1030:2: error: too many arguments to function ‘DamageUnregister’</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71172">Bug 71172</a> - Segfault when running glxinfo. NV25GL [Quadro4 900 XGL]</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71512">Bug 71512</a> - dlopen.h:54: undefined reference to `dlopen'</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71870">Bug 71870</a> - Metro: Last Light rendering issues</li> + +</ul> <h2>Changes</h2> diff --git a/mesalib/docs/relnotes/10.1.html b/mesalib/docs/relnotes/10.1.html index 1b8ea22f8..778ae6a57 100644 --- a/mesalib/docs/relnotes/10.1.html +++ b/mesalib/docs/relnotes/10.1.html @@ -45,6 +45,7 @@ Note: some of the new features are only available with certain drivers. <ul> <li>GL_ARB_draw_indirect on i965.</li> +<li>GL_ARB_clear_buffer_object</li> </ul> @@ -54,7 +55,11 @@ TBD. <h2>Changes</h2> -TBD. +<ul> +<li>Removed support for the GL_MESA_texture_array extension. This extension + enabled the use of texture array with fixed-function and assembly fragment + shaders. No applications are known to use this extension.</li> +</ul> </div> </body> diff --git a/mesalib/docs/relnotes/9.2.4.html b/mesalib/docs/relnotes/9.2.4.html index 1ca6b1d13..e4a6fd4e5 100644 --- a/mesalib/docs/relnotes/9.2.4.html +++ b/mesalib/docs/relnotes/9.2.4.html @@ -31,6 +31,9 @@ because GL_ARB_compatibility is not supported. <h2>MD5 checksums</h2> <pre> +28190b831b0271d69dbc44b2686eab1c MesaLib-9.2.4.tar.gz +e630c0a307cec4f0f70ddd029d2fe084 MesaLib-9.2.4.tar.bz2 +8ef5e1e92e1d30fbedec31f716a7619e MesaLib-9.2.4.zip </pre> diff --git a/mesalib/docs/relnotes/9.2.5.html b/mesalib/docs/relnotes/9.2.5.html new file mode 100644 index 000000000..027e1a40a --- /dev/null +++ b/mesalib/docs/relnotes/9.2.5.html @@ -0,0 +1,120 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>Mesa Release Notes</title> + <link rel="stylesheet" type="text/css" href="../mesa.css"> +</head> +<body> + +<div class="header"> + <h1>The Mesa 3D Graphics Library</h1> +</div> + +<iframe src="../contents.html"></iframe> +<div class="content"> + +<h1>Mesa 9.2.5 Release Notes / (December 12, 2013)</h1> + +<p> +Mesa 9.2.5 is a bug fix release which fixes bugs found since the 9.2.4 release. +</p> +<p> +Mesa 9.2 implements the OpenGL 3.1 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.1. OpenGL +3.1 is <strong>only</strong> available if requested at context creation +because GL_ARB_compatibility is not supported. +</p> + + +<h2>MD5 checksums</h2> +<pre> +9fb4de29ca1d9cfd03cbdefa123ba336 MesaLib-9.2.5.tar.bz2 +1146c7c332767174f3de782b88d8e8ca MesaLib-9.2.5.tar.gz +a9a6c46dac7ea26fd272bf14894d95f3 MesaLib-9.2.5.zip +</pre> + + +<h2>New features</h2> +<p>None</p> + +<h2>Bug fixes</h2> + +<p>This list is likely incomplete.</p> + +<ul> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=62142">Bug 62142</a> - Mesa/demo mipmap_limits upside down with running by SOFTWARE</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64323">Bug 64323</a> - Severe misrendering in Left 4 Dead 2</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66213">Bug 66213</a> - Certain Mesa Demos Rendering Inverted (vertically)</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68838">Bug 68838</a> - GLSL: struct declarations produce a "empty declaration warning" in 9.2</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69155">Bug 69155</a> - [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72325">Bug 72325</a> - [swrast] piglit glean fbo regression</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72327">Bug 72327</a> - [swrast] piglit glean pointSprite regression</li> + +</ul> + +<h2>Changes</h2> + +<p>The full set of changes can be viewed by using the following GIT command:</p> + +<pre> + git log mesa-9.2.4..mesa-9.2.5 +</pre> + +<p>Chad Versace (2):</p> +<ul> + <li>i965/hsw: Apply non-msrt fast color clear w/a to all HSW GTs</li> + <li>i965: Add extra-alignment for non-msrt fast color clear for all hw (v2)</li> +</ul> + +<p>Chris Forbes (4):</p> +<ul> + <li>i965: Gen4-5: Don't enable hardware alpha test with MRT</li> + <li>i965: Gen4-5: Include alpha func/ref in program key</li> + <li>i965/fs: Gen4-5: Setup discard masks for MRT alpha test</li> + <li>i965/fs: Gen4-5: Implement alpha test in shader for MRT</li> +</ul> + +<p>Chí-Thanh Christopher Nguyễn (1):</p> +<ul> + <li>st/xorg: Handle new DamageUnregister API which has only one argument</li> +</ul> + +<p>Dave Airlie (3):</p> +<ul> + <li>mesa/swrast: fix inverted front buffer rendering with old-school swrast</li> + <li>glx: don't fail out when no configs if we have visuals</li> + <li>swrast: fix readback regression since inversion fix</li> +</ul> + +<p>Ian Romanick (1):</p> +<ul> + <li>glsl: Don't emit empty declaration warning for a struct specifier</li> +</ul> + +<p>Ilia Mirkin (4):</p> +<ul> + <li>nv50: Fix GPU_READING/WRITING bit removal</li> + <li>nouveau: avoid leaking fences while waiting</li> + <li>nv50: wait on the buf's fence before sticking it into pushbuf</li> + <li>nv50: report 15 max inputs for fragment programs</li> +</ul> + +<p>Tom Stellard (2):</p> +<ul> + <li>r300/compiler/tests: Fix segfault</li> + <li>r300/compiler/tests: Fix line length check in test parser</li> +</ul> + +</div> +</body> +</html> diff --git a/mesalib/docs/specs/MESA_texture_array.spec b/mesalib/docs/specs/MESA_texture_array.spec index b146821f7..3e3e82cf3 100644 --- a/mesalib/docs/specs/MESA_texture_array.spec +++ b/mesalib/docs/specs/MESA_texture_array.spec @@ -16,7 +16,7 @@ IP Status Status - Shipping in Mesa 7.1 + DEPRECATED - Support removed in Mesa 10.1. Version diff --git a/mesalib/docs/specs/WL_create_wayland_buffer_from_image.spec b/mesalib/docs/specs/WL_create_wayland_buffer_from_image.spec new file mode 100644 index 000000000..aa5eb4d24 --- /dev/null +++ b/mesalib/docs/specs/WL_create_wayland_buffer_from_image.spec @@ -0,0 +1,101 @@ +Name + + WL_create_wayland_buffer_from_image + +Name Strings + + EGL_WL_create_wayland_buffer_from_image + +Contributors + + Neil Roberts + Axel Davy + Daniel Stone + +Contact + + Neil Roberts <neil.s.roberts@intel.com> + +Status + + Proposal + +Version + + Version 2, October 25, 2013 + +Number + + EGL Extension #not assigned + +Dependencies + + Requires EGL 1.4 or later. This extension is written against the + wording of the EGL 1.4 specification. + + EGL_KHR_base_image is required. + +Overview + + This extension provides an entry point to create a wl_buffer which shares + its contents with a given EGLImage. The expected use case for this is in a + nested Wayland compositor which is using subsurfaces to present buffers + from its clients. Using this extension it can attach the client buffers + directly to the subsurface without having to blit the contents into an + intermediate buffer. The compositing can then be done in the parent + compositor. + + The nested compositor can create an EGLImage from a client buffer resource + using the existing WL_bind_wayland_display extension. It should also be + possible to create buffers using other types of images although there is + no expected use case for that. + +IP Status + + Open-source; freely implementable. + +New Procedures and Functions + + struct wl_buffer *eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, + EGLImageKHR image); + +New Tokens + + None. + +Additions to the EGL 1.4 Specification: + + To create a client-side wl_buffer from an EGLImage call + + struct wl_buffer *eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, + EGLImageKHR image); + + The returned buffer will share the contents with the given EGLImage. Any + updates to the image will also be updated in the wl_buffer. Typically the + EGLImage will be generated in a nested Wayland compositor using a buffer + resource from a client via the EGL_WL_bind_wayland_display extension. + + If there was an error then the function will return NULL. In particular it + will generate EGL_BAD_MATCH if the implementation is not able to represent + the image as a wl_buffer. The possible reasons for this error are + implementation-dependant but may include problems such as an unsupported + format or tiling mode or that the buffer is in memory that is inaccessible + to the GPU that the given EGLDisplay is using. + +Issues + + 1) Under what circumstances can the EGL_BAD_MATCH error be generated? Does + this include for example unsupported tiling modes? + + RESOLVED: Yes, the EGL_BAD_MATCH error can be generated for any reason + which prevents the implementation from representing the image as a + wl_buffer. For example, these problems can be but are not limited to + unsupported tiling modes, inaccessible memory or an unsupported pixel + format. + +Revision History + + Version 1, September 6, 2013 + Initial draft (Neil Roberts) + Version 2, October 25, 2013 + Added a note about more possible reasons for returning EGL_BAD_FORMAT. diff --git a/mesalib/docs/vmware-guest.html b/mesalib/docs/vmware-guest.html index b5f136f33..833f06ceb 100644 --- a/mesalib/docs/vmware-guest.html +++ b/mesalib/docs/vmware-guest.html @@ -134,7 +134,7 @@ As before, if you're on a 32-bit system, you should skip the --libdir configure option. <pre> cd $TOP/mesa - ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa + ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa --disable-dri3 make sudo make install </pre> diff --git a/mesalib/include/EGL/eglmesaext.h b/mesalib/include/EGL/eglmesaext.h index 1f07d4cde..14fb07a71 100644 --- a/mesalib/include/EGL/eglmesaext.h +++ b/mesalib/include/EGL/eglmesaext.h @@ -134,6 +134,16 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, st #endif +#ifndef EGL_WL_create_wayland_buffer_from_image +#define EGL_WL_create_wayland_buffer_from_image 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); +#endif +typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); + +#endif + #ifndef EGL_NOK_swap_region #define EGL_NOK_swap_region 1 diff --git a/mesalib/include/GL/gl.h b/mesalib/include/GL/gl.h index b484b96ce..48343f65d 100644 --- a/mesalib/include/GL/gl.h +++ b/mesalib/include/GL/gl.h @@ -2078,39 +2078,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh #endif /* GL_MESA_packed_depth_stencil */ -#ifndef GL_MESA_texture_array -#define GL_MESA_texture_array 1 - -/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array. - */ -#ifndef GL_EXT_texture_array - -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif /* GL_GLEXT_PROTOTYPES */ - -#if 0 -/* (temporarily) disabled because of collision with typedef in glext.h - * that happens if apps include both gl.h and glext.h - */ -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, - GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#endif - -#endif - - #ifndef GL_ATI_blend_equation_separate #define GL_ATI_blend_equation_separate 1 diff --git a/mesalib/include/GL/glext.h b/mesalib/include/GL/glext.h index fea9e1f57..7d6033e10 100644 --- a/mesalib/include/GL/glext.h +++ b/mesalib/include/GL/glext.h @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 23422 $ on $Date: 2013-10-08 15:40:45 -0700 (Tue, 08 Oct 2013) $ +** Khronos $Revision: 24502 $ on $Date: 2013-12-12 13:14:39 -0800 (Thu, 12 Dec 2013) $ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -53,7 +53,7 @@ extern "C" { #define GLAPI extern #endif -#define GL_GLEXT_VERSION 20131008 +#define GL_GLEXT_VERSION 20131212 /* Generated C header for: * API: gl @@ -1477,7 +1477,7 @@ typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); @@ -1497,7 +1497,7 @@ GLAPI GLboolean APIENTRY glIsSync (GLsync sync); GLAPI void APIENTRY glDeleteSync (GLsync sync); GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); @@ -2144,6 +2144,10 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data) #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); @@ -4836,6 +4840,20 @@ GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); #endif #endif /* GL_AMD_name_gen_delete */ +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); +#endif +#endif /* GL_AMD_occlusion_query_event */ + #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 @@ -5900,6 +5918,34 @@ GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); #endif #endif /* GL_EXT_cull_vertex */ +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_EXT_debug_label */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPopGroupMarkerEXT (void); +#endif +#endif /* GL_EXT_debug_marker */ + #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 @@ -6135,7 +6181,7 @@ typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintp typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); @@ -6391,7 +6437,7 @@ GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, G GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); @@ -8041,6 +8087,10 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG #define GL_INTERLACE_READ_INGR 0x8568 #endif /* GL_INGR_interlace_read */ +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 +#endif /* GL_INTEL_fragment_shader_ordering */ + #ifndef GL_INTEL_map_texture #define GL_INTEL_map_texture 1 #define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF @@ -8214,9 +8264,9 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #ifndef GL_NV_blend_equation_advanced #define GL_NV_blend_equation_advanced 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 #define GL_COLORBURN_NV 0x929A #define GL_COLORDODGE_NV 0x9299 #define GL_CONJOINT_NV 0x9284 @@ -8230,6 +8280,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_DST_OUT_NV 0x928D #define GL_DST_OVER_NV 0x9289 #define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 #define GL_HARDLIGHT_NV 0x929B #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_COLOR_NV 0x92AF @@ -8251,6 +8302,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_DARKER_NV 0x9292 #define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 #define GL_SCREEN_NV 0x9295 #define GL_SOFTLIGHT_NV 0x929C #define GL_SRC_ATOP_NV 0x928E @@ -8260,6 +8312,7 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_SRC_OVER_NV 0x9288 #define GL_UNCORRELATED_NV 0x9282 #define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES @@ -8270,6 +8323,7 @@ GLAPI void APIENTRY glBlendBarrierNV (void); #ifndef GL_NV_blend_equation_advanced_coherent #define GL_NV_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #endif /* GL_NV_blend_equation_advanced_coherent */ #ifndef GL_NV_blend_square diff --git a/mesalib/include/GL/internal/dri_interface.h b/mesalib/include/GL/internal/dri_interface.h index b012570ae..81f7e60e5 100644 --- a/mesalib/include/GL/internal/dri_interface.h +++ b/mesalib/include/GL/internal/dri_interface.h @@ -437,7 +437,7 @@ struct __DRIdamageExtensionRec { * SWRast Loader extension. */ #define __DRI_SWRAST_LOADER "DRI_SWRastLoader" -#define __DRI_SWRAST_LOADER_VERSION 1 +#define __DRI_SWRAST_LOADER_VERSION 2 struct __DRIswrastLoaderExtensionRec { __DRIextension base; @@ -461,6 +461,13 @@ struct __DRIswrastLoaderExtensionRec { void (*getImage)(__DRIdrawable *readable, int x, int y, int width, int height, char *data, void *loaderPrivate); + + /** + * Put image to drawable + */ + void (*putImage2)(__DRIdrawable *drawable, int op, + int x, int y, int width, int height, int stride, + char *data, void *loaderPrivate); }; /** diff --git a/mesalib/include/HaikuGL/GLRenderer.h b/mesalib/include/HaikuGL/GLRenderer.h new file mode 100644 index 000000000..7ffcc34bb --- /dev/null +++ b/mesalib/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 <BeBuild.h> +#include <GLView.h> + + +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/mesalib/include/HaikuGL/GLView.h b/mesalib/include/HaikuGL/GLView.h new file mode 100644 index 000000000..b848578f6 --- /dev/null +++ b/mesalib/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 <GL/gl.h> + +#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 <AppKit.h> +#include <Bitmap.h> +#include <DirectWindow.h> +#include <View.h> +#include <Window.h> +#include <WindowScreen.h> + + +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/mesalib/include/HaikuGL/OpenGLKit.h b/mesalib/include/HaikuGL/OpenGLKit.h new file mode 100644 index 000000000..f4828714c --- /dev/null +++ b/mesalib/include/HaikuGL/OpenGLKit.h @@ -0,0 +1,10 @@ +/* + * Master include file for the Haiku OpenGL Kit. + */ + +#include <GL/gl.h> +#include <GLView.h> + +// 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/mesalib/include/HaikuGL/README b/mesalib/include/HaikuGL/README new file mode 100644 index 000000000..0f8503f08 --- /dev/null +++ b/mesalib/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. diff --git a/mesalib/m4/ax_check_compile_flag.m4 b/mesalib/m4/ax_check_compile_flag.m4 new file mode 100644 index 000000000..c3a8d695a --- /dev/null +++ b/mesalib/m4/ax_check_compile_flag.m4 @@ -0,0 +1,72 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 2 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c index b95cbab12..9246bd722 100644 --- a/mesalib/src/gallium/auxiliary/util/u_blitter.c +++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c @@ -51,6 +51,12 @@ #define INVALID_PTR ((void*)~0) +#define GET_CLEAR_BLEND_STATE_IDX(clear_buffers) \ + ((clear_buffers) / PIPE_CLEAR_COLOR0) + +#define NUM_RESOLVE_FRAG_SHADERS 5 /* MSAA 2x, 4x, 8x, 16x, 32x */ +#define GET_MSAA_RESOLVE_FS_IDX(nr_samples) (util_logbase2(nr_samples)-1) + struct blitter_context_priv { struct blitter_context base; @@ -65,6 +71,7 @@ struct blitter_context_priv /* Vertex shaders. */ void *vs; /**< Vertex shader which passes {pos, generic} to the output.*/ void *vs_pos_only; /**< Vertex shader which passes pos to the output.*/ + void *vs_layered; /**< Vertex shader which sets LAYER = INSTANCEID. */ /* Fragment shaders. */ void *fs_empty; @@ -87,8 +94,14 @@ struct blitter_context_priv void *fs_texfetch_depthstencil_msaa[PIPE_MAX_TEXTURE_TYPES]; void *fs_texfetch_stencil_msaa[PIPE_MAX_TEXTURE_TYPES]; + /* FS which outputs an average of all samples. */ + void *fs_resolve[PIPE_MAX_TEXTURE_TYPES][NUM_RESOLVE_FRAG_SHADERS][2]; + void *fs_resolve_sint[PIPE_MAX_TEXTURE_TYPES][NUM_RESOLVE_FRAG_SHADERS][2]; + void *fs_resolve_uint[PIPE_MAX_TEXTURE_TYPES][NUM_RESOLVE_FRAG_SHADERS][2]; + /* Blend state. */ void *blend[PIPE_MASK_RGBA+1]; /**< blend state with writemask */ + void *blend_clear[GET_CLEAR_BLEND_STATE_IDX(PIPE_CLEAR_COLOR)+1]; /* Depth stencil alpha state. */ void *dsa_write_depth_stencil; @@ -295,6 +308,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) util_make_vertex_passthrough_shader(pipe, 2, semantic_names, semantic_indices); } + if (ctx->has_stream_out) { struct pipe_stream_output_info so; const uint semantic_names[] = { TGSI_SEMANTIC_POSITION }; @@ -310,6 +324,11 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) semantic_indices, &so); } + if (pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_INSTANCEID) && + pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_VS_LAYER)) { + ctx->vs_layered = util_make_layered_clear_vertex_shader(pipe); + } + /* set invariant vertex coordinates */ for (i = 0; i < 4; i++) ctx->vertices[i][0][3] = 1; /*v.w*/ @@ -323,11 +342,15 @@ void util_blitter_destroy(struct blitter_context *blitter) { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = blitter->pipe; - int i; + int i, j, f; for (i = 0; i <= PIPE_MASK_RGBA; i++) { pipe->delete_blend_state(pipe, ctx->blend[i]); } + for (i = 0; i < Elements(ctx->blend_clear); i++) { + if (ctx->blend_clear[i]) + pipe->delete_blend_state(pipe, ctx->blend_clear[i]); + } pipe->delete_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); pipe->delete_depth_stencil_alpha_state(pipe, ctx->dsa_write_depth_keep_stencil); @@ -357,7 +380,23 @@ void util_blitter_destroy(struct blitter_context *blitter) ctx->delete_fs_state(pipe, ctx->fs_texfetch_depthstencil[i]); if (ctx->fs_texfetch_stencil[i]) ctx->delete_fs_state(pipe, ctx->fs_texfetch_stencil[i]); + + for (j = 0; j< Elements(ctx->fs_resolve[i]); j++) + for (f = 0; f < 2; f++) + if (ctx->fs_resolve[i][j][f]) + ctx->delete_fs_state(pipe, ctx->fs_resolve[i][j][f]); + + for (j = 0; j< Elements(ctx->fs_resolve_sint[i]); j++) + for (f = 0; f < 2; f++) + if (ctx->fs_resolve_sint[i][j][f]) + ctx->delete_fs_state(pipe, ctx->fs_resolve_sint[i][j][f]); + + for (j = 0; j< Elements(ctx->fs_resolve_uint[i]); j++) + for (f = 0; f < 2; f++) + if (ctx->fs_resolve_uint[i][j][f]) + ctx->delete_fs_state(pipe, ctx->fs_resolve_uint[i][j][f]); } + ctx->delete_fs_state(pipe, ctx->fs_empty); ctx->delete_fs_state(pipe, ctx->fs_write_one_cbuf); ctx->delete_fs_state(pipe, ctx->fs_write_all_cbufs); @@ -711,22 +750,60 @@ static void blitter_set_dst_dimensions(struct blitter_context_priv *ctx, } static void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx, + enum pipe_format format, enum pipe_texture_target target, - unsigned nr_samples) + unsigned src_nr_samples, + unsigned dst_nr_samples, + unsigned filter) { struct pipe_context *pipe = ctx->base.pipe; + unsigned tgsi_tex = util_pipe_tex_to_tgsi_tex(target, src_nr_samples); assert(target < PIPE_MAX_TEXTURE_TYPES); - if (nr_samples > 1) { - void **shader = &ctx->fs_texfetch_col_msaa[target]; + if (src_nr_samples > 1) { + void **shader; - /* Create the fragment shader on-demand. */ - if (!*shader) { - unsigned tgsi_tex = util_pipe_tex_to_tgsi_tex(target, - nr_samples); + if (dst_nr_samples <= 1) { + /* The destination has one sample, so we'll do color resolve. */ + boolean is_uint, is_sint; + unsigned index = GET_MSAA_RESOLVE_FS_IDX(src_nr_samples); - *shader = util_make_fs_blit_msaa_color(pipe, tgsi_tex); + is_uint = util_format_is_pure_uint(format); + is_sint = util_format_is_pure_sint(format); + + assert(filter < 2); + + if (is_uint) + shader = &ctx->fs_resolve_uint[target][index][filter]; + else if (is_sint) + shader = &ctx->fs_resolve_sint[target][index][filter]; + else + shader = &ctx->fs_resolve[target][index][filter]; + + if (!*shader) { + if (filter == PIPE_TEX_FILTER_LINEAR) { + *shader = util_make_fs_msaa_resolve_bilinear(pipe, tgsi_tex, + src_nr_samples, + is_uint, is_sint); + } + else { + *shader = util_make_fs_msaa_resolve(pipe, tgsi_tex, + src_nr_samples, + is_uint, is_sint); + } + } + } + else { + /* The destination has multiple samples, we'll do + * an MSAA->MSAA copy. + */ + shader = &ctx->fs_texfetch_col_msaa[target]; + + /* Create the fragment shader on-demand. */ + if (!*shader) { + *shader = util_make_fs_blit_msaa_color(pipe, tgsi_tex); + } } return *shader; @@ -735,11 +812,8 @@ static void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx, /* Create the fragment shader on-demand. */ if (!*shader) { - unsigned tgsi_tex = util_pipe_tex_to_tgsi_tex(target, 0); - - *shader = - util_make_fragment_tex_shader(pipe, tgsi_tex, - TGSI_INTERPOLATE_LINEAR); + *shader = util_make_fragment_tex_shader(pipe, tgsi_tex, + TGSI_INTERPOLATE_LINEAR); } return *shader; @@ -864,7 +938,7 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter) { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_screen *screen = blitter->pipe->screen; - unsigned i, target, max_samples; + unsigned samples, j, f, target, max_samples; boolean has_arraytex, has_cubearraytex; max_samples = ctx->has_texture_multisample ? 2 : 1; @@ -874,7 +948,7 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter) PIPE_CAP_CUBE_MAP_ARRAY) != 0; /* It only matters if i <= 1 or > 1. */ - for (i = 1; i <= max_samples; i++) { + for (samples = 1; samples <= max_samples; samples++) { for (target = PIPE_TEXTURE_1D; target < PIPE_MAX_TEXTURE_TYPES; target++) { if (!has_arraytex && (target == PIPE_TEXTURE_1D_ARRAY || @@ -885,29 +959,55 @@ void util_blitter_cache_all_shaders(struct blitter_context *blitter) (target == PIPE_TEXTURE_CUBE_ARRAY)) continue; - if (i > 1 && + if (samples > 1 && (target != PIPE_TEXTURE_2D && target != PIPE_TEXTURE_2D_ARRAY)) continue; - blitter_get_fs_texfetch_col(ctx, target, i); - blitter_get_fs_texfetch_depth(ctx, target, i); + /* If samples == 1, the shaders read one texel. If samples >= 1, + * they read one sample. + */ + blitter_get_fs_texfetch_col(ctx, PIPE_FORMAT_R32_FLOAT, target, + samples, samples, 0); + blitter_get_fs_texfetch_depth(ctx, target, samples); if (ctx->has_stencil_export) { - blitter_get_fs_texfetch_depthstencil(ctx, target, i); - blitter_get_fs_texfetch_stencil(ctx, target, i); + blitter_get_fs_texfetch_depthstencil(ctx, target, samples); + blitter_get_fs_texfetch_stencil(ctx, target, samples); + } + + if (samples == 1) + continue; + + /* MSAA resolve shaders. */ + for (j = 2; j < 32; j++) { + if (!screen->is_format_supported(screen, PIPE_FORMAT_R32_FLOAT, + target, j, + PIPE_BIND_SAMPLER_VIEW)) { + continue; + } + + for (f = 0; f < 2; f++) { + blitter_get_fs_texfetch_col(ctx, PIPE_FORMAT_R32_FLOAT, target, + j, 1, f); + blitter_get_fs_texfetch_col(ctx, PIPE_FORMAT_R32_UINT, target, + j, 1, f); + blitter_get_fs_texfetch_col(ctx, PIPE_FORMAT_R32_SINT, target, + j, 1, f); + } } } } } static void blitter_set_common_draw_rect_state(struct blitter_context_priv *ctx, - boolean scissor) + boolean scissor, + boolean vs_layered) { struct pipe_context *pipe = ctx->base.pipe; pipe->bind_rasterizer_state(pipe, scissor ? ctx->rs_state_scissor : ctx->rs_state); - pipe->bind_vs_state(pipe, ctx->vs); + pipe->bind_vs_state(pipe, vs_layered ? ctx->vs_layered : ctx->vs); if (ctx->has_geometry_shader) pipe->bind_gs_state(pipe, NULL); if (ctx->has_stream_out) @@ -915,19 +1015,24 @@ static void blitter_set_common_draw_rect_state(struct blitter_context_priv *ctx, } static void blitter_draw(struct blitter_context_priv *ctx, - int x1, int y1, int x2, int y2, float depth) + int x1, int y1, int x2, int y2, float depth, + unsigned num_instances) { - struct pipe_resource *buf = NULL; - unsigned offset = 0; + struct pipe_context *pipe = ctx->base.pipe; + struct pipe_vertex_buffer vb = {0}; blitter_set_rectangle(ctx, x1, y1, x2, y2, depth); + vb.stride = 8 * sizeof(float); + u_upload_data(ctx->upload, 0, sizeof(ctx->vertices), ctx->vertices, - &offset, &buf); + &vb.buffer_offset, &vb.buffer); u_upload_unmap(ctx->upload); - util_draw_vertex_buffer(ctx->base.pipe, NULL, buf, ctx->base.vb_slot, - offset, PIPE_PRIM_TRIANGLE_FAN, 4, 2); - pipe_resource_reference(&buf, NULL); + + pipe->set_vertex_buffers(pipe, ctx->base.vb_slot, 1, &vb); + util_draw_arrays_instanced(pipe, PIPE_PRIM_TRIANGLE_FAN, 0, 4, + 0, num_instances); + pipe_resource_reference(&vb.buffer, NULL); } void util_blitter_draw_rectangle(struct blitter_context *blitter, @@ -949,11 +1054,47 @@ void util_blitter_draw_rectangle(struct blitter_context *blitter, default:; } - blitter_draw(ctx, x1, y1, x2, y2, depth); + blitter_draw(ctx, x1, y1, x2, y2, depth, 1); +} + +static void *get_clear_blend_state(struct blitter_context_priv *ctx, + unsigned clear_buffers) +{ + struct pipe_context *pipe = ctx->base.pipe; + int index; + + clear_buffers &= PIPE_CLEAR_COLOR; + + /* Return an existing blend state. */ + if (!clear_buffers) + return ctx->blend[0]; + + index = GET_CLEAR_BLEND_STATE_IDX(clear_buffers); + + if (ctx->blend_clear[index]) + return ctx->blend_clear[index]; + + /* Create a new one. */ + { + struct pipe_blend_state blend = {0}; + unsigned i; + + blend.independent_blend_enable = 1; + + for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { + if (clear_buffers & (PIPE_CLEAR_COLOR0 << i)) { + blend.rt[i].colormask = PIPE_MASK_RGBA; + } + } + + ctx->blend_clear[index] = pipe->create_blend_state(pipe, &blend); + } + return ctx->blend_clear[index]; } static void util_blitter_clear_custom(struct blitter_context *blitter, unsigned width, unsigned height, + unsigned num_layers, unsigned clear_buffers, const union pipe_color_union *color, double depth, unsigned stencil, @@ -963,6 +1104,8 @@ static void util_blitter_clear_custom(struct blitter_context *blitter, struct pipe_context *pipe = ctx->base.pipe; struct pipe_stencil_ref sr = { { 0 } }; + assert(ctx->vs_layered || num_layers <= 1); + blitter_set_running_flag(ctx); blitter_check_saved_vertex_states(ctx); blitter_check_saved_fragment_states(ctx); @@ -971,10 +1114,8 @@ static void util_blitter_clear_custom(struct blitter_context *blitter, /* bind states */ if (custom_blend) { pipe->bind_blend_state(pipe, custom_blend); - } else if (clear_buffers & PIPE_CLEAR_COLOR) { - pipe->bind_blend_state(pipe, ctx->blend[PIPE_MASK_RGBA]); } else { - pipe->bind_blend_state(pipe, ctx->blend[0]); + pipe->bind_blend_state(pipe, get_clear_blend_state(ctx, clear_buffers)); } if (custom_dsa) { @@ -996,10 +1137,18 @@ static void util_blitter_clear_custom(struct blitter_context *blitter, ctx->bind_fs_state(pipe, ctx->fs_write_all_cbufs); pipe->set_sample_mask(pipe, ~0); - blitter_set_common_draw_rect_state(ctx, FALSE); blitter_set_dst_dimensions(ctx, width, height); - blitter->draw_rectangle(blitter, 0, 0, width, height, (float) depth, - UTIL_BLITTER_ATTRIB_COLOR, color); + + if (num_layers > 1 && ctx->vs_layered) { + blitter_set_common_draw_rect_state(ctx, FALSE, TRUE); + blitter_set_clear_color(ctx, color); + blitter_draw(ctx, 0, 0, width, height, depth, num_layers); + } + else { + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); + blitter->draw_rectangle(blitter, 0, 0, width, height, (float) depth, + UTIL_BLITTER_ATTRIB_COLOR, color); + } blitter_restore_vertex_states(ctx); blitter_restore_fragment_states(ctx); @@ -1008,12 +1157,12 @@ static void util_blitter_clear_custom(struct blitter_context *blitter, } void util_blitter_clear(struct blitter_context *blitter, - unsigned width, unsigned height, + unsigned width, unsigned height, unsigned num_layers, unsigned clear_buffers, const union pipe_color_union *color, double depth, unsigned stencil) { - util_blitter_clear_custom(blitter, width, height, + util_blitter_clear_custom(blitter, width, height, num_layers, clear_buffers, color, depth, stencil, NULL, NULL); } @@ -1023,7 +1172,7 @@ void util_blitter_custom_clear_depth(struct blitter_context *blitter, double depth, void *custom_dsa) { static const union pipe_color_union color; - util_blitter_clear_custom(blitter, width, height, 0, &color, depth, 0, + util_blitter_clear_custom(blitter, width, height, 0, 0, &color, depth, 0, NULL, custom_dsa); } @@ -1137,11 +1286,10 @@ static boolean is_blit_generic_supported(struct blitter_context *blitter, boolean util_blitter_is_copy_supported(struct blitter_context *blitter, const struct pipe_resource *dst, - const struct pipe_resource *src, - unsigned mask) + const struct pipe_resource *src) { return is_blit_generic_supported(blitter, dst, dst->format, - src, src->format, mask); + src, src->format, PIPE_MASK_RGBAZS); } boolean util_blitter_is_blit_supported(struct blitter_context *blitter, @@ -1159,8 +1307,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter, unsigned dstx, unsigned dsty, unsigned dstz, struct pipe_resource *src, unsigned src_level, - const struct pipe_box *srcbox, unsigned mask, - boolean copy_all_samples) + const struct pipe_box *srcbox) { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; @@ -1185,8 +1332,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter, /* Copy. */ util_blitter_blit_generic(blitter, dst_view, &dstbox, src_view, srcbox, src->width0, src->height0, - mask, PIPE_TEX_FILTER_NEAREST, NULL, - copy_all_samples); + PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL); pipe_surface_reference(&dst_view, NULL); pipe_sampler_view_reference(&src_view, NULL); @@ -1199,14 +1345,14 @@ void util_blitter_blit_generic(struct blitter_context *blitter, const struct pipe_box *srcbox, unsigned src_width0, unsigned src_height0, unsigned mask, unsigned filter, - const struct pipe_scissor_state *scissor, - boolean copy_all_samples) + const struct pipe_scissor_state *scissor) { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; struct pipe_framebuffer_state fb_state; enum pipe_texture_target src_target = src->texture->target; unsigned src_samples = src->texture->nr_samples; + unsigned dst_samples = dst->texture->nr_samples; boolean has_depth, has_stencil, has_color; boolean blit_stencil, blit_depth, blit_color; void *sampler_state; @@ -1231,6 +1377,12 @@ void util_blitter_blit_generic(struct blitter_context *blitter, return; } + if (blit_stencil || + (dstbox->width == abs(srcbox->width) && + dstbox->height == abs(srcbox->height))) { + filter = PIPE_TEX_FILTER_NEAREST; + } + /* Check whether the states are properly saved. */ blitter_set_running_flag(ctx); blitter_check_saved_vertex_states(ctx); @@ -1273,16 +1425,12 @@ void util_blitter_blit_generic(struct blitter_context *blitter, pipe->bind_blend_state(pipe, ctx->blend[mask & PIPE_MASK_RGBA]); pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); ctx->bind_fs_state(pipe, - blitter_get_fs_texfetch_col(ctx, src_target, - src_samples)); + blitter_get_fs_texfetch_col(ctx, src->format, src_target, + src_samples, dst_samples, filter)); } /* Set the linear filter only for scaled color non-MSAA blits. */ - if (filter == PIPE_TEX_FILTER_LINEAR && - !blit_depth && !blit_stencil && - src_samples <= 1 && - (dstbox->width != abs(srcbox->width) || - dstbox->height != abs(srcbox->height))) { + if (filter == PIPE_TEX_FILTER_LINEAR) { if (src_target == PIPE_TEXTURE_RECT) { sampler_state = ctx->sampler_state_rect_linear; } else { @@ -1341,7 +1489,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter, pipe->set_scissor_states(pipe, 0, 1, scissor); } - blitter_set_common_draw_rect_state(ctx, scissor != NULL); + blitter_set_common_draw_rect_state(ctx, scissor != NULL, FALSE); blitter_set_dst_dimensions(ctx, dst->width, dst->height); if ((src_target == PIPE_TEXTURE_1D || @@ -1388,10 +1536,9 @@ void util_blitter_blit_generic(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); /* See if we need to blit a multisample or singlesample buffer. */ - if (copy_all_samples && - src_samples == dst->texture->nr_samples && - dst->texture->nr_samples > 1) { - unsigned i, max_sample = MAX2(dst->texture->nr_samples, 1) - 1; + if (src_samples == dst_samples && dst_samples > 1) { + /* MSAA copy. */ + unsigned i, max_sample = dst_samples - 1; for (i = 0; i <= max_sample; i++) { pipe->set_sample_mask(pipe, 1 << i); @@ -1402,9 +1549,10 @@ void util_blitter_blit_generic(struct blitter_context *blitter, srcbox->y + srcbox->height); blitter_draw(ctx, dstbox->x, dstbox->y, dstbox->x + dstbox->width, - dstbox->y + dstbox->height, 0); + dstbox->y + dstbox->height, 0, 1); } } else { + /* Normal copy, MSAA upsampling, or MSAA resolve. */ pipe->set_sample_mask(pipe, ~0); blitter_set_texcoords(ctx, src, src_width0, src_height0, srcbox->z + z, 0, @@ -1413,7 +1561,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter, srcbox->y + srcbox->height); blitter_draw(ctx, dstbox->x, dstbox->y, dstbox->x + dstbox->width, - dstbox->y + dstbox->height, 0); + dstbox->y + dstbox->height, 0, 1); } /* Get the next surface or (if this is the last iteration) @@ -1465,7 +1613,7 @@ util_blitter_blit(struct blitter_context *blitter, util_blitter_blit_generic(blitter, dst_view, &info->dst.box, src_view, &info->src.box, src->width0, src->height0, info->mask, info->filter, - info->scissor_enable ? &info->scissor : NULL, TRUE); + info->scissor_enable ? &info->scissor : NULL); pipe_surface_reference(&dst_view, NULL); pipe_sampler_view_reference(&src_view, NULL); @@ -1508,7 +1656,7 @@ void util_blitter_clear_render_target(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); pipe->set_sample_mask(pipe, ~0); - blitter_set_common_draw_rect_state(ctx, FALSE); + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height); blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height, 0, UTIL_BLITTER_ATTRIB_COLOR, color); @@ -1576,7 +1724,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); pipe->set_sample_mask(pipe, ~0); - blitter_set_common_draw_rect_state(ctx, FALSE); + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height); blitter->draw_rectangle(blitter, dstx, dsty, dstx+width, dsty+height, (float) depth, @@ -1633,7 +1781,7 @@ void util_blitter_custom_depth_stencil(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); pipe->set_sample_mask(pipe, sample_mask); - blitter_set_common_draw_rect_state(ctx, FALSE); + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); blitter_set_dst_dimensions(ctx, zsurf->width, zsurf->height); blitter->draw_rectangle(blitter, 0, 0, zsurf->width, zsurf->height, depth, UTIL_BLITTER_ATTRIB_NONE, NULL); @@ -1818,7 +1966,7 @@ void util_blitter_custom_resolve_color(struct blitter_context *blitter, fb_state.zsbuf = NULL; pipe->set_framebuffer_state(pipe, &fb_state); - blitter_set_common_draw_rect_state(ctx, FALSE); + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); blitter_set_dst_dimensions(ctx, src->width0, src->height0); blitter->draw_rectangle(blitter, 0, 0, src->width0, src->height0, 0, 0, NULL); @@ -1868,7 +2016,7 @@ void util_blitter_custom_color(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); pipe->set_sample_mask(pipe, ~0); - blitter_set_common_draw_rect_state(ctx, FALSE); + blitter_set_common_draw_rect_state(ctx, FALSE, FALSE); blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height); blitter->draw_rectangle(blitter, 0, 0, dstsurf->width, dstsurf->height, 0, 0, NULL); diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.h b/mesalib/src/gallium/auxiliary/util/u_blitter.h index d9cefde50..a30cdc36a 100644 --- a/mesalib/src/gallium/auxiliary/util/u_blitter.h +++ b/mesalib/src/gallium/auxiliary/util/u_blitter.h @@ -183,7 +183,7 @@ void util_blitter_draw_rectangle(struct blitter_context *blitter, * - blend state */ void util_blitter_clear(struct blitter_context *blitter, - unsigned width, unsigned height, + unsigned width, unsigned height, unsigned num_layers, unsigned clear_buffers, const union pipe_color_union *color, double depth, unsigned stencil); @@ -191,13 +191,10 @@ void util_blitter_clear(struct blitter_context *blitter, /** * Check if the blitter (with the help of the driver) can blit between * the two resources. - * The mask is a combination of the PIPE_MASK_* flags. - * Set to PIPE_MASK_RGBAZS if unsure. */ boolean util_blitter_is_copy_supported(struct blitter_context *blitter, const struct pipe_resource *dst, - const struct pipe_resource *src, - unsigned mask); + const struct pipe_resource *src); boolean util_blitter_is_blit_supported(struct blitter_context *blitter, const struct pipe_blit_info *info); @@ -221,8 +218,7 @@ void util_blitter_copy_texture(struct blitter_context *blitter, unsigned dstx, unsigned dsty, unsigned dstz, struct pipe_resource *src, unsigned src_level, - const struct pipe_box *srcbox, unsigned mask, - boolean copy_all_samples); + const struct pipe_box *srcbox); /** * This is a generic implementation of pipe->blit, which accepts @@ -250,8 +246,7 @@ void util_blitter_blit_generic(struct blitter_context *blitter, const struct pipe_box *srcbox, unsigned src_width0, unsigned src_height0, unsigned mask, unsigned filter, - const struct pipe_scissor_state *scissor, - boolean copy_all_samples); + const struct pipe_scissor_state *scissor); void util_blitter_blit(struct blitter_context *blitter, const struct pipe_blit_info *info); diff --git a/mesalib/src/gallium/auxiliary/util/u_clear.h b/mesalib/src/gallium/auxiliary/util/u_clear.h index e9fd874b1..75047c16b 100644 --- a/mesalib/src/gallium/auxiliary/util/u_clear.h +++ b/mesalib/src/gallium/auxiliary/util/u_clear.h @@ -42,9 +42,10 @@ util_clear(struct pipe_context *pipe, struct pipe_framebuffer_state *framebuffer, unsigned buffers, const union pipe_color_union *color, double depth, unsigned stencil) { - if (buffers & PIPE_CLEAR_COLOR) { - unsigned i; - for (i = 0; i < framebuffer->nr_cbufs; i++) { + unsigned i; + + for (i = 0; i < framebuffer->nr_cbufs; i++) { + if (buffers & (PIPE_CLEAR_COLOR0 << i)) { struct pipe_surface *ps = framebuffer->cbufs[i]; pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width, ps->height); } diff --git a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c index f84485d1f..683967237 100644 --- a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c +++ b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c @@ -147,3 +147,27 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb, return TRUE; } } + + +/** + * Return the number of layers set in the framebuffer state. + */ +unsigned +util_framebuffer_get_num_layers(const struct pipe_framebuffer_state *fb) +{ + unsigned i, num_layers = 0; + + for (i = 0; i < fb->nr_cbufs; i++) { + if (fb->cbufs[i]) { + unsigned num = fb->cbufs[i]->u.tex.last_layer - + fb->cbufs[i]->u.tex.first_layer + 1; + num_layers = MAX2(num_layers, num); + } + } + if (fb->zsbuf) { + unsigned num = fb->zsbuf->u.tex.last_layer - + fb->zsbuf->u.tex.first_layer + 1; + num_layers = MAX2(num_layers, num); + } + return num_layers; +} diff --git a/mesalib/src/gallium/auxiliary/util/u_framebuffer.h b/mesalib/src/gallium/auxiliary/util/u_framebuffer.h index a89066230..0e6c98363 100644 --- a/mesalib/src/gallium/auxiliary/util/u_framebuffer.h +++ b/mesalib/src/gallium/auxiliary/util/u_framebuffer.h @@ -55,6 +55,11 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb, unsigned *width, unsigned *height); + +extern unsigned +util_framebuffer_get_num_layers(const struct pipe_framebuffer_state *fb); + + #ifdef __cplusplus } #endif diff --git a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c index c93d75469..82f23ebec 100644 --- a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.c @@ -99,6 +99,32 @@ util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe, } +void *util_make_layered_clear_vertex_shader(struct pipe_context *pipe) +{ + static const char text[] = + "VERT\n" + "DCL IN[0]\n" + "DCL IN[1]\n" + "DCL SV[0], INSTANCEID\n" + "DCL OUT[0], POSITION\n" + "DCL OUT[1], GENERIC[0]\n" + "DCL OUT[2], LAYER\n" + + "MOV OUT[0], IN[0]\n" + "MOV OUT[1], IN[1]\n" + "MOV OUT[2], SV[0]\n" + "END\n"; + struct tgsi_token tokens[1000]; + struct pipe_shader_state state = {tokens}; + + if (!tgsi_text_translate(text, tokens, Elements(tokens))) { + assert(0); + return NULL; + } + return pipe->create_vs_state(pipe, &state); +} + + /** * Make simple fragment texture shader: * IMM {0,0,0,1} // (if writemask != 0xf) @@ -527,3 +553,157 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe, return pipe->create_fs_state(pipe, &state); } + + +void * +util_make_fs_msaa_resolve(struct pipe_context *pipe, + unsigned tgsi_tex, unsigned nr_samples, + boolean is_uint, boolean is_sint) +{ + struct ureg_program *ureg; + struct ureg_src sampler, coord; + struct ureg_dst out, tmp_sum, tmp_coord, tmp; + int i; + + ureg = ureg_create(TGSI_PROCESSOR_FRAGMENT); + if (!ureg) + return NULL; + + /* Declarations. */ + sampler = ureg_DECL_sampler(ureg, 0); + coord = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_GENERIC, 0, + TGSI_INTERPOLATE_LINEAR); + out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0); + tmp_sum = ureg_DECL_temporary(ureg); + tmp_coord = ureg_DECL_temporary(ureg); + tmp = ureg_DECL_temporary(ureg); + + /* Instructions. */ + ureg_MOV(ureg, tmp_sum, ureg_imm1f(ureg, 0)); + ureg_F2U(ureg, tmp_coord, coord); + + for (i = 0; i < nr_samples; i++) { + /* Read one sample. */ + ureg_MOV(ureg, ureg_writemask(tmp_coord, TGSI_WRITEMASK_W), + ureg_imm1u(ureg, i)); + ureg_TXF(ureg, tmp, tgsi_tex, ureg_src(tmp_coord), sampler); + + if (is_uint) + ureg_U2F(ureg, tmp, ureg_src(tmp)); + else if (is_sint) + ureg_I2F(ureg, tmp, ureg_src(tmp)); + + /* Add it to the sum.*/ + ureg_ADD(ureg, tmp_sum, ureg_src(tmp_sum), ureg_src(tmp)); + } + + /* Calculate the average and return. */ + ureg_MUL(ureg, tmp_sum, ureg_src(tmp_sum), + ureg_imm1f(ureg, 1.0 / nr_samples)); + + if (is_uint) + ureg_F2U(ureg, out, ureg_src(tmp_sum)); + else if (is_sint) + ureg_F2I(ureg, out, ureg_src(tmp_sum)); + else + ureg_MOV(ureg, out, ureg_src(tmp_sum)); + + ureg_END(ureg); + + return ureg_create_shader_and_destroy(ureg, pipe); +} + + +void * +util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe, + unsigned tgsi_tex, unsigned nr_samples, + boolean is_uint, boolean is_sint) +{ + struct ureg_program *ureg; + struct ureg_src sampler, coord; + struct ureg_dst out, tmp, top, bottom; + struct ureg_dst tmp_coord[4], tmp_sum[4]; + int i, c; + + ureg = ureg_create(TGSI_PROCESSOR_FRAGMENT); + if (!ureg) + return NULL; + + /* Declarations. */ + sampler = ureg_DECL_sampler(ureg, 0); + coord = ureg_DECL_fs_input(ureg, TGSI_SEMANTIC_GENERIC, 0, + TGSI_INTERPOLATE_LINEAR); + out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0); + for (c = 0; c < 4; c++) + tmp_sum[c] = ureg_DECL_temporary(ureg); + for (c = 0; c < 4; c++) + tmp_coord[c] = ureg_DECL_temporary(ureg); + tmp = ureg_DECL_temporary(ureg); + top = ureg_DECL_temporary(ureg); + bottom = ureg_DECL_temporary(ureg); + + /* Instructions. */ + for (c = 0; c < 4; c++) + ureg_MOV(ureg, tmp_sum[c], ureg_imm1f(ureg, 0)); + + /* Get 4 texture coordinates for the bilinear filter. */ + ureg_F2U(ureg, tmp_coord[0], coord); /* top-left */ + ureg_UADD(ureg, tmp_coord[1], ureg_src(tmp_coord[0]), + ureg_imm4u(ureg, 1, 0, 0, 0)); /* top-right */ + ureg_UADD(ureg, tmp_coord[2], ureg_src(tmp_coord[0]), + ureg_imm4u(ureg, 0, 1, 0, 0)); /* bottom-left */ + ureg_UADD(ureg, tmp_coord[3], ureg_src(tmp_coord[0]), + ureg_imm4u(ureg, 1, 1, 0, 0)); /* bottom-right */ + + for (i = 0; i < nr_samples; i++) { + for (c = 0; c < 4; c++) { + /* Read one sample. */ + ureg_MOV(ureg, ureg_writemask(tmp_coord[c], TGSI_WRITEMASK_W), + ureg_imm1u(ureg, i)); + ureg_TXF(ureg, tmp, tgsi_tex, ureg_src(tmp_coord[c]), sampler); + + if (is_uint) + ureg_U2F(ureg, tmp, ureg_src(tmp)); + else if (is_sint) + ureg_I2F(ureg, tmp, ureg_src(tmp)); + + /* Add it to the sum.*/ + ureg_ADD(ureg, tmp_sum[c], ureg_src(tmp_sum[c]), ureg_src(tmp)); + } + } + + /* Calculate the average. */ + for (c = 0; c < 4; c++) + ureg_MUL(ureg, tmp_sum[c], ureg_src(tmp_sum[c]), + ureg_imm1f(ureg, 1.0 / nr_samples)); + + /* Take the 4 average values and apply a standard bilinear filter. */ + ureg_FRC(ureg, tmp, coord); + + ureg_LRP(ureg, top, + ureg_scalar(ureg_src(tmp), 0), + ureg_src(tmp_sum[1]), + ureg_src(tmp_sum[0])); + + ureg_LRP(ureg, bottom, + ureg_scalar(ureg_src(tmp), 0), + ureg_src(tmp_sum[3]), + ureg_src(tmp_sum[2])); + + ureg_LRP(ureg, tmp, + ureg_scalar(ureg_src(tmp), 1), + ureg_src(bottom), + ureg_src(top)); + + /* Convert to the texture format and return. */ + if (is_uint) + ureg_F2U(ureg, out, ureg_src(tmp)); + else if (is_sint) + ureg_F2I(ureg, out, ureg_src(tmp)); + else + ureg_MOV(ureg, out, ureg_src(tmp)); + + ureg_END(ureg); + + return ureg_create_shader_and_destroy(ureg, pipe); +} diff --git a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h index 016664d1b..e81d99414 100644 --- a/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h +++ b/mesalib/src/gallium/auxiliary/util/u_simple_shaders.h @@ -56,6 +56,8 @@ util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe, const uint *semantic_indexes, const struct pipe_stream_output_info *so); +extern void * +util_make_layered_clear_vertex_shader(struct pipe_context *pipe); extern void * util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, @@ -122,6 +124,18 @@ void * util_make_fs_blit_msaa_stencil(struct pipe_context *pipe, unsigned tgsi_tex); + +void * +util_make_fs_msaa_resolve(struct pipe_context *pipe, + unsigned tgsi_tex, unsigned nr_samples, + boolean is_uint, boolean is_sint); + + +void * +util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe, + unsigned tgsi_tex, unsigned nr_samples, + boolean is_uint, boolean is_sint); + #ifdef __cplusplus } #endif diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h index 5c214b604..76911f056 100644 --- a/mesalib/src/glsl/ast.h +++ b/mesalib/src/glsl/ast.h @@ -357,6 +357,7 @@ struct ast_type_qualifier { unsigned in:1; unsigned out:1; unsigned centroid:1; + unsigned sample:1; unsigned uniform:1; unsigned smooth:1; unsigned flat:1; diff --git a/mesalib/src/glsl/ast_array_index.cpp b/mesalib/src/glsl/ast_array_index.cpp index f7b5e8350..a5f23206a 100644 --- a/mesalib/src/glsl/ast_array_index.cpp +++ b/mesalib/src/glsl/ast_array_index.cpp @@ -41,8 +41,8 @@ update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc, { if (ir_dereference_variable *deref_var = ir->as_dereference_variable()) { ir_variable *var = deref_var->var; - if (idx > var->max_array_access) { - var->max_array_access = idx; + if (idx > var->data.max_array_access) { + var->data.max_array_access = idx; /* Check whether this access will, as a side effect, implicitly cause * the size of a built-in array to be too large. @@ -168,7 +168,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, if (array->type->is_unsized_array()) { _mesa_glsl_error(&loc, state, "unsized array index must be constant"); } else if (array->type->fields.array->is_interface() - && array->variable_referenced()->mode == ir_var_uniform) { + && array->variable_referenced()->data.mode == ir_var_uniform) { /* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says: * * "All indexes used to index a uniform block array must be @@ -184,7 +184,7 @@ _mesa_ast_array_index_to_hir(void *mem_ctx, */ ir_variable *v = array->whole_variable_referenced(); if (v != NULL) - v->max_array_access = array->type->array_size() - 1; + v->data.max_array_access = array->type->array_size() - 1; } /* From page 23 (29 of the PDF) of the GLSL 1.30 spec: diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp index 2707522ef..e4c0fd1c4 100644 --- a/mesalib/src/glsl/ast_function.cpp +++ b/mesalib/src/glsl/ast_function.cpp @@ -123,7 +123,7 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, YYLTYPE loc = actual_ast->get_location(); /* Verify that 'const_in' parameters are ir_constants. */ - if (formal->mode == ir_var_const_in && + if (formal->data.mode == ir_var_const_in && actual->ir_type != ir_type_constant) { _mesa_glsl_error(&loc, state, "parameter `in %s' must be a constant expression", @@ -132,10 +132,10 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, } /* Verify that 'out' and 'inout' actual parameters are lvalues. */ - if (formal->mode == ir_var_function_out - || formal->mode == ir_var_function_inout) { + if (formal->data.mode == ir_var_function_out + || formal->data.mode == ir_var_function_inout) { const char *mode = NULL; - switch (formal->mode) { + switch (formal->data.mode) { case ir_var_function_out: mode = "out"; break; case ir_var_function_inout: mode = "inout"; break; default: assert(false); break; @@ -155,9 +155,9 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, ir_variable *var = actual->variable_referenced(); if (var) - var->assigned = true; + var->data.assigned = true; - if (var && var->read_only) { + if (var && var->data.read_only) { _mesa_glsl_error(&loc, state, "function parameter '%s %s' references the " "read-only variable '%s'", @@ -274,20 +274,20 @@ fix_parameter(void *mem_ctx, ir_rvalue *actual, const glsl_type *formal_type, } /** - * If a function call is generated, \c call_ir will point to it on exit. - * Otherwise \c call_ir will be set to \c NULL. + * Generate a function call. + * + * For non-void functions, this returns a dereference of the temporary variable + * which stores the return value for the call. For void functions, this returns + * NULL. */ static ir_rvalue * generate_call(exec_list *instructions, ir_function_signature *sig, exec_list *actual_parameters, - ir_call **call_ir, struct _mesa_glsl_parse_state *state) { void *ctx = state; exec_list post_call_conversions; - *call_ir = NULL; - /* Perform implicit conversion of arguments. For out parameters, we need * to place them in a temporary variable and do the conversion after the * call takes place. Since we haven't emitted the call yet, we'll place @@ -304,7 +304,7 @@ generate_call(exec_list *instructions, ir_function_signature *sig, assert(formal != NULL); if (formal->type->is_numeric() || formal->type->is_boolean()) { - switch (formal->mode) { + switch (formal->data.mode) { case ir_var_const_in: case ir_var_function_in: { ir_rvalue *converted @@ -316,7 +316,7 @@ generate_call(exec_list *instructions, ir_function_signature *sig, case ir_var_function_inout: fix_parameter(ctx, actual, formal->type, instructions, &post_call_conversions, - formal->mode == ir_var_function_inout); + formal->data.mode == ir_var_function_inout); break; default: assert (!"Illegal formal parameter mode"); @@ -421,6 +421,25 @@ done: return sig; } +static void +print_function_prototypes(_mesa_glsl_parse_state *state, YYLTYPE *loc, + ir_function *f) +{ + if (f == NULL) + return; + + foreach_list (node, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) node; + + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; + + char *str = prototype_string(sig->return_type, f->name, &sig->parameters); + _mesa_glsl_error(loc, state, " %s", str); + ralloc_free(str); + } +} + /** * Raise a "no matching function" error, listing all possible overloads the * compiler considered so developers can figure out what went wrong. @@ -431,30 +450,23 @@ no_matching_function_error(const char *name, exec_list *actual_parameters, _mesa_glsl_parse_state *state) { - char *str = prototype_string(NULL, name, actual_parameters); - _mesa_glsl_error(loc, state, "no matching function for call to `%s'", str); - ralloc_free(str); - - const char *prefix = "candidates are: "; + gl_shader *sh = _mesa_glsl_get_builtin_function_shader(); - for (int i = -1; i < (int) state->num_builtins_to_link; i++) { - glsl_symbol_table *syms = i >= 0 ? state->builtins_to_link[i]->symbols - : state->symbols; - ir_function *f = syms->get_function(name); - if (f == NULL) - continue; - - foreach_list (node, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) node; - - if (sig->is_builtin() && !sig->is_builtin_available(state)) - continue; + if (state->symbols->get_function(name) == NULL + && (!state->uses_builtin_functions + || sh->symbols->get_function(name) == NULL)) { + _mesa_glsl_error(loc, state, "no function with name '%s'", name); + } else { + char *str = prototype_string(NULL, name, actual_parameters); + _mesa_glsl_error(loc, state, + "no matching function for call to `%s'; candidates are:", + str); + ralloc_free(str); - str = prototype_string(sig->return_type, f->name, &sig->parameters); - _mesa_glsl_error(loc, state, "%s%s", prefix, str); - ralloc_free(str); + print_function_prototypes(state, loc, state->symbols->get_function(name)); - prefix = " "; + if (state->uses_builtin_functions) { + print_function_prototypes(state, loc, sh->symbols->get_function(name)); } } } @@ -1651,7 +1663,7 @@ ast_function_expression::hir(exec_list *instructions, } else { const ast_expression *id = subexpressions[0]; const char *func_name = id->primary_expression.identifier; - YYLTYPE loc = id->get_location(); + YYLTYPE loc = get_location(); exec_list actual_parameters; process_parameters(instructions, &actual_parameters, &this->expressions, @@ -1660,7 +1672,6 @@ ast_function_expression::hir(exec_list *instructions, ir_function_signature *sig = match_function_by_name(func_name, &actual_parameters, state); - ir_call *call = NULL; ir_rvalue *value = NULL; if (sig == NULL) { no_matching_function_error(func_name, &loc, &actual_parameters, state); @@ -1669,8 +1680,7 @@ ast_function_expression::hir(exec_list *instructions, /* an error has already been emitted */ value = ir_rvalue::error_value(ctx); } else { - value = generate_call(instructions, sig, &actual_parameters, - &call, state); + value = generate_call(instructions, sig, &actual_parameters, state); } return value; diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 43cf49745..3bc181e87 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -728,7 +728,7 @@ mark_whole_array_access(ir_rvalue *access) ir_dereference_variable *deref = access->as_dereference_variable(); if (deref && deref->var) { - deref->var->max_array_access = deref->type->length - 1; + deref->var->data.max_array_access = deref->type->length - 1; } } @@ -767,7 +767,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, ir_variable *lhs_var = lhs->variable_referenced(); if (lhs_var) - lhs_var->assigned = true; + lhs_var->data.assigned = true; if (!error_emitted) { if (non_lvalue_description != NULL) { @@ -776,7 +776,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, non_lvalue_description); error_emitted = true; } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->read_only) { + && lhs->variable_referenced()->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", lhs->variable_referenced()->name); @@ -819,11 +819,11 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, assert(var != NULL); - if (var->max_array_access >= unsigned(rhs->type->array_size())) { + if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { /* FINISHME: This should actually log the location of the RHS. */ _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " "previous access", - var->max_array_access); + var->data.max_array_access); } var->type = glsl_type::get_array_instance(lhs->type->element_type(), @@ -866,7 +866,7 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp", ir_var_temporary); instructions->push_tail(var); - var->mode = ir_var_auto; + var->data.mode = ir_var_auto; instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), lvalue)); @@ -1639,7 +1639,7 @@ ast_expression::hir(exec_list *instructions, state->symbols->get_variable(this->primary_expression.identifier); if (var != NULL) { - var->used = true; + var->data.used = true; result = new(ctx) ir_dereference_variable(var); } else { _mesa_glsl_error(& loc, state, "`%s' undeclared", @@ -1860,7 +1860,7 @@ ast_fully_specified_type::glsl_type(const char **name, if (type->base_type == GLSL_TYPE_FLOAT && state->es_shader - && state->target == fragment_shader + && state->target == MESA_SHADER_FRAGMENT && this->qualifier.precision == ast_precision_none && state->symbols->get_variable("#default precision") == NULL) { YYLTYPE loc = this->get_location(); @@ -1882,15 +1882,15 @@ ast_fully_specified_type::glsl_type(const char **name, * this function will produce undefined results. */ static bool -is_varying_var(ir_variable *var, _mesa_glsl_parser_targets target) +is_varying_var(ir_variable *var, gl_shader_type target) { switch (target) { - case vertex_shader: - return var->mode == ir_var_shader_out; - case fragment_shader: - return var->mode == ir_var_shader_in; + case MESA_SHADER_VERTEX: + return var->data.mode == ir_var_shader_out; + case MESA_SHADER_FRAGMENT: + return var->data.mode == ir_var_shader_in; default: - return var->mode == ir_var_shader_out || var->mode == ir_var_shader_in; + return var->data.mode == ir_var_shader_out || var->data.mode == ir_var_shader_in; } } @@ -1941,7 +1941,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, ir_variable *var, const ast_type_qualifier *qual) { - if (var->mode != ir_var_uniform) { + if (var->data.mode != ir_var_uniform) { _mesa_glsl_error(loc, state, "the \"binding\" qualifier only applies to uniforms"); return false; @@ -1985,13 +1985,13 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, */ unsigned limit = 0; switch (state->target) { - case vertex_shader: + case MESA_SHADER_VERTEX: limit = ctx->Const.VertexProgram.MaxTextureImageUnits; break; - case geometry_shader: + case MESA_SHADER_GEOMETRY: limit = ctx->Const.GeometryProgram.MaxTextureImageUnits; break; - case fragment_shader: + case MESA_SHADER_FRAGMENT: limit = ctx->Const.FragmentProgram.MaxTextureImageUnits; break; } @@ -2049,8 +2049,8 @@ interpret_interpolation_qualifier(const struct ast_type_qualifier *qual, } - if ((state->target == vertex_shader && mode == ir_var_shader_in) || - (state->target == fragment_shader && mode == ir_var_shader_out)) { + if ((state->target == MESA_SHADER_VERTEX && mode == ir_var_shader_in) || + (state->target == MESA_SHADER_FRAGMENT && mode == ir_var_shader_out)) { _mesa_glsl_error(loc, state, "interpolation qualifier `%s' cannot be applied to " "vertex shader inputs or fragment shader outputs", @@ -2077,8 +2077,8 @@ validate_explicit_location(const struct ast_type_qualifier *qual, * locations. */ switch (state->target) { - case vertex_shader: - if (var->mode == ir_var_shader_in) { + case MESA_SHADER_VERTEX: + if (var->data.mode == ir_var_shader_in) { if (!state->check_explicit_attrib_location_allowed(loc, var)) return; @@ -2088,14 +2088,14 @@ validate_explicit_location(const struct ast_type_qualifier *qual, fail = true; break; - case geometry_shader: + case MESA_SHADER_GEOMETRY: _mesa_glsl_error(loc, state, "geometry shader variables cannot be given " "explicit locations"); return; - case fragment_shader: - if (var->mode == ir_var_shader_out) { + case MESA_SHADER_FRAGMENT: + if (var->data.mode == ir_var_shader_out) { if (!state->check_explicit_attrib_location_allowed(loc, var)) return; @@ -2112,7 +2112,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, mode_string(var), _mesa_glsl_shader_target_name(state->target)); } else { - var->explicit_location = true; + var->data.explicit_location = true; /* This bit of silliness is needed because invalid explicit locations * are supposed to be flagged during linking. Small negative values @@ -2122,11 +2122,11 @@ validate_explicit_location(const struct ast_type_qualifier *qual, * ensures that negative values stay negative. */ if (qual->location >= 0) { - var->location = (state->target == vertex_shader) + var->data.location = (state->target == MESA_SHADER_VERTEX) ? (qual->location + VERT_ATTRIB_GENERIC0) : (qual->location + FRAG_RESULT_DATA0); } else { - var->location = qual->location; + var->data.location = qual->location; } if (qual->flags.q.explicit_index) { @@ -2143,8 +2143,8 @@ validate_explicit_location(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "explicit index may only be 0 or 1"); } else { - var->explicit_index = true; - var->index = qual->index; + var->data.explicit_index = true; + var->data.index = qual->index; } } } @@ -2162,25 +2162,28 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i)); if (qual->flags.q.invariant) { - if (var->used) { + if (var->data.used) { _mesa_glsl_error(loc, state, "variable `%s' may not be redeclared " "`invariant' after being used", var->name); } else { - var->invariant = 1; + var->data.invariant = 1; } } if (qual->flags.q.constant || qual->flags.q.attribute || qual->flags.q.uniform - || (qual->flags.q.varying && (state->target == fragment_shader))) - var->read_only = 1; + || (qual->flags.q.varying && (state->target == MESA_SHADER_FRAGMENT))) + var->data.read_only = 1; if (qual->flags.q.centroid) - var->centroid = 1; + var->data.centroid = 1; - if (qual->flags.q.attribute && state->target != vertex_shader) { + if (qual->flags.q.sample) + var->data.sample = 1; + + if (qual->flags.q.attribute && state->target != MESA_SHADER_VERTEX) { var->type = glsl_type::error_type; _mesa_glsl_error(loc, state, "`attribute' variables may not be declared in the " @@ -2207,18 +2210,18 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, * the setting alone. */ if (qual->flags.q.in && qual->flags.q.out) - var->mode = ir_var_function_inout; + var->data.mode = ir_var_function_inout; else if (qual->flags.q.in) - var->mode = is_parameter ? ir_var_function_in : ir_var_shader_in; + var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in; else if (qual->flags.q.attribute - || (qual->flags.q.varying && (state->target == fragment_shader))) - var->mode = ir_var_shader_in; + || (qual->flags.q.varying && (state->target == MESA_SHADER_FRAGMENT))) + var->data.mode = ir_var_shader_in; else if (qual->flags.q.out) - var->mode = is_parameter ? ir_var_function_out : ir_var_shader_out; - else if (qual->flags.q.varying && (state->target == vertex_shader)) - var->mode = ir_var_shader_out; + var->data.mode = is_parameter ? ir_var_function_out : ir_var_shader_out; + else if (qual->flags.q.varying && (state->target == MESA_SHADER_VERTEX)) + var->data.mode = ir_var_shader_out; else if (qual->flags.q.uniform) - var->mode = ir_var_uniform; + var->data.mode = ir_var_uniform; if (!is_parameter && is_varying_var(var, state->target)) { /* This variable is being used to link data between shader stages (in @@ -2270,28 +2273,28 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (state->all_invariant && (state->current_function == NULL)) { switch (state->target) { - case vertex_shader: - if (var->mode == ir_var_shader_out) - var->invariant = true; + case MESA_SHADER_VERTEX: + if (var->data.mode == ir_var_shader_out) + var->data.invariant = true; break; - case geometry_shader: - if ((var->mode == ir_var_shader_in) - || (var->mode == ir_var_shader_out)) - var->invariant = true; + case MESA_SHADER_GEOMETRY: + if ((var->data.mode == ir_var_shader_in) + || (var->data.mode == ir_var_shader_out)) + var->data.invariant = true; break; - case fragment_shader: - if (var->mode == ir_var_shader_in) - var->invariant = true; + case MESA_SHADER_FRAGMENT: + if (var->data.mode == ir_var_shader_in) + var->data.invariant = true; break; } } - var->interpolation = - interpret_interpolation_qualifier(qual, (ir_variable_mode) var->mode, + var->data.interpolation = + interpret_interpolation_qualifier(qual, (ir_variable_mode) var->data.mode, state, loc); - var->pixel_center_integer = qual->flags.q.pixel_center_integer; - var->origin_upper_left = qual->flags.q.origin_upper_left; + var->data.pixel_center_integer = qual->flags.q.pixel_center_integer; + var->data.origin_upper_left = qual->flags.q.origin_upper_left; if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) && (strcmp(var->name, "gl_FragCoord") != 0)) { const char *const qual_string = (qual->flags.q.origin_upper_left) @@ -2312,27 +2315,28 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.explicit_binding && validate_binding_qualifier(state, loc, var, qual)) { - var->explicit_binding = true; - var->binding = qual->binding; + var->data.explicit_binding = true; + var->data.binding = qual->binding; } if (var->type->contains_atomic()) { - if (var->mode == ir_var_uniform) { - if (var->explicit_binding) { - unsigned *offset = &state->atomic_counter_offsets[var->binding]; + if (var->data.mode == ir_var_uniform) { + if (var->data.explicit_binding) { + unsigned *offset = + &state->atomic_counter_offsets[var->data.binding]; if (*offset % ATOMIC_COUNTER_SIZE) _mesa_glsl_error(loc, state, "misaligned atomic counter offset"); - var->atomic.offset = *offset; + var->data.atomic.offset = *offset; *offset += var->type->atomic_size(); } else { _mesa_glsl_error(loc, state, "atomic counters require explicit binding point"); } - } else if (var->mode != ir_var_function_in) { + } else if (var->data.mode != ir_var_function_in) { _mesa_glsl_error(loc, state, "atomic counters may only be declared as " "function parameters or uniform-qualified " "global variables"); @@ -2406,15 +2410,15 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, "gl_FragDepth"); } if (qual->flags.q.depth_any) - var->depth_layout = ir_depth_layout_any; + var->data.depth_layout = ir_depth_layout_any; else if (qual->flags.q.depth_greater) - var->depth_layout = ir_depth_layout_greater; + var->data.depth_layout = ir_depth_layout_greater; else if (qual->flags.q.depth_less) - var->depth_layout = ir_depth_layout_less; + var->data.depth_layout = ir_depth_layout_less; else if (qual->flags.q.depth_unchanged) - var->depth_layout = ir_depth_layout_unchanged; + var->data.depth_layout = ir_depth_layout_unchanged; else - var->depth_layout = ir_depth_layout_none; + var->data.depth_layout = ir_depth_layout_none; if (qual->flags.q.std140 || qual->flags.q.packed || @@ -2475,10 +2479,10 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, const unsigned size = unsigned(var->type->array_size()); check_builtin_array_max_size(var->name, size, loc, state); - if ((size > 0) && (size <= earlier->max_array_access)) { + if ((size > 0) && (size <= earlier->data.max_array_access)) { _mesa_glsl_error(& loc, state, "array size must be > %u due to " "previous access", - earlier->max_array_access); + earlier->data.max_array_access); } earlier->type = var->type; @@ -2488,12 +2492,12 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, state->is_version(150, 0)) && strcmp(var->name, "gl_FragCoord") == 0 && earlier->type == var->type - && earlier->mode == var->mode) { + && earlier->data.mode == var->data.mode) { /* Allow redeclaration of gl_FragCoord for ARB_fcc layout * qualifiers. */ - earlier->origin_upper_left = var->origin_upper_left; - earlier->pixel_center_integer = var->pixel_center_integer; + earlier->data.origin_upper_left = var->data.origin_upper_left; + earlier->data.pixel_center_integer = var->data.pixel_center_integer; /* According to section 4.3.7 of the GLSL 1.30 spec, * the following built-in varaibles can be redeclared with an @@ -2513,41 +2517,41 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, || strcmp(var->name, "gl_Color") == 0 || strcmp(var->name, "gl_SecondaryColor") == 0) && earlier->type == var->type - && earlier->mode == var->mode) { - earlier->interpolation = var->interpolation; + && earlier->data.mode == var->data.mode) { + earlier->data.interpolation = var->data.interpolation; /* Layout qualifiers for gl_FragDepth. */ } else if ((state->AMD_conservative_depth_enable || state->ARB_conservative_depth_enable) && strcmp(var->name, "gl_FragDepth") == 0 && earlier->type == var->type - && earlier->mode == var->mode) { + && earlier->data.mode == var->data.mode) { /** From the AMD_conservative_depth spec: * Within any shader, the first redeclarations of gl_FragDepth * must appear before any use of gl_FragDepth. */ - if (earlier->used) { + if (earlier->data.used) { _mesa_glsl_error(&loc, state, "the first redeclaration of gl_FragDepth " "must appear before any use of gl_FragDepth"); } /* Prevent inconsistent redeclaration of depth layout qualifier. */ - if (earlier->depth_layout != ir_depth_layout_none - && earlier->depth_layout != var->depth_layout) { + if (earlier->data.depth_layout != ir_depth_layout_none + && earlier->data.depth_layout != var->data.depth_layout) { _mesa_glsl_error(&loc, state, "gl_FragDepth: depth layout is declared here " "as '%s, but it was previously declared as " "'%s'", - depth_layout_string(var->depth_layout), - depth_layout_string(earlier->depth_layout)); + depth_layout_string(var->data.depth_layout), + depth_layout_string(earlier->data.depth_layout)); } - earlier->depth_layout = var->depth_layout; + earlier->data.depth_layout = var->data.depth_layout; } else if (allow_all_redeclarations) { - if (earlier->mode != var->mode) { + if (earlier->data.mode != var->data.mode) { _mesa_glsl_error(&loc, state, "redeclaration of `%s' with incorrect qualifiers", var->name); @@ -2582,7 +2586,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, * directly by an application via API commands, or indirectly by * OpenGL." */ - if (var->mode == ir_var_uniform) { + if (var->data.mode == ir_var_uniform) { state->check_version(120, 0, &initializer_loc, "cannot initialize uniforms"); } @@ -2592,11 +2596,11 @@ process_initializer(ir_variable *var, ast_declaration *decl, "cannot initialize samplers"); } - if ((var->mode == ir_var_shader_in) && (state->current_function == NULL)) { + if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { _mesa_glsl_error(& initializer_loc, state, "cannot initialize %s shader input / %s", _mesa_glsl_shader_target_name(state->target), - (state->target == vertex_shader) + (state->target == MESA_SHADER_VERTEX) ? "attribute" : "varying"); } @@ -2647,9 +2651,9 @@ process_initializer(ir_variable *var, ast_declaration *decl, } if (rhs && !rhs->type->is_error()) { - bool temp = var->read_only; + bool temp = var->data.read_only; if (type->qualifier.flags.q.constant) - var->read_only = false; + var->data.read_only = false; /* Never emit code to initialize a uniform. */ @@ -2664,7 +2668,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, initializer_type = rhs->type; var->constant_initializer = rhs->constant_expression_value(); - var->has_initializer = true; + var->data.has_initializer = true; /* If the declared variable is an unsized array, it must inherrit * its full type from the initializer. A declaration such as @@ -2688,7 +2692,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, */ var->type = initializer_type; - var->read_only = temp; + var->data.read_only = temp; } return result; @@ -2840,23 +2844,23 @@ ast_declarator_list::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "undeclared variable `%s' cannot be marked " "invariant", decl->identifier); - } else if ((state->target == vertex_shader) - && (earlier->mode != ir_var_shader_out)) { + } else if ((state->target == MESA_SHADER_VERTEX) + && (earlier->data.mode != ir_var_shader_out)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " "outputs only", decl->identifier); - } else if ((state->target == fragment_shader) - && (earlier->mode != ir_var_shader_in)) { + } else if ((state->target == MESA_SHADER_FRAGMENT) + && (earlier->data.mode != ir_var_shader_in)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, fragment shader " "inputs only", decl->identifier); - } else if (earlier->used) { + } else if (earlier->data.used) { _mesa_glsl_error(& loc, state, "variable `%s' may not be redeclared " "`invariant' after being used", earlier->name); } else { - earlier->invariant = true; + earlier->data.invariant = true; } } @@ -2940,7 +2944,7 @@ ast_declarator_list::hir(exec_list *instructions, precision_names[this->type->qualifier.precision], type_name); } - } else { + } else if (this->type->specifier->structure == NULL) { _mesa_glsl_warning(&loc, state, "empty declaration"); } } @@ -3030,13 +3034,13 @@ ast_declarator_list::hir(exec_list *instructions, & loc, false); if (this->type->qualifier.flags.q.invariant) { - if ((state->target == vertex_shader) && - var->mode != ir_var_shader_out) { + if ((state->target == MESA_SHADER_VERTEX) && + var->data.mode != ir_var_shader_out) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " "outputs only", var->name); - } else if ((state->target == fragment_shader) && - var->mode != ir_var_shader_in) { + } else if ((state->target == MESA_SHADER_FRAGMENT) && + var->data.mode != ir_var_shader_in) { /* FINISHME: Note that this doesn't work for invariant on * a function signature inval */ @@ -3073,10 +3077,10 @@ ast_declarator_list::hir(exec_list *instructions, "global scope%s", mode, var->name, extra); } - } else if (var->mode == ir_var_shader_in) { - var->read_only = true; + } else if (var->data.mode == ir_var_shader_in) { + var->data.read_only = true; - if (state->target == vertex_shader) { + if (state->target == MESA_SHADER_VERTEX) { bool error_emitted = false; /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: @@ -3131,7 +3135,7 @@ ast_declarator_list::hir(exec_list *instructions, "cannot have array type")) { error_emitted = true; } - } else if (state->target == geometry_shader) { + } else if (state->target == MESA_SHADER_GEOMETRY) { /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: * * Geometry shader input variables get the per-vertex values @@ -3180,11 +3184,11 @@ ast_declarator_list::hir(exec_list *instructions, */ if (state->is_version(130, 300) && var->type->contains_integer() && - var->interpolation != INTERP_QUALIFIER_FLAT && - ((state->target == fragment_shader && var->mode == ir_var_shader_in) - || (state->target == vertex_shader && var->mode == ir_var_shader_out + var->data.interpolation != INTERP_QUALIFIER_FLAT && + ((state->target == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_in) + || (state->target == MESA_SHADER_VERTEX && var->data.mode == ir_var_shader_out && state->es_shader))) { - const char *var_type = (state->target == vertex_shader) ? + const char *var_type = (state->target == MESA_SHADER_VERTEX) ? "vertex output" : "fragment input"; _mesa_glsl_error(&loc, state, "if a %s is (or contains) " "an integer, then it must be qualified with 'flat'", @@ -3241,14 +3245,14 @@ ast_declarator_list::hir(exec_list *instructions, assert(i != NULL); switch (state->target) { - case vertex_shader: + case MESA_SHADER_VERTEX: if (this->type->qualifier.flags.q.in) { _mesa_glsl_error(&loc, state, "qualifier '%s' cannot be applied to vertex " "shader inputs", i); } break; - case fragment_shader: + case MESA_SHADER_FRAGMENT: if (this->type->qualifier.flags.q.out) { _mesa_glsl_error(&loc, state, "qualifier '%s' cannot be applied to fragment " @@ -3271,12 +3275,20 @@ ast_declarator_list::hir(exec_list *instructions, if (state->is_version(130, 300) && this->type->qualifier.flags.q.centroid && this->type->qualifier.flags.q.in - && state->target == vertex_shader) { + && state->target == MESA_SHADER_VERTEX) { _mesa_glsl_error(&loc, state, "'centroid in' cannot be used in a vertex shader"); } + if (state->target == MESA_SHADER_VERTEX + && this->type->qualifier.flags.q.sample + && this->type->qualifier.flags.q.in) { + + _mesa_glsl_error(&loc, state, + "'sample in' cannot be used in a vertex shader"); + } + /* Section 4.3.6 of the GLSL 1.30 specification states: * "It is an error to use centroid out in a fragment shader." * @@ -3284,7 +3296,7 @@ ast_declarator_list::hir(exec_list *instructions, * "It is an error to use auxiliary storage qualifiers or interpolation * qualifiers on an output in a fragment shader." */ - if (state->target == fragment_shader && + if (state->target == MESA_SHADER_FRAGMENT && this->type->qualifier.flags.q.out && this->type->qualifier.has_auxiliary_storage()) { _mesa_glsl_error(&loc, state, @@ -3363,12 +3375,12 @@ ast_declarator_list::hir(exec_list *instructions, false /* allow_all_redeclarations */); if (earlier != NULL) { if (strncmp(var->name, "gl_", 3) == 0 && - earlier->how_declared == ir_var_declared_in_block) { + earlier->data.how_declared == ir_var_declared_in_block) { _mesa_glsl_error(&loc, state, "`%s' has already been redeclared using " "gl_PerVertex", var->name); } - earlier->how_declared = ir_var_declared_normally; + earlier->data.how_declared = ir_var_declared_normally; } if (decl->initializer != NULL) { @@ -3548,7 +3560,7 @@ ast_parameter_declarator::hir(exec_list *instructions, * as out or inout function parameters, nor can they be assigned * into." */ - if ((var->mode == ir_var_function_inout || var->mode == ir_var_function_out) + if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out) && type->contains_sampler()) { _mesa_glsl_error(&loc, state, "out and inout parameters cannot contain samplers"); type = glsl_type::error_type; @@ -3568,7 +3580,7 @@ ast_parameter_declarator::hir(exec_list *instructions, * So for GLSL 1.10, passing an array as an out or inout parameter is not * allowed. This restriction is removed in GLSL 1.20, and in GLSL ES. */ - if ((var->mode == ir_var_function_inout || var->mode == ir_var_function_out) + if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out) && type->is_array() && !state->check_version(120, 100, &loc, "arrays cannot be out or inout parameters")) { @@ -3942,7 +3954,7 @@ ast_jump_statement::hir(exec_list *instructions, } case ast_discard: - if (state->target != fragment_shader) { + if (state->target != MESA_SHADER_FRAGMENT) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, @@ -4480,7 +4492,7 @@ ast_type_specifier::hir(exec_list *instructions, if (type->base_type == GLSL_TYPE_FLOAT && state->es_shader - && state->target == fragment_shader) { + && state->target == MESA_SHADER_FRAGMENT) { /* Section 4.5.3 (Default Precision Qualifiers) of the GLSL ES 1.00 * spec says: * @@ -4662,6 +4674,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, fields[i].interpolation = interpret_interpolation_qualifier(qual, var_mode, state, &loc); fields[i].centroid = qual->flags.q.centroid ? 1 : 0; + fields[i].sample = qual->flags.q.sample ? 1 : 0; if (qual->flags.q.row_major || qual->flags.q.column_major) { if (!qual->flags.q.uniform) { @@ -4782,7 +4795,7 @@ public: virtual ir_visitor_status visit(ir_dereference_variable *ir) { - if (ir->var->mode == mode && ir->var->get_interface_type() == block) { + if (ir->var->data.mode == mode && ir->var->get_interface_type() == block) { found = true; return visit_stop; } @@ -4930,6 +4943,8 @@ ast_interface_block::hir(exec_list *instructions, earlier_per_vertex->fields.structure[j].interpolation; fields[i].centroid = earlier_per_vertex->fields.structure[j].centroid; + fields[i].sample = + earlier_per_vertex->fields.structure[j].sample; } } @@ -4980,7 +4995,7 @@ ast_interface_block::hir(exec_list *instructions, * variable (or input block, see interface blocks below) needs to be * declared as an array. */ - if (state->target == geometry_shader && !this->is_array && + if (state->target == MESA_SHADER_GEOMETRY && !this->is_array && var_mode == ir_var_shader_in) { _mesa_glsl_error(&loc, state, "geometry shader inputs must be arrays"); } @@ -5035,7 +5050,7 @@ ast_interface_block::hir(exec_list *instructions, * geometry shader input. */ if (this->array_size == NULL && - (state->target != geometry_shader || !this->layout.flags.q.in)) { + (state->target != MESA_SHADER_GEOMETRY || !this->layout.flags.q.in)) { _mesa_glsl_error(&loc, state, "only geometry shader inputs may be unsized " "instance block arrays"); @@ -5054,7 +5069,7 @@ ast_interface_block::hir(exec_list *instructions, var_mode); } - if (state->target == geometry_shader && var_mode == ir_var_shader_in) + if (state->target == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) handle_geometry_shader_input_decl(state, loc, var); if (ir_variable *earlier = @@ -5063,7 +5078,7 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "`%s' redeclared", this->instance_name); } - earlier->how_declared = ir_var_declared_normally; + earlier->data.how_declared = ir_var_declared_normally; earlier->type = var->type; earlier->reinit_interface_type(block_type); delete var; @@ -5082,8 +5097,9 @@ ast_interface_block::hir(exec_list *instructions, new(state) ir_variable(fields[i].type, ralloc_strdup(state, fields[i].name), var_mode); - var->interpolation = fields[i].interpolation; - var->centroid = fields[i].centroid; + var->data.interpolation = fields[i].interpolation; + var->data.centroid = fields[i].centroid; + var->data.sample = fields[i].sample; var->init_interface_type(block_type); if (redeclaring_per_vertex) { @@ -5094,11 +5110,11 @@ ast_interface_block::hir(exec_list *instructions, _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex can only " "include built-in variables"); - } else if (earlier->how_declared == ir_var_declared_normally) { + } else if (earlier->data.how_declared == ir_var_declared_normally) { _mesa_glsl_error(&loc, state, "`%s' has already been redeclared", var->name); } else { - earlier->how_declared = ir_var_declared_in_block; + earlier->data.how_declared = ir_var_declared_in_block; earlier->reinit_interface_type(block_type); } continue; @@ -5111,8 +5127,8 @@ ast_interface_block::hir(exec_list *instructions, * the UBO declaration itself doesn't get an ir_variable unless it * has an instance name. This is ugly. */ - var->explicit_binding = this->layout.flags.q.explicit_binding; - var->binding = this->layout.binding; + var->data.explicit_binding = this->layout.flags.q.explicit_binding; + var->data.binding = this->layout.binding; state->symbols->add_variable(var); instructions->push_tail(var); @@ -5144,8 +5160,8 @@ ast_interface_block::hir(exec_list *instructions, ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var != NULL && var->get_interface_type() == earlier_per_vertex && - var->mode == var_mode) { - if (var->how_declared == ir_var_declared_normally) { + var->data.mode == var_mode) { + if (var->data.how_declared == ir_var_declared_normally) { _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex cannot " "follow a redeclaration of `%s'", @@ -5200,7 +5216,7 @@ ast_gs_input_layout::hir(exec_list *instructions, */ foreach_list (node, instructions) { ir_variable *var = ((ir_instruction *) node)->as_variable(); - if (var == NULL || var->mode != ir_var_shader_in) + if (var == NULL || var->data.mode != ir_var_shader_in) continue; /* Note: gl_PrimitiveIDIn has mode ir_var_shader_in, but it's not an @@ -5208,12 +5224,12 @@ ast_gs_input_layout::hir(exec_list *instructions, */ if (var->type->is_unsized_array()) { - if (var->max_array_access >= num_vertices) { + if (var->data.max_array_access >= num_vertices) { _mesa_glsl_error(&loc, state, "this geometry shader input layout implies %u" " vertices, but an access to element %u of input" " `%s' already exists", num_vertices, - var->max_array_access, var->name); + var->data.max_array_access, var->name); } else { var->type = glsl_type::get_array_instance(var->type->fields.array, num_vertices); @@ -5241,7 +5257,7 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, foreach_list(node, instructions) { ir_variable *var = ((ir_instruction *)node)->as_variable(); - if (!var || !var->assigned) + if (!var || !var->data.assigned) continue; if (strcmp(var->name, "gl_FragColor") == 0) @@ -5249,8 +5265,8 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, else if (strcmp(var->name, "gl_FragData") == 0) gl_FragData_assigned = true; else if (strncmp(var->name, "gl_", 3) != 0) { - if (state->target == fragment_shader && - var->mode == ir_var_shader_out) { + if (state->target == MESA_SHADER_FRAGMENT && + var->data.mode == ir_var_shader_out) { user_defined_fs_output_assigned = true; user_defined_fs_output = var; } @@ -5331,7 +5347,7 @@ remove_per_vertex_blocks(exec_list *instructions, foreach_list_safe(node, instructions) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var != NULL && var->get_interface_type() == per_vertex && - var->mode == mode) { + var->data.mode == mode) { state->symbols->disable_variable(var->name); var->remove(); } diff --git a/mesalib/src/glsl/ast_type.cpp b/mesalib/src/glsl/ast_type.cpp index 2b088bf8b..d758bfa1f 100644 --- a/mesalib/src/glsl/ast_type.cpp +++ b/mesalib/src/glsl/ast_type.cpp @@ -90,7 +90,8 @@ ast_type_qualifier::has_storage() const bool ast_type_qualifier::has_auxiliary_storage() const { - return this->flags.q.centroid; + return this->flags.q.centroid + || this->flags.q.sample; } const char* diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp index 8cb75e5ad..840a6c9a2 100644 --- a/mesalib/src/glsl/builtin_functions.cpp +++ b/mesalib/src/glsl/builtin_functions.cpp @@ -77,7 +77,7 @@ always_available(const _mesa_glsl_parse_state *state) static bool compatibility_vs_only(const _mesa_glsl_parse_state *state) { - return state->target == vertex_shader && + return state->target == MESA_SHADER_VERTEX && state->language_version <= 130 && !state->es_shader; } @@ -85,13 +85,13 @@ compatibility_vs_only(const _mesa_glsl_parse_state *state) static bool fs_only(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader; + return state->target == MESA_SHADER_FRAGMENT; } static bool gs_only(const _mesa_glsl_parse_state *state) { - return state->target == geometry_shader; + return state->target == MESA_SHADER_GEOMETRY; } static bool @@ -103,7 +103,7 @@ v110(const _mesa_glsl_parse_state *state) static bool v110_fs_only(const _mesa_glsl_parse_state *state) { - return !state->es_shader && state->target == fragment_shader; + return !state->es_shader && state->target == MESA_SHADER_FRAGMENT; } static bool @@ -122,7 +122,7 @@ static bool v130_fs_only(const _mesa_glsl_parse_state *state) { return state->is_version(130, 300) && - state->target == fragment_shader; + state->target == MESA_SHADER_FRAGMENT; } static bool @@ -155,7 +155,7 @@ lod_exists_in_stage(const _mesa_glsl_parse_state *state) * Since ARB_shader_texture_lod can only be enabled on desktop GLSL, we * don't need to explicitly check state->es_shader. */ - return state->target == vertex_shader || + return state->target == MESA_SHADER_VERTEX || state->is_version(130, 300) || state->ARB_shader_texture_lod_enable; } @@ -223,7 +223,7 @@ texture_array_lod(const _mesa_glsl_parse_state *state) static bool fs_texture_array(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader && + return state->target == MESA_SHADER_FRAGMENT && state->EXT_texture_array_enable; } @@ -243,7 +243,7 @@ texture_multisample(const _mesa_glsl_parse_state *state) static bool fs_texture_cube_map_array(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader && + return state->target == MESA_SHADER_FRAGMENT && (state->is_version(400, 0) || state->ARB_texture_cube_map_array_enable); } @@ -265,7 +265,7 @@ texture_query_levels(const _mesa_glsl_parse_state *state) static bool texture_query_lod(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader && + return state->target == MESA_SHADER_FRAGMENT && state->ARB_texture_query_lod_enable; } @@ -292,7 +292,7 @@ texture_gather_only(const _mesa_glsl_parse_state *state) static bool fs_oes_derivatives(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader && + return state->target == MESA_SHADER_FRAGMENT && (state->is_version(110, 300) || state->OES_standard_derivatives_enable); } @@ -318,7 +318,7 @@ tex3d(const _mesa_glsl_parse_state *state) static bool fs_tex3d(const _mesa_glsl_parse_state *state) { - return state->target == fragment_shader && + return state->target == MESA_SHADER_FRAGMENT && (!state->es_shader || state->OES_texture_3D_enable); } @@ -357,8 +357,6 @@ public: ir_function_signature *find(_mesa_glsl_parse_state *state, const char *name, exec_list *actual_parameters); -private: - void *mem_ctx; /** * A shader to hold all the built-in signatures; created by this module. * @@ -368,6 +366,9 @@ private: */ gl_shader *shader; +private: + void *mem_ctx; + /** Global variables used by built-in functions. */ ir_variable *gl_ModelViewProjectionMatrix; ir_variable *gl_Vertex; @@ -608,8 +609,7 @@ builtin_builder::find(_mesa_glsl_parse_state *state, * that the "no matching signature" error will list potential candidates * from the available built-ins. */ - state->builtins_to_link[0] = shader; - state->num_builtins_to_link = 1; + state->uses_builtin_functions = true; ir_function *f = shader->symbols->get_function(name); if (f == NULL) @@ -4020,4 +4020,11 @@ _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state, { return builtins.find(state, name, actual_parameters); } + +gl_shader * +_mesa_glsl_get_builtin_function_shader() +{ + return builtins.shader; +} + /** @} */ diff --git a/mesalib/src/glsl/builtin_variables.cpp b/mesalib/src/glsl/builtin_variables.cpp index d57324c2f..ff9acb8d0 100644 --- a/mesalib/src/glsl/builtin_variables.cpp +++ b/mesalib/src/glsl/builtin_variables.cpp @@ -332,6 +332,7 @@ per_vertex_accumulator::add_field(int slot, const glsl_type *type, this->fields[this->num_fields].location = slot; this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE; this->fields[this->num_fields].centroid = 0; + this->fields[this->num_fields].sample = 0; this->num_fields++; } @@ -434,14 +435,14 @@ builtin_variable_generator::add_variable(const char *name, enum ir_variable_mode mode, int slot) { ir_variable *var = new(symtab) ir_variable(type, name, mode); - var->how_declared = ir_var_declared_implicitly; + var->data.how_declared = ir_var_declared_implicitly; - switch (var->mode) { + switch (var->data.mode) { case ir_var_auto: case ir_var_shader_in: case ir_var_uniform: case ir_var_system_value: - var->read_only = true; + var->data.read_only = true; break; case ir_var_shader_out: break; @@ -454,9 +455,9 @@ builtin_variable_generator::add_variable(const char *name, break; } - var->location = slot; - var->explicit_location = (slot >= 0); - var->explicit_index = 0; + var->data.location = slot; + var->data.explicit_location = (slot >= 0); + var->data.explicit_index = 0; /* Once the variable is created an initialized, add it to the symbol table * and add the declaration to the IR stream. @@ -523,7 +524,7 @@ builtin_variable_generator::add_const(const char *name, int value) ir_var_auto, -1); var->constant_value = new(var) ir_constant(value); var->constant_initializer = new(var) ir_constant(value); - var->has_initializer = true; + var->data.has_initializer = true; return var; } @@ -792,9 +793,9 @@ builtin_variable_generator::generate_gs_special_vars() */ ir_variable *var; var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveIDIn"); - var->interpolation = INTERP_QUALIFIER_FLAT; + var->data.interpolation = INTERP_QUALIFIER_FLAT; var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); - var->interpolation = INTERP_QUALIFIER_FLAT; + var->data.interpolation = INTERP_QUALIFIER_FLAT; } @@ -812,7 +813,7 @@ builtin_variable_generator::generate_fs_special_vars() if (state->is_version(150, 0)) { ir_variable *var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID"); - var->interpolation = INTERP_QUALIFIER_FLAT; + var->data.interpolation = INTERP_QUALIFIER_FLAT; } /* gl_FragColor and gl_FragData were deprecated starting in desktop GLSL @@ -857,6 +858,10 @@ builtin_variable_generator::generate_fs_special_vars() */ add_output(FRAG_RESULT_SAMPLE_MASK, array(int_t, 1), "gl_SampleMask"); } + + if (state->ARB_gpu_shader5_enable) { + add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn"); + } } @@ -872,13 +877,13 @@ builtin_variable_generator::add_varying(int slot, const glsl_type *type, const char *name_as_gs_input) { switch (state->target) { - case geometry_shader: + case MESA_SHADER_GEOMETRY: this->per_vertex_in.add_field(slot, type, name); /* FALLTHROUGH */ - case vertex_shader: + case MESA_SHADER_VERTEX: this->per_vertex_out.add_field(slot, type, name); break; - case fragment_shader: + case MESA_SHADER_FRAGMENT: add_input(slot, type, name); break; } @@ -896,7 +901,7 @@ builtin_variable_generator::generate_varyings() add_varying(loc, type, name, name "In") /* gl_Position and gl_PointSize are not visible from fragment shaders. */ - if (state->target != fragment_shader) { + if (state->target != MESA_SHADER_FRAGMENT) { ADD_VARYING(VARYING_SLOT_POS, vec4_t, "gl_Position"); ADD_VARYING(VARYING_SLOT_PSIZ, float_t, "gl_PointSize"); } @@ -909,7 +914,7 @@ builtin_variable_generator::generate_varyings() if (compatibility) { ADD_VARYING(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord"); ADD_VARYING(VARYING_SLOT_FOGC, float_t, "gl_FogFragCoord"); - if (state->target == fragment_shader) { + if (state->target == MESA_SHADER_FRAGMENT) { ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_Color"); ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_SecondaryColor"); } else { @@ -921,13 +926,13 @@ builtin_variable_generator::generate_varyings() } } - if (state->target == geometry_shader) { + if (state->target == MESA_SHADER_GEOMETRY) { const glsl_type *per_vertex_in_type = this->per_vertex_in.construct_interface_instance(); add_variable("gl_in", array(per_vertex_in_type, 0), ir_var_shader_in, -1); } - if (state->target == vertex_shader || state->target == geometry_shader) { + if (state->target == MESA_SHADER_VERTEX || state->target == MESA_SHADER_GEOMETRY) { const glsl_type *per_vertex_out_type = this->per_vertex_out.construct_interface_instance(); const glsl_struct_field *fields = per_vertex_out_type->fields.structure; @@ -935,8 +940,9 @@ builtin_variable_generator::generate_varyings() ir_variable *var = add_variable(fields[i].name, fields[i].type, ir_var_shader_out, fields[i].location); - var->interpolation = fields[i].interpolation; - var->centroid = fields[i].centroid; + var->data.interpolation = fields[i].interpolation; + var->data.centroid = fields[i].centroid; + var->data.sample = fields[i].sample; var->init_interface_type(per_vertex_out_type); } } @@ -958,13 +964,13 @@ _mesa_glsl_initialize_variables(exec_list *instructions, gen.generate_varyings(); switch (state->target) { - case vertex_shader: + case MESA_SHADER_VERTEX: gen.generate_vs_special_vars(); break; - case geometry_shader: + case MESA_SHADER_GEOMETRY: gen.generate_gs_special_vars(); break; - case fragment_shader: + case MESA_SHADER_FRAGMENT: gen.generate_fs_special_vars(); break; } diff --git a/mesalib/src/glsl/glsl_lexer.ll b/mesalib/src/glsl/glsl_lexer.ll index 822d70d6b..50875bf3b 100644 --- a/mesalib/src/glsl/glsl_lexer.ll +++ b/mesalib/src/glsl/glsl_lexer.ll @@ -520,7 +520,7 @@ readonly KEYWORD(0, 300, 0, 0, READONLY); writeonly KEYWORD(0, 300, 0, 0, WRITEONLY); resource KEYWORD(0, 300, 0, 0, RESOURCE); patch KEYWORD(0, 300, 0, 0, PATCH); -sample KEYWORD(0, 300, 0, 0, SAMPLE); +sample KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE); subroutine KEYWORD(0, 300, 0, 0, SUBROUTINE); diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy index ada3690f6..39767609d 100644 --- a/mesalib/src/glsl/glsl_parser.yy +++ b/mesalib/src/glsl/glsl_parser.yy @@ -1521,7 +1521,7 @@ type_qualifier: { if ($2.has_auxiliary_storage()) { _mesa_glsl_error(&@1, state, - "duplicate auxiliary storage qualifier (centroid)"); + "duplicate auxiliary storage qualifier (centroid or sample)"); } if (!state->ARB_shading_language_420pack_enable && @@ -1571,7 +1571,12 @@ auxiliary_storage_qualifier: memset(& $$, 0, sizeof($$)); $$.flags.q.centroid = 1; } - /* TODO: "sample" and "patch" also go here someday. */ + | SAMPLE + { + memset(& $$, 0, sizeof($$)); + $$.flags.q.sample = 1; + } + /* TODO: "patch" also goes here someday. */ storage_qualifier: CONST_TOK @@ -2214,11 +2219,11 @@ basic_interface_block: * "It is illegal to have an input block in a vertex shader * or an output block in a fragment shader" */ - if ((state->target == vertex_shader) && $1.flags.q.in) { + if ((state->target == MESA_SHADER_VERTEX) && $1.flags.q.in) { _mesa_glsl_error(& @1, state, "`in' interface block is not allowed for " "a vertex shader"); - } else if ((state->target == fragment_shader) && $1.flags.q.out) { + } else if ((state->target == MESA_SHADER_FRAGMENT) && $1.flags.q.out) { _mesa_glsl_error(& @1, state, "`out' interface block is not allowed for " "a fragment shader"); @@ -2372,7 +2377,7 @@ layout_defaults: { void *ctx = state; $$ = NULL; - if (state->target != geometry_shader) { + if (state->target != MESA_SHADER_GEOMETRY) { _mesa_glsl_error(& @1, state, "input layout qualifiers only valid in " "geometry shaders"); @@ -2400,7 +2405,7 @@ layout_defaults: | layout_qualifier OUT_TOK ';' { - if (state->target != geometry_shader) { + if (state->target != MESA_SHADER_GEOMETRY) { _mesa_glsl_error(& @1, state, "out layout qualifiers only valid in " "geometry shaders"); diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp index d76d94b7a..5f19368d8 100644 --- a/mesalib/src/glsl/glsl_parser_extras.cpp +++ b/mesalib/src/glsl/glsl_parser_extras.cpp @@ -58,9 +58,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, : ctx(_ctx), switch_state() { switch (target) { - case GL_VERTEX_SHADER: this->target = vertex_shader; break; - case GL_FRAGMENT_SHADER: this->target = fragment_shader; break; - case GL_GEOMETRY_SHADER: this->target = geometry_shader; break; + case GL_VERTEX_SHADER: this->target = MESA_SHADER_VERTEX; break; + case GL_FRAGMENT_SHADER: this->target = MESA_SHADER_FRAGMENT; break; + case GL_GEOMETRY_SHADER: this->target = MESA_SHADER_GEOMETRY; break; } this->scanner = NULL; @@ -76,7 +76,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->loop_nesting_ast = NULL; this->struct_specifier_depth = 0; - this->num_builtins_to_link = 0; + + this->uses_builtin_functions = false; /* Set default language version and extensions */ this->language_version = ctx->Const.ForceGLSLVersion ? @@ -366,12 +367,12 @@ _mesa_glsl_shader_target_name(GLenum type) * our internal enum into short stage names. */ const char * -_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target) +_mesa_glsl_shader_target_name(gl_shader_type target) { switch (target) { - case vertex_shader: return "vertex"; - case fragment_shader: return "fragment"; - case geometry_shader: return "geometry"; + case MESA_SHADER_VERTEX: return "vertex"; + case MESA_SHADER_FRAGMENT: return "fragment"; + case MESA_SHADER_GEOMETRY: return "geometry"; } assert(!"Should not get here."); @@ -877,6 +878,8 @@ _mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q) if (q->flags.q.centroid) printf("centroid "); + if (q->flags.q.sample) + printf("sample "); if (q->flags.q.uniform) printf("uniform "); if (q->flags.q.smooth) @@ -1532,10 +1535,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, shader->InfoLog = state->info_log; shader->Version = state->language_version; shader->IsES = state->es_shader; - - memcpy(shader->builtins_to_link, state->builtins_to_link, - sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link); - shader->num_builtins_to_link = state->num_builtins_to_link; + shader->uses_builtin_functions = state->uses_builtin_functions; if (shader->UniformBlocks) ralloc_free(shader->UniformBlocks); diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h index d232bb3f6..622ddbac7 100644 --- a/mesalib/src/glsl/glsl_parser_extras.h +++ b/mesalib/src/glsl/glsl_parser_extras.h @@ -34,12 +34,6 @@ #include <stdlib.h> #include "glsl_symbol_table.h" -enum _mesa_glsl_parser_targets { - vertex_shader, - geometry_shader, - fragment_shader -}; - struct gl_context; struct glsl_switch_state { @@ -171,7 +165,7 @@ struct _mesa_glsl_parse_state { bool es_shader; unsigned language_version; - enum _mesa_glsl_parser_targets target; + gl_shader_type target; /** * Number of nested struct_specifier levels @@ -361,9 +355,7 @@ struct _mesa_glsl_parse_state { /** Extensions supported by the OpenGL implementation. */ const struct gl_extensions *extensions; - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; + bool uses_builtin_functions; /** * For geometry shaders, size of the most recently seen input declaration @@ -433,7 +425,7 @@ extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, * Get the textual name of the specified shader target */ extern const char * -_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target); +_mesa_glsl_shader_target_name(gl_shader_type target); #endif /* __cplusplus */ diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp index f74013096..12d4ac0ee 100644 --- a/mesalib/src/glsl/glsl_types.cpp +++ b/mesalib/src/glsl/glsl_types.cpp @@ -103,6 +103,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].location = fields[i].location; this->fields.structure[i].interpolation = fields[i].interpolation; this->fields.structure[i].centroid = fields[i].centroid; + this->fields.structure[i].sample = fields[i].sample; this->fields.structure[i].row_major = fields[i].row_major; } } @@ -130,6 +131,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].location = fields[i].location; this->fields.structure[i].interpolation = fields[i].interpolation; this->fields.structure[i].centroid = fields[i].centroid; + this->fields.structure[i].sample = fields[i].sample; this->fields.structure[i].row_major = fields[i].row_major; } } @@ -483,6 +485,9 @@ glsl_type::record_key_compare(const void *a, const void *b) if (key1->fields.structure[i].centroid != key2->fields.structure[i].centroid) return 1; + if (key1->fields.structure[i].sample + != key2->fields.structure[i].sample) + return 1; } return 0; diff --git a/mesalib/src/glsl/glsl_types.h b/mesalib/src/glsl/glsl_types.h index 96eee5e64..fb7c9288d 100644 --- a/mesalib/src/glsl/glsl_types.h +++ b/mesalib/src/glsl/glsl_types.h @@ -634,6 +634,12 @@ struct glsl_struct_field { * in ir_variable::centroid). 0 otherwise. */ unsigned centroid:1; + + /** + * For interface blocks, 1 if this variable uses sample interpolation (as + * in ir_variable::sample). 0 otherwise. + */ + unsigned sample:1; }; static inline unsigned int diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index ffff2976a..04a7b874a 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -1277,11 +1277,6 @@ ir_constant::is_basis() const ir_loop::ir_loop() { this->ir_type = ir_type_loop; - this->cmp = ir_unop_neg; - this->from = NULL; - this->to = NULL; - this->increment = NULL; - this->counter = NULL; } @@ -1364,7 +1359,7 @@ ir_dereference::is_lvalue() const /* Every l-value derference chain eventually ends in a variable. */ - if ((var == NULL) || var->read_only) + if ((var == NULL) || var->data.read_only) return false; /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: @@ -1584,29 +1579,36 @@ ir_swizzle::variable_referenced() const ir_variable::ir_variable(const struct glsl_type *type, const char *name, ir_variable_mode mode) - : max_array_access(0), max_ifc_array_access(NULL), - read_only(false), centroid(false), invariant(false), - how_declared(ir_var_declared_normally), mode(mode), - interpolation(INTERP_QUALIFIER_NONE), atomic() + : max_ifc_array_access(NULL) { this->ir_type = ir_type_variable; this->type = type; this->name = ralloc_strdup(this, name); - this->explicit_location = false; - this->has_initializer = false; - this->location = -1; - this->location_frac = 0; + this->data.explicit_location = false; + this->data.has_initializer = false; + this->data.location = -1; + this->data.location_frac = 0; this->warn_extension = NULL; this->constant_value = NULL; this->constant_initializer = NULL; - this->origin_upper_left = false; - this->pixel_center_integer = false; - this->depth_layout = ir_depth_layout_none; - this->used = false; + this->data.origin_upper_left = false; + this->data.pixel_center_integer = false; + this->data.depth_layout = ir_depth_layout_none; + this->data.used = false; + this->data.read_only = false; + this->data.centroid = false; + this->data.sample = false; + this->data.invariant = false; + this->data.how_declared = ir_var_declared_normally; + this->data.mode = mode; + this->data.interpolation = INTERP_QUALIFIER_NONE; + this->data.max_array_access = 0; + this->data.atomic.buffer_index = 0; + this->data.atomic.offset = 0; if (type != NULL) { if (type->base_type == GLSL_TYPE_SAMPLER) - this->read_only = true; + this->data.read_only = true; if (type->is_interface()) this->init_interface_type(type); @@ -1634,9 +1636,9 @@ interpolation_string(unsigned interpolation) glsl_interp_qualifier ir_variable::determine_interpolation_mode(bool flat_shade) { - if (this->interpolation != INTERP_QUALIFIER_NONE) - return (glsl_interp_qualifier) this->interpolation; - int location = this->location; + if (this->data.interpolation != INTERP_QUALIFIER_NONE) + return (glsl_interp_qualifier) this->data.interpolation; + int location = this->data.location; bool is_gl_Color = location == VARYING_SLOT_COL0 || location == VARYING_SLOT_COL1; if (flat_shade && is_gl_Color) @@ -1706,10 +1708,11 @@ ir_function_signature::qualifiers_match(exec_list *params) ir_variable *a = (ir_variable *)iter_a.get(); ir_variable *b = (ir_variable *)iter_b.get(); - if (a->read_only != b->read_only || - !modes_match(a->mode, b->mode) || - a->interpolation != b->interpolation || - a->centroid != b->centroid) { + if (a->data.read_only != b->data.read_only || + !modes_match(a->data.mode, b->data.mode) || + a->data.interpolation != b->data.interpolation || + a->data.centroid != b->data.centroid || + a->data.sample != b->data.sample) { /* parameter a's qualifiers don't match */ return a->name; @@ -1729,12 +1732,6 @@ ir_function_signature::replace_parameters(exec_list *new_params) * parameter information comes from the function prototype, it may either * specify incorrect parameter names or not have names at all. */ - foreach_iter(exec_list_iterator, iter, parameters) { - assert(((ir_instruction *) iter.get())->as_variable() != NULL); - - iter.remove(); - } - new_params->move_nodes_to(¶meters); } @@ -1899,9 +1896,9 @@ vertices_per_prim(GLenum prim) const char * mode_string(const ir_variable *var) { - switch (var->mode) { + switch (var->data.mode) { case ir_var_auto: - return (var->read_only) ? "global constant" : "global variable"; + return (var->data.read_only) ? "global constant" : "global variable"; case ir_var_uniform: return "uniform"; diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h index 4f775da4b..780959b73 100644 --- a/mesalib/src/glsl/ir.h +++ b/mesalib/src/glsl/ir.h @@ -86,6 +86,7 @@ enum ir_node_type { ir_type_max /**< maximum ir_type enum number, for validation */ }; + /** * Base class of all IR instructions */ @@ -402,7 +403,7 @@ public: */ inline bool is_in_uniform_block() const { - return this->mode == ir_var_uniform && this->interface_type != NULL; + return this->data.mode == ir_var_uniform && this->interface_type != NULL; } /** @@ -502,13 +503,6 @@ public: const char *name; /** - * Highest element accessed with a constant expression array index - * - * Not used for non-array variables. - */ - unsigned max_array_access; - - /** * For variables which satisfy the is_interface_instance() predicate, this * points to an array of integers such that if the ith member of the * interface block is an array, max_ifc_array_access[i] is the maximum @@ -521,177 +515,189 @@ public: */ unsigned *max_ifc_array_access; - /** - * Is the variable read-only? - * - * This is set for variables declared as \c const, shader inputs, - * and uniforms. - */ - unsigned read_only:1; - unsigned centroid:1; - unsigned invariant:1; - - /** - * Has this variable been used for reading or writing? - * - * Several GLSL semantic checks require knowledge of whether or not a - * variable has been used. For example, it is an error to redeclare a - * variable as invariant after it has been used. - * - * This is only maintained in the ast_to_hir.cpp path, not in - * Mesa's fixed function or ARB program paths. - */ - unsigned used:1; - - /** - * Has this variable been statically assigned? - * - * This answers whether the variable was assigned in any path of - * the shader during ast_to_hir. This doesn't answer whether it is - * still written after dead code removal, nor is it maintained in - * non-ast_to_hir.cpp (GLSL parsing) paths. - */ - unsigned assigned:1; - - /** - * Enum indicating how the variable was declared. See - * ir_var_declaration_type. - * - * This is used to detect certain kinds of illegal variable redeclarations. - */ - unsigned how_declared:2; - - /** - * Storage class of the variable. - * - * \sa ir_variable_mode - */ - unsigned mode:4; - - /** - * Interpolation mode for shader inputs / outputs - * - * \sa ir_variable_interpolation - */ - unsigned interpolation:2; - - /** - * \name ARB_fragment_coord_conventions - * @{ - */ - unsigned origin_upper_left:1; - unsigned pixel_center_integer:1; - /*@}*/ + struct ir_variable_data { - /** - * Was the location explicitly set in the shader? - * - * If the location is explicitly set in the shader, it \b cannot be changed - * by the linker or by the API (e.g., calls to \c glBindAttribLocation have - * no effect). - */ - unsigned explicit_location:1; - unsigned explicit_index:1; - - /** - * Was an initial binding explicitly set in the shader? - * - * If so, constant_value contains an integer ir_constant representing the - * initial binding point. - */ - unsigned explicit_binding:1; + /** + * Is the variable read-only? + * + * This is set for variables declared as \c const, shader inputs, + * and uniforms. + */ + unsigned read_only:1; + unsigned centroid:1; + unsigned sample:1; + unsigned invariant:1; + + /** + * Has this variable been used for reading or writing? + * + * Several GLSL semantic checks require knowledge of whether or not a + * variable has been used. For example, it is an error to redeclare a + * variable as invariant after it has been used. + * + * This is only maintained in the ast_to_hir.cpp path, not in + * Mesa's fixed function or ARB program paths. + */ + unsigned used:1; + + /** + * Has this variable been statically assigned? + * + * This answers whether the variable was assigned in any path of + * the shader during ast_to_hir. This doesn't answer whether it is + * still written after dead code removal, nor is it maintained in + * non-ast_to_hir.cpp (GLSL parsing) paths. + */ + unsigned assigned:1; - /** - * Does this variable have an initializer? - * - * This is used by the linker to cross-validiate initializers of global - * variables. - */ - unsigned has_initializer:1; + /** + * Enum indicating how the variable was declared. See + * ir_var_declaration_type. + * + * This is used to detect certain kinds of illegal variable redeclarations. + */ + unsigned how_declared:2; - /** - * Is this variable a generic output or input that has not yet been matched - * up to a variable in another stage of the pipeline? - * - * This is used by the linker as scratch storage while assigning locations - * to generic inputs and outputs. - */ - unsigned is_unmatched_generic_inout:1; + /** + * Storage class of the variable. + * + * \sa ir_variable_mode + */ + unsigned mode:4; - /** - * If non-zero, then this variable may be packed along with other variables - * into a single varying slot, so this offset should be applied when - * accessing components. For example, an offset of 1 means that the x - * component of this variable is actually stored in component y of the - * location specified by \c location. - */ - unsigned location_frac:2; + /** + * Interpolation mode for shader inputs / outputs + * + * \sa ir_variable_interpolation + */ + unsigned interpolation:2; - /** - * Non-zero if this variable was created by lowering a named interface - * block which was not an array. - * - * Note that this variable and \c from_named_ifc_block_array will never - * both be non-zero. - */ - unsigned from_named_ifc_block_nonarray:1; + /** + * \name ARB_fragment_coord_conventions + * @{ + */ + unsigned origin_upper_left:1; + unsigned pixel_center_integer:1; + /*@}*/ + + /** + * Was the location explicitly set in the shader? + * + * If the location is explicitly set in the shader, it \b cannot be changed + * by the linker or by the API (e.g., calls to \c glBindAttribLocation have + * no effect). + */ + unsigned explicit_location:1; + unsigned explicit_index:1; + + /** + * Was an initial binding explicitly set in the shader? + * + * If so, constant_value contains an integer ir_constant representing the + * initial binding point. + */ + unsigned explicit_binding:1; - /** - * Non-zero if this variable was created by lowering a named interface - * block which was an array. - * - * Note that this variable and \c from_named_ifc_block_nonarray will never - * both be non-zero. - */ - unsigned from_named_ifc_block_array:1; + /** + * Does this variable have an initializer? + * + * This is used by the linker to cross-validiate initializers of global + * variables. + */ + unsigned has_initializer:1; + + /** + * Is this variable a generic output or input that has not yet been matched + * up to a variable in another stage of the pipeline? + * + * This is used by the linker as scratch storage while assigning locations + * to generic inputs and outputs. + */ + unsigned is_unmatched_generic_inout:1; + + /** + * If non-zero, then this variable may be packed along with other variables + * into a single varying slot, so this offset should be applied when + * accessing components. For example, an offset of 1 means that the x + * component of this variable is actually stored in component y of the + * location specified by \c location. + */ + unsigned location_frac:2; + + /** + * Non-zero if this variable was created by lowering a named interface + * block which was not an array. + * + * Note that this variable and \c from_named_ifc_block_array will never + * both be non-zero. + */ + unsigned from_named_ifc_block_nonarray:1; + + /** + * Non-zero if this variable was created by lowering a named interface + * block which was an array. + * + * Note that this variable and \c from_named_ifc_block_nonarray will never + * both be non-zero. + */ + unsigned from_named_ifc_block_array:1; - /** - * \brief Layout qualifier for gl_FragDepth. - * - * This is not equal to \c ir_depth_layout_none if and only if this - * variable is \c gl_FragDepth and a layout qualifier is specified. - */ - ir_depth_layout depth_layout; + /** + * \brief Layout qualifier for gl_FragDepth. + * + * This is not equal to \c ir_depth_layout_none if and only if this + * variable is \c gl_FragDepth and a layout qualifier is specified. + */ + ir_depth_layout depth_layout; + + /** + * Storage location of the base of this variable + * + * The precise meaning of this field depends on the nature of the variable. + * + * - Vertex shader input: one of the values from \c gl_vert_attrib. + * - Vertex shader output: one of the values from \c gl_varying_slot. + * - Geometry shader input: one of the values from \c gl_varying_slot. + * - Geometry shader output: one of the values from \c gl_varying_slot. + * - Fragment shader input: one of the values from \c gl_varying_slot. + * - Fragment shader output: one of the values from \c gl_frag_result. + * - Uniforms: Per-stage uniform slot number for default uniform block. + * - Uniforms: Index within the uniform block definition for UBO members. + * - Other: This field is not currently used. + * + * If the variable is a uniform, shader input, or shader output, and the + * slot has not been assigned, the value will be -1. + */ + int location; - /** - * Storage location of the base of this variable - * - * The precise meaning of this field depends on the nature of the variable. - * - * - Vertex shader input: one of the values from \c gl_vert_attrib. - * - Vertex shader output: one of the values from \c gl_varying_slot. - * - Geometry shader input: one of the values from \c gl_varying_slot. - * - Geometry shader output: one of the values from \c gl_varying_slot. - * - Fragment shader input: one of the values from \c gl_varying_slot. - * - Fragment shader output: one of the values from \c gl_frag_result. - * - Uniforms: Per-stage uniform slot number for default uniform block. - * - Uniforms: Index within the uniform block definition for UBO members. - * - Other: This field is not currently used. - * - * If the variable is a uniform, shader input, or shader output, and the - * slot has not been assigned, the value will be -1. - */ - int location; + /** + * output index for dual source blending. + */ + int index; - /** - * output index for dual source blending. - */ - int index; + /** + * Initial binding point for a sampler or UBO. + * + * For array types, this represents the binding point for the first element. + */ + int binding; - /** - * Initial binding point for a sampler or UBO. - * - * For array types, this represents the binding point for the first element. - */ - int binding; + /** + * Location an atomic counter is stored at. + */ + struct { + unsigned buffer_index; + unsigned offset; + } atomic; + + /** + * Highest element accessed with a constant expression array index + * + * Not used for non-array variables. + */ + unsigned max_array_access; - /** - * Location an atomic counter is stored at. - */ - struct { - unsigned buffer_index; - unsigned offset; - } atomic; + } data; /** * Built-in state that backs this uniform @@ -1022,34 +1028,6 @@ public: /** List of ir_instruction that make up the body of the loop. */ exec_list body_instructions; - - /** - * \name Loop counter and controls - * - * Represents a loop like a FORTRAN \c do-loop. - * - * \note - * If \c from and \c to are the same value, the loop will execute once. - */ - /*@{*/ - ir_rvalue *from; /** Value of the loop counter on the first - * iteration of the loop. - */ - ir_rvalue *to; /** Value of the loop counter on the last - * iteration of the loop. - */ - ir_rvalue *increment; - ir_variable *counter; - - /** - * Comparison operation in the loop terminator. - * - * If any of the loop control fields are non-\c NULL, this field must be - * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal, - * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal. - */ - int cmp; - /*@}*/ }; @@ -2344,6 +2322,9 @@ extern ir_function_signature * _mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state, const char *name, exec_list *actual_parameters); +extern gl_shader * +_mesa_glsl_get_builtin_function_shader(void); + extern void _mesa_glsl_release_functions(void); diff --git a/mesalib/src/glsl/ir_clone.cpp b/mesalib/src/glsl/ir_clone.cpp index 40ed33afc..4e5cf68ca 100644 --- a/mesalib/src/glsl/ir_clone.cpp +++ b/mesalib/src/glsl/ir_clone.cpp @@ -41,35 +41,19 @@ ir_variable * ir_variable::clone(void *mem_ctx, struct hash_table *ht) const { ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name, - (ir_variable_mode) this->mode); + (ir_variable_mode) this->data.mode); - var->max_array_access = this->max_array_access; + var->data.max_array_access = this->data.max_array_access; if (this->is_interface_instance()) { var->max_ifc_array_access = rzalloc_array(var, unsigned, this->interface_type->length); memcpy(var->max_ifc_array_access, this->max_ifc_array_access, this->interface_type->length * sizeof(unsigned)); } - var->read_only = this->read_only; - var->centroid = this->centroid; - var->invariant = this->invariant; - var->interpolation = this->interpolation; - var->location = this->location; - var->index = this->index; - var->binding = this->binding; - var->atomic.buffer_index = this->atomic.buffer_index; - var->atomic.offset = this->atomic.offset; + + memcpy(&var->data, &this->data, sizeof(var->data)); + var->warn_extension = this->warn_extension; - var->origin_upper_left = this->origin_upper_left; - var->pixel_center_integer = this->pixel_center_integer; - var->explicit_location = this->explicit_location; - var->explicit_index = this->explicit_index; - var->explicit_binding = this->explicit_binding; - var->has_initializer = this->has_initializer; - var->depth_layout = this->depth_layout; - var->assigned = this->assigned; - var->how_declared = this->how_declared; - var->used = this->used; var->num_state_slots = this->num_state_slots; if (this->state_slots) { @@ -157,20 +141,11 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const { ir_loop *new_loop = new(mem_ctx) ir_loop(); - if (this->from) - new_loop->from = this->from->clone(mem_ctx, ht); - if (this->to) - new_loop->to = this->to->clone(mem_ctx, ht); - if (this->increment) - new_loop->increment = this->increment->clone(mem_ctx, ht); - new_loop->counter = counter; - foreach_iter(exec_list_iterator, iter, this->body_instructions) { ir_instruction *ir = (ir_instruction *)iter.get(); new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht)); } - new_loop->cmp = this->cmp; return new_loop; } diff --git a/mesalib/src/glsl/ir_constant_expression.cpp b/mesalib/src/glsl/ir_constant_expression.cpp index 0efd1d5b3..7ca865e22 100644 --- a/mesalib/src/glsl/ir_constant_expression.cpp +++ b/mesalib/src/glsl/ir_constant_expression.cpp @@ -1583,7 +1583,7 @@ ir_dereference_variable::constant_expression_value(struct hash_table *variable_c /* The constant_value of a uniform variable is its initializer, * not the lifetime constant value of the uniform. */ - if (var->mode == ir_var_uniform) + if (var->data.mode == ir_var_uniform) return NULL; if (!var->constant_value) diff --git a/mesalib/src/glsl/ir_function.cpp b/mesalib/src/glsl/ir_function.cpp index 53cf469d9..bd5318d23 100644 --- a/mesalib/src/glsl/ir_function.cpp +++ b/mesalib/src/glsl/ir_function.cpp @@ -66,7 +66,7 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) /* Try to find an implicit conversion from actual to param. */ inexact_match = true; - switch ((enum ir_variable_mode)(param->mode)) { + switch ((enum ir_variable_mode)(param->data.mode)) { case ir_var_auto: case ir_var_uniform: case ir_var_temporary: diff --git a/mesalib/src/glsl/ir_hv_accept.cpp b/mesalib/src/glsl/ir_hv_accept.cpp index 941b25e97..2a1f70e5b 100644 --- a/mesalib/src/glsl/ir_hv_accept.cpp +++ b/mesalib/src/glsl/ir_hv_accept.cpp @@ -91,26 +91,6 @@ ir_loop::accept(ir_hierarchical_visitor *v) if (s == visit_stop) return s; - if (s != visit_continue_with_parent) { - if (this->from) { - s = this->from->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - - if (this->to) { - s = this->to->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - - if (this->increment) { - s = this->increment->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - } - return v->visit_leave(this); } diff --git a/mesalib/src/glsl/ir_print_visitor.cpp b/mesalib/src/glsl/ir_print_visitor.cpp index f85e573c4..01c5f7f1c 100644 --- a/mesalib/src/glsl/ir_print_visitor.cpp +++ b/mesalib/src/glsl/ir_print_visitor.cpp @@ -148,8 +148,9 @@ void ir_print_visitor::visit(ir_variable *ir) { printf("(declare "); - const char *const cent = (ir->centroid) ? "centroid " : ""; - const char *const inv = (ir->invariant) ? "invariant " : ""; + const char *const cent = (ir->data.centroid) ? "centroid " : ""; + const char *const samp = (ir->data.sample) ? "sample " : ""; + const char *const inv = (ir->data.invariant) ? "invariant " : ""; const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ", "in ", "out ", "inout ", "const_in ", "sys ", "temporary " }; @@ -157,8 +158,8 @@ void ir_print_visitor::visit(ir_variable *ir) const char *const interp[] = { "", "smooth", "flat", "noperspective" }; STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT); - printf("(%s%s%s%s) ", - cent, inv, mode[ir->mode], interp[ir->interpolation]); + printf("(%s%s%s%s%s) ", + cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]); print_type(ir->type); printf(" %s)", unique_name(ir)); @@ -416,9 +417,9 @@ void ir_print_visitor::visit(ir_constant *ir) if (ir->value.f[i] == 0.0f) /* 0.0 == -0.0, so print with %f to get the proper sign. */ printf("%.1f", ir->value.f[i]); - else if (abs(ir->value.f[i]) < 0.000001f) + else if (fabs(ir->value.f[i]) < 0.000001f) printf("%a", ir->value.f[i]); - else if (abs(ir->value.f[i]) > 1000000.0f) + else if (fabs(ir->value.f[i]) > 1000000.0f) printf("%e", ir->value.f[i]); else printf("%f", ir->value.f[i]); @@ -522,19 +523,7 @@ ir_print_visitor::visit(ir_if *ir) void ir_print_visitor::visit(ir_loop *ir) { - printf("(loop ("); - if (ir->counter != NULL) - ir->counter->accept(this); - printf(") ("); - if (ir->from != NULL) - ir->from->accept(this); - printf(") ("); - if (ir->to != NULL) - ir->to->accept(this); - printf(") ("); - if (ir->increment != NULL) - ir->increment->accept(this); - printf(") (\n"); + printf("(loop (\n"); indentation++; foreach_iter(exec_list_iterator, iter, ir->body_instructions) { diff --git a/mesalib/src/glsl/ir_reader.cpp b/mesalib/src/glsl/ir_reader.cpp index 00e2db9a3..7970112ec 100644 --- a/mesalib/src/glsl/ir_reader.cpp +++ b/mesalib/src/glsl/ir_reader.cpp @@ -412,33 +412,35 @@ ir_reader::read_declaration(s_expression *expr) // FINISHME: Check for duplicate/conflicting qualifiers. if (strcmp(qualifier->value(), "centroid") == 0) { - var->centroid = 1; + var->data.centroid = 1; + } else if (strcmp(qualifier->value(), "sample") == 0) { + var->data.sample = 1; } else if (strcmp(qualifier->value(), "invariant") == 0) { - var->invariant = 1; + var->data.invariant = 1; } else if (strcmp(qualifier->value(), "uniform") == 0) { - var->mode = ir_var_uniform; + var->data.mode = ir_var_uniform; } else if (strcmp(qualifier->value(), "auto") == 0) { - var->mode = ir_var_auto; + var->data.mode = ir_var_auto; } else if (strcmp(qualifier->value(), "in") == 0) { - var->mode = ir_var_function_in; + var->data.mode = ir_var_function_in; } else if (strcmp(qualifier->value(), "shader_in") == 0) { - var->mode = ir_var_shader_in; + var->data.mode = ir_var_shader_in; } else if (strcmp(qualifier->value(), "const_in") == 0) { - var->mode = ir_var_const_in; + var->data.mode = ir_var_const_in; } else if (strcmp(qualifier->value(), "out") == 0) { - var->mode = ir_var_function_out; + var->data.mode = ir_var_function_out; } else if (strcmp(qualifier->value(), "shader_out") == 0) { - var->mode = ir_var_shader_out; + var->data.mode = ir_var_shader_out; } else if (strcmp(qualifier->value(), "inout") == 0) { - var->mode = ir_var_function_inout; + var->data.mode = ir_var_function_inout; } else if (strcmp(qualifier->value(), "temporary") == 0) { - var->mode = ir_var_temporary; + var->data.mode = ir_var_temporary; } else if (strcmp(qualifier->value(), "smooth") == 0) { - var->interpolation = INTERP_QUALIFIER_SMOOTH; + var->data.interpolation = INTERP_QUALIFIER_SMOOTH; } else if (strcmp(qualifier->value(), "flat") == 0) { - var->interpolation = INTERP_QUALIFIER_FLAT; + var->data.interpolation = INTERP_QUALIFIER_FLAT; } else if (strcmp(qualifier->value(), "noperspective") == 0) { - var->interpolation = INTERP_QUALIFIER_NOPERSPECTIVE; + var->data.interpolation = INTERP_QUALIFIER_NOPERSPECTIVE; } else { ir_read_error(expr, "unknown qualifier: %s", qualifier->value()); return NULL; @@ -486,18 +488,16 @@ ir_reader::read_if(s_expression *expr, ir_loop *loop_ctx) ir_loop * ir_reader::read_loop(s_expression *expr) { - s_expression *s_counter, *s_from, *s_to, *s_inc, *s_body; + s_expression *s_body; - s_pattern pat[] = { "loop", s_counter, s_from, s_to, s_inc, s_body }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (loop <counter> <from> <to> " - "<increment> <body>)"); + s_pattern loop_pat[] = { "loop", s_body }; + if (!MATCH(expr, loop_pat)) { + ir_read_error(expr, "expected (loop <body>)"); return NULL; } - // FINISHME: actually read the count/from/to fields. - ir_loop *loop = new(mem_ctx) ir_loop; + read_instructions(&loop->body_instructions, s_body, loop); if (state->error) { delete loop; diff --git a/mesalib/src/glsl/ir_set_program_inouts.cpp b/mesalib/src/glsl/ir_set_program_inouts.cpp index ab23538c3..0b49eb2b6 100644 --- a/mesalib/src/glsl/ir_set_program_inouts.cpp +++ b/mesalib/src/glsl/ir_set_program_inouts.cpp @@ -27,7 +27,7 @@ * Sets the InputsRead and OutputsWritten of Mesa programs. * * Additionally, for fragment shaders, sets the InterpQualifier array, the - * IsCentroid bitfield, and the UsesDFdy flag. + * IsCentroid and IsSample bitfields, and the UsesDFdy flag. * * Mesa programs (gl_program, not gl_shader_program) have a set of * flags indicating which varyings are read and written. Computing @@ -75,9 +75,9 @@ private: static inline bool is_shader_inout(ir_variable *var) { - return var->mode == ir_var_shader_in || - var->mode == ir_var_shader_out || - var->mode == ir_var_system_value; + return var->data.mode == ir_var_shader_in || + var->data.mode == ir_var_shader_out || + var->data.mode == ir_var_system_value; } static void @@ -93,20 +93,24 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len, */ for (int i = 0; i < len; i++) { - GLbitfield64 bitfield = BITFIELD64_BIT(var->location + var->index + offset + i); - if (var->mode == ir_var_shader_in) { + GLbitfield64 bitfield = + BITFIELD64_BIT(var->data.location + var->data.index + offset + i); + if (var->data.mode == ir_var_shader_in) { prog->InputsRead |= bitfield; if (is_fragment_shader) { gl_fragment_program *fprog = (gl_fragment_program *) prog; - fprog->InterpQualifier[var->location + var->index + offset + i] = - (glsl_interp_qualifier) var->interpolation; - if (var->centroid) + fprog->InterpQualifier[var->data.location + + var->data.index + offset + i] = + (glsl_interp_qualifier) var->data.interpolation; + if (var->data.centroid) fprog->IsCentroid |= bitfield; + if (var->data.sample) + fprog->IsSample |= bitfield; } - } else if (var->mode == ir_var_system_value) { + } else if (var->data.mode == ir_var_system_value) { prog->SystemValuesRead |= bitfield; } else { - assert(var->mode == ir_var_shader_out); + assert(var->data.mode == ir_var_shader_out); prog->OutputsWritten |= bitfield; } } @@ -121,7 +125,7 @@ ir_set_program_inouts_visitor::mark_whole_variable(ir_variable *var) { const glsl_type *type = var->type; if (this->shader_type == GL_GEOMETRY_SHADER && - var->mode == ir_var_shader_in && type->is_array()) { + var->data.mode == ir_var_shader_in && type->is_array()) { type = type->fields.array; } @@ -160,7 +164,7 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var, const glsl_type *type = var->type; if (this->shader_type == GL_GEOMETRY_SHADER && - var->mode == ir_var_shader_in) { + var->data.mode == ir_var_shader_in) { /* The only geometry shader input that is not an array is * gl_PrimitiveIDIn, and in that case, this code will never be reached, * because gl_PrimitiveIDIn can't be indexed into in array fashion. @@ -242,7 +246,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir) if (ir_dereference_variable * const deref_var = inner_array->array->as_dereference_variable()) { if (this->shader_type == GL_GEOMETRY_SHADER && - deref_var->var->mode == ir_var_shader_in) { + deref_var->var->data.mode == ir_var_shader_in) { /* foo is a geometry shader input, so i is the vertex, and j the * part of the input we're accessing. */ @@ -261,7 +265,7 @@ ir_set_program_inouts_visitor::visit_enter(ir_dereference_array *ir) ir->array->as_dereference_variable()) { /* ir => foo[i], where foo is a variable. */ if (this->shader_type == GL_GEOMETRY_SHADER && - deref_var->var->mode == ir_var_shader_in) { + deref_var->var->data.mode == ir_var_shader_in) { /* foo is a geometry shader input, so i is the vertex, and we're * accessing the entire input. */ @@ -341,6 +345,7 @@ do_set_program_inouts(exec_list *instructions, struct gl_program *prog, gl_fragment_program *fprog = (gl_fragment_program *) prog; memset(fprog->InterpQualifier, 0, sizeof(fprog->InterpQualifier)); fprog->IsCentroid = 0; + fprog->IsSample = 0; fprog->UsesDFdy = false; fprog->UsesKill = false; } diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp index 13e41a089..4bbb3ce65 100644 --- a/mesalib/src/glsl/ir_validate.cpp +++ b/mesalib/src/glsl/ir_validate.cpp @@ -63,7 +63,6 @@ public: virtual ir_visitor_status visit_enter(ir_if *ir); - virtual ir_visitor_status visit_leave(ir_loop *ir); virtual ir_visitor_status visit_enter(ir_function *ir); virtual ir_visitor_status visit_leave(ir_function *ir); virtual ir_visitor_status visit_enter(ir_function_signature *ir); @@ -149,42 +148,6 @@ ir_validate::visit_enter(ir_if *ir) ir_visitor_status -ir_validate::visit_leave(ir_loop *ir) -{ - if (ir->counter != NULL) { - if ((ir->from == NULL) || (ir->to == NULL) || (ir->increment == NULL)) { - printf("ir_loop has invalid loop controls:\n" - " counter: %p\n" - " from: %p\n" - " to: %p\n" - " increment: %p\n", - (void *) ir->counter, (void *) ir->from, (void *) ir->to, - (void *) ir->increment); - abort(); - } - - if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) { - printf("ir_loop has invalid comparitor %d\n", ir->cmp); - abort(); - } - } else { - if ((ir->from != NULL) || (ir->to != NULL) || (ir->increment != NULL)) { - printf("ir_loop has invalid loop controls:\n" - " counter: %p\n" - " from: %p\n" - " to: %p\n" - " increment: %p\n", - (void *) ir->counter, (void *) ir->from, (void *) ir->to, - (void *) ir->increment); - abort(); - } - } - - return visit_continue; -} - - -ir_visitor_status ir_validate::visit_enter(ir_function *ir) { /* Function definitions cannot be nested. @@ -679,9 +642,9 @@ ir_validate::visit(ir_variable *ir) * to be out of bounds. */ if (ir->type->array_size() > 0) { - if (ir->max_array_access >= ir->type->length) { + if (ir->data.max_array_access >= ir->type->length) { printf("ir_variable has maximum access out of bounds (%d vs %d)\n", - ir->max_array_access, ir->type->length - 1); + ir->data.max_array_access, ir->type->length - 1); ir->print(); abort(); } @@ -707,7 +670,7 @@ ir_validate::visit(ir_variable *ir) } } - if (ir->constant_initializer != NULL && !ir->has_initializer) { + if (ir->constant_initializer != NULL && !ir->data.has_initializer) { printf("ir_variable didn't have an initializer, but has a constant " "initializer value.\n"); ir->print(); @@ -789,8 +752,8 @@ ir_validate::visit_enter(ir_call *ir) printf("ir_call parameter type mismatch:\n"); goto dump_ir; } - if (formal_param->mode == ir_var_function_out - || formal_param->mode == ir_var_function_inout) { + if (formal_param->data.mode == ir_var_function_out + || formal_param->data.mode == ir_var_function_inout) { if (!actual_param->is_lvalue()) { printf("ir_call out/inout parameters must be lvalues:\n"); goto dump_ir; diff --git a/mesalib/src/glsl/link_atomics.cpp b/mesalib/src/glsl/link_atomics.cpp index 2466bbd79..33903ad54 100644 --- a/mesalib/src/glsl/link_atomics.cpp +++ b/mesalib/src/glsl/link_atomics.cpp @@ -73,16 +73,16 @@ namespace { const active_atomic_counter *const first = (active_atomic_counter *) a; const active_atomic_counter *const second = (active_atomic_counter *) b; - return int(first->var->atomic.offset) - int(second->var->atomic.offset); + return int(first->var->data.atomic.offset) - int(second->var->data.atomic.offset); } bool check_atomic_counters_overlap(const ir_variable *x, const ir_variable *y) { - return ((x->atomic.offset >= y->atomic.offset && - x->atomic.offset < y->atomic.offset + y->type->atomic_size()) || - (y->atomic.offset >= x->atomic.offset && - y->atomic.offset < x->atomic.offset + x->type->atomic_size())); + return ((x->data.atomic.offset >= y->data.atomic.offset && + x->data.atomic.offset < y->data.atomic.offset + y->type->atomic_size()) || + (y->data.atomic.offset >= x->data.atomic.offset && + y->data.atomic.offset < x->data.atomic.offset + x->type->atomic_size())); } active_atomic_buffer * @@ -107,7 +107,7 @@ namespace { unsigned id; bool found = prog->UniformHash->get(id, var->name); assert(found); - active_atomic_buffer *buf = &buffers[var->binding]; + active_atomic_buffer *buf = &buffers[var->data.binding]; /* If this is the first time the buffer is used, increment * the counter of buffers used. @@ -118,7 +118,7 @@ namespace { buf->push_back(id, var); buf->stage_references[i]++; - buf->size = MAX2(buf->size, var->atomic.offset + + buf->size = MAX2(buf->size, var->data.atomic.offset + var->type->atomic_size()); } } @@ -143,7 +143,7 @@ namespace { linker_error(prog, "Atomic counter %s declared at offset %d " "which is already in use.", buffers[i].counters[j].var->name, - buffers[i].counters[j].var->atomic.offset); + buffers[i].counters[j].var->data.atomic.offset); } } } @@ -190,9 +190,9 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, gl_uniform_storage *const storage = &prog->UniformStorage[id]; mab.Uniforms[j] = id; - var->atomic.buffer_index = i; + var->data.atomic.buffer_index = i; storage->atomic_buffer_index = i; - storage->offset = var->atomic.offset; + storage->offset = var->data.atomic.offset; storage->array_stride = (var->type->is_array() ? var->type->element_type()->atomic_size() : 0); } diff --git a/mesalib/src/glsl/link_functions.cpp b/mesalib/src/glsl/link_functions.cpp index 68aa62032..56f3f207e 100644 --- a/mesalib/src/glsl/link_functions.cpp +++ b/mesalib/src/glsl/link_functions.cpp @@ -201,8 +201,9 @@ public: if (formal_param->type->is_array()) { ir_dereference_variable *deref = actual_param->as_dereference_variable(); if (deref && deref->var && deref->var->type->is_array()) { - deref->var->max_array_access = - MAX2(formal_param->max_array_access, deref->var->max_array_access); + deref->var->data.max_array_access = + MAX2(formal_param->data.max_array_access, + deref->var->data.max_array_access); } } } @@ -234,8 +235,9 @@ public: * we need to track the maximal access to the array as linking * pulls more functions in that access the array. */ - var->max_array_access = - MAX2(var->max_array_access, ir->var->max_array_access); + var->data.max_array_access = + MAX2(var->data.max_array_access, + ir->var->data.max_array_access); if (var->type->length == 0 && ir->var->type->length != 0) var->type = ir->var->type; diff --git a/mesalib/src/glsl/link_interface_blocks.cpp b/mesalib/src/glsl/link_interface_blocks.cpp index 6900fa94e..476963642 100644 --- a/mesalib/src/glsl/link_interface_blocks.cpp +++ b/mesalib/src/glsl/link_interface_blocks.cpp @@ -60,7 +60,7 @@ struct interface_block_definition if (var->type->is_array()) array_size = var->type->length; } - explicitly_declared = (var->how_declared != ir_var_declared_implicitly); + explicitly_declared = (var->data.how_declared != ir_var_declared_implicitly); } /** @@ -270,7 +270,7 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog, continue; interface_block_definitions *definitions; - switch (var->mode) { + switch (var->data.mode) { case ir_var_shader_in: definitions = &in_interfaces; break; @@ -298,7 +298,7 @@ validate_intrastage_interface_blocks(struct gl_shader_program *prog, */ definitions->store(def); } else if (!intrastage_match(prev_def, &def, - (ir_variable_mode) var->mode)) { + (ir_variable_mode) var->data.mode)) { linker_error(prog, "definitions of interface block `%s' do not" " match\n", iface_type->name); return; @@ -318,7 +318,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog, /* Add input interfaces from the consumer to the symbol table. */ foreach_list(node, consumer->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); - if (!var || !var->get_interface_type() || var->mode != ir_var_shader_in) + if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_in) continue; definitions.store(interface_block_definition(var)); @@ -327,7 +327,7 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog, /* Verify that the producer's output interfaces match. */ foreach_list(node, producer->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); - if (!var || !var->get_interface_type() || var->mode != ir_var_shader_out) + if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_out) continue; interface_block_definition *consumer_def = @@ -361,7 +361,7 @@ validate_interstage_uniform_blocks(struct gl_shader_program *prog, const gl_shader *stage = stages[i]; foreach_list(node, stage->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); - if (!var || !var->get_interface_type() || var->mode != ir_var_uniform) + if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform) continue; interface_block_definition *old_def = diff --git a/mesalib/src/glsl/link_uniform_initializers.cpp b/mesalib/src/glsl/link_uniform_initializers.cpp index 786aaf0b4..04daa1760 100644 --- a/mesalib/src/glsl/link_uniform_initializers.cpp +++ b/mesalib/src/glsl/link_uniform_initializers.cpp @@ -224,15 +224,15 @@ link_set_uniform_initializers(struct gl_shader_program *prog) foreach_list(node, shader->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (!var || var->mode != ir_var_uniform) + if (!var || var->data.mode != ir_var_uniform) continue; if (!mem_ctx) mem_ctx = ralloc_context(NULL); - if (var->explicit_binding) { + if (var->data.explicit_binding) { linker::set_uniform_binding(mem_ctx, prog, var->name, - var->type, var->binding); + var->type, var->data.binding); } else if (var->constant_value) { linker::set_uniform_initializer(mem_ctx, prog, var->name, var->type, var->constant_value); diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index 0a15739c2..bda6e4ffb 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -75,7 +75,7 @@ program_resource_visitor::process(ir_variable *var) */ /* Only strdup the name if we actually will need to modify it. */ - if (var->from_named_ifc_block_array) { + if (var->data.from_named_ifc_block_array) { /* lower_named_interface_blocks created this variable by lowering an * interface block array to an array variable. For example if the * original source code was: @@ -108,7 +108,7 @@ program_resource_visitor::process(ir_variable *var) recursion(var->type, &name, new_length, false, NULL); } ralloc_free(name); - } else if (var->from_named_ifc_block_nonarray) { + } else if (var->data.from_named_ifc_block_nonarray) { /* lower_named_interface_blocks created this variable by lowering a * named interface block (non-array) to an ordinary variable. For * example if the original source code was: @@ -408,10 +408,10 @@ public: const struct gl_uniform_block *const block = &prog->UniformBlocks[ubo_block_index]; - assert(var->location != -1); + assert(var->data.location != -1); const struct gl_uniform_buffer_variable *const ubo_var = - &block->Uniforms[var->location]; + &block->Uniforms[var->data.location]; ubo_row_major = ubo_var->RowMajor; ubo_byte_offset = ubo_var->Offset; @@ -637,10 +637,10 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if ((var == NULL) || !var->is_in_uniform_block()) continue; - assert(var->mode == ir_var_uniform); + assert(var->data.mode == ir_var_uniform); if (var->is_interface_instance()) { - var->location = 0; + var->data.location = 0; continue; } @@ -669,13 +669,13 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) if (strncmp(var->name, begin, l) == 0) { found = true; - var->location = j; + var->data.location = j; break; } } else if (!strcmp(var->name, shader->UniformBlocks[i].Uniforms[j].Name)) { found = true; - var->location = j; + var->data.location = j; break; } } @@ -767,7 +767,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform)) + if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! @@ -818,7 +818,7 @@ link_assign_uniform_locations(struct gl_shader_program *prog) foreach_list(node, prog->_LinkedShaders[i]->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform)) + if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! diff --git a/mesalib/src/glsl/link_varyings.cpp b/mesalib/src/glsl/link_varyings.cpp index be36b5f8f..229a4cb85 100644 --- a/mesalib/src/glsl/link_varyings.cpp +++ b/mesalib/src/glsl/link_varyings.cpp @@ -93,31 +93,43 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, /* Check that all of the qualifiers match between stages. */ - if (input->centroid != output->centroid) { + if (input->data.centroid != output->data.centroid) { linker_error(prog, "%s shader output `%s' %s centroid qualifier, " "but %s shader input %s centroid qualifier\n", _mesa_glsl_shader_target_name(producer_type), output->name, - (output->centroid) ? "has" : "lacks", + (output->data.centroid) ? "has" : "lacks", _mesa_glsl_shader_target_name(consumer_type), - (input->centroid) ? "has" : "lacks"); + (input->data.centroid) ? "has" : "lacks"); return; } - if (input->invariant != output->invariant) { + if (input->data.sample != output->data.sample) { + linker_error(prog, + "%s shader output `%s' %s sample qualifier, " + "but %s shader input %s sample qualifier\n", + _mesa_glsl_shader_target_name(producer_type), + output->name, + (output->data.sample) ? "has" : "lacks", + _mesa_glsl_shader_target_name(consumer_type), + (input->data.sample) ? "has" : "lacks"); + return; + } + + if (input->data.invariant != output->data.invariant) { linker_error(prog, "%s shader output `%s' %s invariant qualifier, " "but %s shader input %s invariant qualifier\n", _mesa_glsl_shader_target_name(producer_type), output->name, - (output->invariant) ? "has" : "lacks", + (output->data.invariant) ? "has" : "lacks", _mesa_glsl_shader_target_name(consumer_type), - (input->invariant) ? "has" : "lacks"); + (input->data.invariant) ? "has" : "lacks"); return; } - if (input->interpolation != output->interpolation) { + if (input->data.interpolation != output->data.interpolation) { linker_error(prog, "%s shader output `%s' specifies %s " "interpolation qualifier, " @@ -125,9 +137,9 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, "interpolation qualifier\n", _mesa_glsl_shader_target_name(producer_type), output->name, - interpolation_string(output->interpolation), + interpolation_string(output->data.interpolation), _mesa_glsl_shader_target_name(consumer_type), - interpolation_string(input->interpolation)); + interpolation_string(input->data.interpolation)); return; } } @@ -143,11 +155,11 @@ cross_validate_front_and_back_color(struct gl_shader_program *prog, GLenum consumer_type, GLenum producer_type) { - if (front_color != NULL && front_color->assigned) + if (front_color != NULL && front_color->data.assigned) cross_validate_types_and_qualifiers(prog, input, front_color, consumer_type, producer_type); - if (back_color != NULL && back_color->assigned) + if (back_color != NULL && back_color->data.assigned) cross_validate_types_and_qualifiers(prog, input, back_color, consumer_type, producer_type); } @@ -166,7 +178,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, foreach_list(node, producer->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_shader_out)) + if ((var == NULL) || (var->data.mode != ir_var_shader_out)) continue; parameters.add_variable(var); @@ -184,10 +196,10 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, foreach_list(node, consumer->ir) { ir_variable *const input = ((ir_instruction *) node)->as_variable(); - if ((input == NULL) || (input->mode != ir_var_shader_in)) + if ((input == NULL) || (input->data.mode != ir_var_shader_in)) continue; - if (strcmp(input->name, "gl_Color") == 0 && input->used) { + if (strcmp(input->name, "gl_Color") == 0 && input->data.used) { const ir_variable *const front_color = parameters.get_variable("gl_FrontColor"); @@ -197,7 +209,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, cross_validate_front_and_back_color(prog, input, front_color, back_color, consumer->Type, producer->Type); - } else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->used) { + } else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->data.used) { const ir_variable *const front_color = parameters.get_variable("gl_FrontSecondaryColor"); @@ -317,8 +329,8 @@ tfeedback_decl::assign_location(struct gl_context *ctx, assert(this->is_varying()); unsigned fine_location - = this->matched_candidate->toplevel_var->location * 4 - + this->matched_candidate->toplevel_var->location_frac + = this->matched_candidate->toplevel_var->data.location * 4 + + this->matched_candidate->toplevel_var->data.location_frac + this->matched_candidate->offset; if (this->matched_candidate->type->is_array()) { @@ -734,7 +746,7 @@ varying_matches::~varying_matches() void varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) { - if (!producer_var->is_unmatched_generic_inout) { + if (!producer_var->data.is_unmatched_generic_inout) { /* Either a location already exists for this variable (since it is part * of fixed functionality), or it has already been recorded as part of a * previous match. @@ -752,12 +764,14 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) * regardless of where they appear. We can trivially satisfy that * requirement by changing the interpolation type to flat here. */ - producer_var->centroid = false; - producer_var->interpolation = INTERP_QUALIFIER_FLAT; + producer_var->data.centroid = false; + producer_var->data.sample = false; + producer_var->data.interpolation = INTERP_QUALIFIER_FLAT; if (consumer_var) { - consumer_var->centroid = false; - consumer_var->interpolation = INTERP_QUALIFIER_FLAT; + consumer_var->data.centroid = false; + consumer_var->data.sample = false; + consumer_var->data.interpolation = INTERP_QUALIFIER_FLAT; } } @@ -784,9 +798,9 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) this->matches[this->num_matches].producer_var = producer_var; this->matches[this->num_matches].consumer_var = consumer_var; this->num_matches++; - producer_var->is_unmatched_generic_inout = 0; + producer_var->data.is_unmatched_generic_inout = 0; if (consumer_var) - consumer_var->is_unmatched_generic_inout = 0; + consumer_var->data.is_unmatched_generic_inout = 0; } @@ -838,12 +852,12 @@ varying_matches::store_locations(unsigned producer_base, unsigned slot = generic_location / 4; unsigned offset = generic_location % 4; - producer_var->location = producer_base + slot; - producer_var->location_frac = offset; + producer_var->data.location = producer_base + slot; + producer_var->data.location_frac = offset; if (consumer_var) { - assert(consumer_var->location == -1); - consumer_var->location = consumer_base + slot; - consumer_var->location_frac = offset; + assert(consumer_var->data.location == -1); + consumer_var->data.location = consumer_base + slot; + consumer_var->data.location_frac = offset; } } } @@ -873,9 +887,9 @@ varying_matches::compute_packing_class(ir_variable *var) * * Therefore, the packing class depends only on the interpolation type. */ - unsigned packing_class = var->centroid ? 1 : 0; + unsigned packing_class = var->data.centroid | (var->data.sample << 1); packing_class *= 4; - packing_class += var->interpolation; + packing_class += var->data.interpolation; return packing_class; } @@ -933,8 +947,8 @@ is_varying_var(GLenum shaderType, const ir_variable *var) { /* Only fragment shaders will take a varying variable as an input */ if (shaderType == GL_FRAGMENT_SHADER && - var->mode == ir_var_shader_in) { - switch (var->location) { + var->data.mode == ir_var_shader_in) { + switch (var->data.location) { case VARYING_SLOT_POS: case VARYING_SLOT_FACE: case VARYING_SLOT_PNTC: @@ -1082,7 +1096,7 @@ assign_varying_locations(struct gl_context *ctx, ir_variable *const input_var = ((ir_instruction *) node)->as_variable(); - if ((input_var != NULL) && (input_var->mode == ir_var_shader_in)) { + if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) { if (input_var->get_interface_type() != NULL) { char *const iface_field_name = ralloc_asprintf(mem_ctx, "%s.%s", @@ -1101,7 +1115,7 @@ assign_varying_locations(struct gl_context *ctx, foreach_list(node, producer->ir) { ir_variable *const output_var = ((ir_instruction *) node)->as_variable(); - if ((output_var == NULL) || (output_var->mode != ir_var_shader_out)) + if ((output_var == NULL) || (output_var->data.mode != ir_var_shader_out)) continue; tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates); @@ -1121,7 +1135,7 @@ assign_varying_locations(struct gl_context *ctx, (ir_variable *) hash_table_find(consumer_inputs, output_var->name); } - if (input_var && input_var->mode != ir_var_shader_in) + if (input_var && input_var->data.mode != ir_var_shader_in) input_var = NULL; if (input_var) { @@ -1143,7 +1157,7 @@ assign_varying_locations(struct gl_context *ctx, return false; } - if (matched_candidate->toplevel_var->is_unmatched_generic_inout) + if (matched_candidate->toplevel_var->data.is_unmatched_generic_inout) matches.record(matched_candidate->toplevel_var, NULL); } @@ -1185,8 +1199,8 @@ assign_varying_locations(struct gl_context *ctx, foreach_list(node, consumer->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (var && var->mode == ir_var_shader_in && - var->is_unmatched_generic_inout) { + if (var && var->data.mode == ir_var_shader_in && + var->data.is_unmatched_generic_inout) { if (prog->Version <= 120) { /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: * @@ -1211,7 +1225,7 @@ assign_varying_locations(struct gl_context *ctx, /* An 'in' variable is only really a shader input if its * value is written by the previous stage. */ - var->mode = ir_var_auto; + var->data.mode = ir_var_auto; } } } @@ -1229,7 +1243,7 @@ check_against_output_limit(struct gl_context *ctx, foreach_list(node, producer->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (var && var->mode == ir_var_shader_out && + if (var && var->data.mode == ir_var_shader_out && is_varying_var(producer->Type, var)) { output_vectors += var->type->count_attribute_slots(); } @@ -1278,7 +1292,7 @@ check_against_input_limit(struct gl_context *ctx, foreach_list(node, consumer->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (var && var->mode == ir_var_shader_in && + if (var && var->data.mode == ir_var_shader_in && is_varying_var(consumer->Type, var)) { input_vectors += var->type->count_attribute_slots(); } diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index 1366077f7..a6133ea9c 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -114,8 +114,8 @@ public: ir_rvalue *param_rval = (ir_rvalue *)iter.get(); ir_variable *sig_param = (ir_variable *)sig_iter.get(); - if (sig_param->mode == ir_var_function_out || - sig_param->mode == ir_var_function_inout) { + if (sig_param->data.mode == ir_var_function_out || + sig_param->data.mode == ir_var_function_inout) { ir_variable *var = param_rval->variable_referenced(); if (var && strcmp(name, var->name) == 0) { found = true; @@ -198,7 +198,7 @@ public: virtual ir_visitor_status visit(ir_variable *var) { - if (!var->type->is_array() || var->mode != ir_var_shader_in) + if (!var->type->is_array() || var->data.mode != ir_var_shader_in) return visit_continue; unsigned size = var->type->length; @@ -217,16 +217,16 @@ public: * array using an index too large for its actual size assigned at link * time. */ - if (var->max_array_access >= this->num_vertices) { + if (var->data.max_array_access >= this->num_vertices) { linker_error(this->prog, "geometry shader accesses element %i of " "%s, but only %i input vertices\n", - var->max_array_access, var->name, this->num_vertices); + var->data.max_array_access, var->name, this->num_vertices); return visit_continue; } var->type = glsl_type::get_array_instance(var->type->element_type(), this->num_vertices); - var->max_array_access = this->num_vertices - 1; + var->data.max_array_access = this->num_vertices - 1; return visit_continue; } @@ -379,9 +379,9 @@ link_invalidate_variable_locations(exec_list *ir) * shader inputs (via layout(location=...)), and generic fragment shader * outputs (also via layout(location=...)). */ - if (!var->explicit_location) { - var->location = -1; - var->location_frac = 0; + if (!var->data.explicit_location) { + var->data.location = -1; + var->data.location_frac = 0; } /* ir_variable::is_unmatched_generic_inout is used by the linker while @@ -396,10 +396,10 @@ link_invalidate_variable_locations(exec_list *ir) * GL_ARB_separate_shader_objects is supported. When that extension is * implemented, this function will need some modifications. */ - if (!var->explicit_location) { - var->is_unmatched_generic_inout = 1; + if (!var->data.explicit_location) { + var->data.is_unmatched_generic_inout = 1; } else { - var->is_unmatched_generic_inout = 0; + var->data.is_unmatched_generic_inout = 0; } } } @@ -580,13 +580,13 @@ cross_validate_globals(struct gl_shader_program *prog, if (var == NULL) continue; - if (uniforms_only && (var->mode != ir_var_uniform)) + if (uniforms_only && (var->data.mode != ir_var_uniform)) continue; /* Don't cross validate temporaries that are at global scope. These * will eventually get pulled into the shaders 'main'. */ - if (var->mode == ir_var_temporary) + if (var->data.mode == ir_var_temporary) continue; /* If a global with this name has already been seen, verify that the @@ -619,17 +619,17 @@ cross_validate_globals(struct gl_shader_program *prog, } } - if (var->explicit_location) { - if (existing->explicit_location - && (var->location != existing->location)) { + if (var->data.explicit_location) { + if (existing->data.explicit_location + && (var->data.location != existing->data.location)) { linker_error(prog, "explicit locations for %s " "`%s' have differing values\n", mode_string(var), var->name); return; } - existing->location = var->location; - existing->explicit_location = true; + existing->data.location = var->data.location; + existing->data.explicit_location = true; } /* From the GLSL 4.20 specification: @@ -638,21 +638,21 @@ cross_validate_globals(struct gl_shader_program *prog, * opaque-uniform name. However, it is not an error to specify a * binding on some but not all declarations for the same name" */ - if (var->explicit_binding) { - if (existing->explicit_binding && - var->binding != existing->binding) { + if (var->data.explicit_binding) { + if (existing->data.explicit_binding && + var->data.binding != existing->data.binding) { linker_error(prog, "explicit bindings for %s " "`%s' have differing values\n", mode_string(var), var->name); return; } - existing->binding = var->binding; - existing->explicit_binding = true; + existing->data.binding = var->data.binding; + existing->data.explicit_binding = true; } if (var->type->contains_atomic() && - var->atomic.offset != existing->atomic.offset) { + var->data.atomic.offset != existing->data.atomic.offset) { linker_error(prog, "offset specifications for %s " "`%s' have differing values\n", mode_string(var), var->name); @@ -671,9 +671,9 @@ cross_validate_globals(struct gl_shader_program *prog, * of qualifiers." */ if (strcmp(var->name, "gl_FragDepth") == 0) { - bool layout_declared = var->depth_layout != ir_depth_layout_none; + bool layout_declared = var->data.depth_layout != ir_depth_layout_none; bool layout_differs = - var->depth_layout != existing->depth_layout; + var->data.depth_layout != existing->data.depth_layout; if (layout_declared && layout_differs) { linker_error(prog, @@ -682,7 +682,7 @@ cross_validate_globals(struct gl_shader_program *prog, "the same set of qualifiers."); } - if (var->used && layout_differs) { + if (var->data.used && layout_differs) { linker_error(prog, "If gl_FragDepth is redeclared with a layout " "qualifier in any fragment shader, it must be " @@ -734,8 +734,8 @@ cross_validate_globals(struct gl_shader_program *prog, } } - if (var->has_initializer) { - if (existing->has_initializer + if (var->data.has_initializer) { + if (existing->data.has_initializer && (var->constant_initializer == NULL || existing->constant_initializer == NULL)) { linker_error(prog, @@ -750,21 +750,27 @@ cross_validate_globals(struct gl_shader_program *prog, * otherwise) will propagate the existence to the variable * stored in the symbol table. */ - existing->has_initializer = true; + existing->data.has_initializer = true; } - if (existing->invariant != var->invariant) { + if (existing->data.invariant != var->data.invariant) { linker_error(prog, "declarations for %s `%s' have " "mismatching invariant qualifiers\n", mode_string(var), var->name); return; } - if (existing->centroid != var->centroid) { + if (existing->data.centroid != var->data.centroid) { linker_error(prog, "declarations for %s `%s' have " "mismatching centroid qualifiers\n", mode_string(var), var->name); return; } + if (existing->data.sample != var->data.sample) { + linker_error(prog, "declarations for %s `%s` have " + "mismatching sample qualifiers\n", + mode_string(var), var->name); + return; + } } else variables.add_variable(var); } @@ -884,7 +890,7 @@ remap_variables(ir_instruction *inst, struct gl_shader *target, virtual ir_visitor_status visit(ir_dereference_variable *ir) { - if (ir->var->mode == ir_var_temporary) { + if (ir->var->data.mode == ir_var_temporary) { ir_variable *var = (ir_variable *) hash_table_find(temps, ir->var); assert(var != NULL); @@ -958,13 +964,13 @@ move_non_declarations(exec_list *instructions, exec_node *last, continue; ir_variable *var = inst->as_variable(); - if ((var != NULL) && (var->mode != ir_var_temporary)) + if ((var != NULL) && (var->data.mode != ir_var_temporary)) continue; assert(inst->as_assignment() || inst->as_call() || inst->as_if() /* for initializers with the ?: operator */ - || ((var != NULL) && (var->mode == ir_var_temporary))); + || ((var != NULL) && (var->data.mode == ir_var_temporary))); if (make_copies) { inst = inst->clone(target, NULL); @@ -1036,7 +1042,7 @@ public: virtual ir_visitor_status visit(ir_variable *var) { - fixup_type(&var->type, var->max_array_access); + fixup_type(&var->type, var->data.max_array_access); if (var->type->is_interface()) { if (interface_contains_unsized_arrays(var->type)) { const glsl_type *new_type = @@ -1405,36 +1411,38 @@ link_intrastage_shaders(void *mem_ctx, insertion_point, true, linked); } - /* Resolve initializers for global variables in the linked shader. - */ - unsigned num_linking_shaders = num_shaders; - for (unsigned i = 0; i < num_shaders; i++) - num_linking_shaders += shader_list[i]->num_builtins_to_link; + /* Check if any shader needs built-in functions. */ + bool need_builtins = false; + for (unsigned i = 0; i < num_shaders; i++) { + if (shader_list[i]->uses_builtin_functions) { + need_builtins = true; + break; + } + } - gl_shader **linking_shaders = - (gl_shader **) calloc(num_linking_shaders, sizeof(gl_shader *)); + bool ok; + if (need_builtins) { + /* Make a temporary array one larger than shader_list, which will hold + * the built-in function shader as well. + */ + gl_shader **linking_shaders = (gl_shader **) + calloc(num_shaders + 1, sizeof(gl_shader *)); + memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *)); + linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader(); - memcpy(linking_shaders, shader_list, - sizeof(linking_shaders[0]) * num_shaders); + ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1); - unsigned idx = num_shaders; - for (unsigned i = 0; i < num_shaders; i++) { - memcpy(&linking_shaders[idx], shader_list[i]->builtins_to_link, - sizeof(linking_shaders[0]) * shader_list[i]->num_builtins_to_link); - idx += shader_list[i]->num_builtins_to_link; + free(linking_shaders); + } else { + ok = link_function_calls(prog, linked, shader_list, num_shaders); } - assert(idx == num_linking_shaders); - if (!link_function_calls(prog, linked, linking_shaders, - num_linking_shaders)) { + if (!ok) { ctx->Driver.DeleteShader(ctx, linked); - free(linking_shaders); return NULL; } - free(linking_shaders); - /* At this point linked should contain all of the linked IR, so * validate it to make sure nothing went wrong. */ @@ -1486,7 +1494,7 @@ update_array_sizes(struct gl_shader_program *prog) foreach_list(node, prog->_LinkedShaders[i]->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform) || + if ((var == NULL) || (var->data.mode != ir_var_uniform) || !var->type->is_array()) continue; @@ -1501,7 +1509,7 @@ update_array_sizes(struct gl_shader_program *prog) if (var->is_in_uniform_block() || var->type->contains_atomic()) continue; - unsigned int size = var->max_array_access; + unsigned int size = var->data.max_array_access; for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { if (prog->_LinkedShaders[j] == NULL) continue; @@ -1512,8 +1520,8 @@ update_array_sizes(struct gl_shader_program *prog) continue; if (strcmp(var->name, other_var->name) == 0 && - other_var->max_array_access > size) { - size = other_var->max_array_access; + other_var->data.max_array_access > size) { + size = other_var->data.max_array_access; } } } @@ -1652,16 +1660,17 @@ assign_attribute_or_color_locations(gl_shader_program *prog, foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != (unsigned) direction)) + if ((var == NULL) || (var->data.mode != (unsigned) direction)) continue; - if (var->explicit_location) { - if ((var->location >= (int)(max_index + generic_base)) - || (var->location < 0)) { + if (var->data.explicit_location) { + if ((var->data.location >= (int)(max_index + generic_base)) + || (var->data.location < 0)) { linker_error(prog, "invalid explicit location %d specified for `%s'\n", - (var->location < 0) - ? var->location : var->location - generic_base, + (var->data.location < 0) + ? var->data.location + : var->data.location - generic_base, var->name); return false; } @@ -1670,8 +1679,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, if (prog->AttributeBindings->get(binding, var->name)) { assert(binding >= VERT_ATTRIB_GENERIC0); - var->location = binding; - var->is_unmatched_generic_inout = 0; + var->data.location = binding; + var->data.is_unmatched_generic_inout = 0; } } else if (target_index == MESA_SHADER_FRAGMENT) { unsigned binding; @@ -1679,11 +1688,11 @@ assign_attribute_or_color_locations(gl_shader_program *prog, if (prog->FragDataBindings->get(binding, var->name)) { assert(binding >= FRAG_RESULT_DATA0); - var->location = binding; - var->is_unmatched_generic_inout = 0; + var->data.location = binding; + var->data.is_unmatched_generic_inout = 0; if (prog->FragDataIndexBindings->get(index, var->name)) { - var->index = index; + var->data.index = index; } } } @@ -1694,8 +1703,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, * add it to the list of variables that need linker-assigned locations. */ const unsigned slots = var->type->count_attribute_slots(); - if (var->location != -1) { - if (var->location >= generic_base && var->index < 1) { + if (var->data.location != -1) { + if (var->data.location >= generic_base && var->data.index < 1) { /* From page 61 of the OpenGL 4.0 spec: * * "LinkProgram will fail if the attribute bindings assigned @@ -1729,7 +1738,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog, /* Mask representing the contiguous slots that will be used by * this attribute. */ - const unsigned attr = var->location - generic_base; + const unsigned attr = var->data.location - generic_base; const unsigned use_mask = (1 << slots) - 1; /* Generate a link error if the set of bits requested for this @@ -1795,8 +1804,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, return false; } - to_assign[i].var->location = generic_base + location; - to_assign[i].var->is_unmatched_generic_inout = 0; + to_assign[i].var->data.location = generic_base + location; + to_assign[i].var->data.is_unmatched_generic_inout = 0; used_locations |= (use_mask << location); } @@ -1813,15 +1822,15 @@ demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode) foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != int(mode))) + if ((var == NULL) || (var->data.mode != int(mode))) continue; /* A shader 'in' or 'out' variable is only really an input or output if * its value is used by other shader stages. This will cause the variable * to have a location assigned. */ - if (var->is_unmatched_generic_inout) { - var->mode = ir_var_auto; + if (var->data.is_unmatched_generic_inout) { + var->data.mode = ir_var_auto; } } } @@ -1849,12 +1858,12 @@ store_fragdepth_layout(struct gl_shader_program *prog) foreach_list(node, ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (var == NULL || var->mode != ir_var_shader_out) { + if (var == NULL || var->data.mode != ir_var_shader_out) { continue; } if (strcmp(var->name, "gl_FragDepth") == 0) { - switch (var->depth_layout) { + switch (var->data.depth_layout) { case ir_depth_layout_none: prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_NONE; return; diff --git a/mesalib/src/glsl/loop_analysis.cpp b/mesalib/src/glsl/loop_analysis.cpp index b08241af5..fd2b6c923 100644 --- a/mesalib/src/glsl/loop_analysis.cpp +++ b/mesalib/src/glsl/loop_analysis.cpp @@ -33,6 +33,46 @@ static bool all_expression_operands_are_loop_constant(ir_rvalue *, static ir_rvalue *get_basic_induction_increment(ir_assignment *, hash_table *); +/** + * Record the fact that the given loop variable was referenced inside the loop. + * + * \arg in_assignee is true if the reference was on the LHS of an assignment. + * + * \arg in_conditional_code_or_nested_loop is true if the reference occurred + * inside an if statement or a nested loop. + * + * \arg current_assignment is the ir_assignment node that the loop variable is + * on the LHS of, if any (ignored if \c in_assignee is false). + */ +void +loop_variable::record_reference(bool in_assignee, + bool in_conditional_code_or_nested_loop, + ir_assignment *current_assignment) +{ + if (in_assignee) { + assert(current_assignment != NULL); + + if (in_conditional_code_or_nested_loop || + current_assignment->condition != NULL) { + this->conditional_or_nested_assignment = true; + } + + if (this->first_assignment == NULL) { + assert(this->num_assignments == 0); + + this->first_assignment = current_assignment; + } + + this->num_assignments++; + } else if (this->first_assignment == current_assignment) { + /* This catches the case where the variable is used in the RHS of an + * assignment where it is also in the LHS. + */ + this->read_before_write = true; + } +} + + loop_state::loop_state() { this->ht = hash_table_ctor(0, hash_table_pointer_hash, @@ -94,7 +134,7 @@ loop_terminator * loop_variable_state::insert(ir_if *if_stmt) { void *mem_ctx = ralloc_parent(this); - loop_terminator *t = rzalloc(mem_ctx, loop_terminator); + loop_terminator *t = new(mem_ctx) loop_terminator(); t->ir = if_stmt; this->terminators.push_tail(t); @@ -102,6 +142,33 @@ loop_variable_state::insert(ir_if *if_stmt) return t; } + +/** + * If the given variable already is recorded in the state for this loop, + * return the corresponding loop_variable object that records information + * about it. + * + * Otherwise, create a new loop_variable object to record information about + * the variable, and set its \c read_before_write field appropriately based on + * \c in_assignee. + * + * \arg in_assignee is true if this variable was encountered on the LHS of an + * assignment. + */ +loop_variable * +loop_variable_state::get_or_insert(ir_variable *var, bool in_assignee) +{ + loop_variable *lv = this->get(var); + + if (lv == NULL) { + lv = this->insert(var); + lv->read_before_write = !in_assignee; + } + + return lv; +} + + namespace { class loop_analysis : public ir_hierarchical_visitor { @@ -157,14 +224,14 @@ loop_analysis::visit(ir_loop_jump *ir) ir_visitor_status loop_analysis::visit_enter(ir_call *ir) { - /* If we're not somewhere inside a loop, there's nothing to do. */ - if (this->state.is_empty()) - return visit_continue; - - loop_variable_state *const ls = - (loop_variable_state *) this->state.get_head(); + /* Mark every loop that we're currently analyzing as containing an ir_call + * (even those at outer nesting levels). + */ + foreach_list(node, &this->state) { + loop_variable_state *const ls = (loop_variable_state *) node; + ls->contains_calls = true; + } - ls->contains_calls = true; return visit_continue_with_parent; } @@ -177,35 +244,18 @@ loop_analysis::visit(ir_dereference_variable *ir) if (this->state.is_empty()) return visit_continue; - loop_variable_state *const ls = - (loop_variable_state *) this->state.get_head(); - - ir_variable *var = ir->variable_referenced(); - loop_variable *lv = ls->get(var); - - if (lv == NULL) { - lv = ls->insert(var); - lv->read_before_write = !this->in_assignee; - } - - if (this->in_assignee) { - assert(this->current_assignment != NULL); + bool nested = false; - lv->conditional_assignment = (this->if_statement_depth > 0) - || (this->current_assignment->condition != NULL); + foreach_list(node, &this->state) { + loop_variable_state *const ls = (loop_variable_state *) node; - if (lv->first_assignment == NULL) { - assert(lv->num_assignments == 0); - - lv->first_assignment = this->current_assignment; - } + ir_variable *var = ir->variable_referenced(); + loop_variable *lv = ls->get_or_insert(var, this->in_assignee); - lv->num_assignments++; - } else if (lv->first_assignment == this->current_assignment) { - /* This catches the case where the variable is used in the RHS of an - * assignment where it is also in the LHS. - */ - lv->read_before_write = true; + lv->record_reference(this->in_assignee, + nested || this->if_statement_depth > 0, + this->current_assignment); + nested = true; } return visit_continue; @@ -286,7 +336,7 @@ loop_analysis::visit_leave(ir_loop *ir) foreach_list_safe(node, &ls->variables) { loop_variable *lv = (loop_variable *) node; - if (lv->conditional_assignment || (lv->num_assignments > 1)) + if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1)) continue; /* Process the RHS of the assignment. If all of the variables @@ -326,9 +376,10 @@ loop_analysis::visit_leave(ir_loop *ir) assert(lv->num_assignments == 1); assert(lv->first_assignment != NULL); - /* The assignmnet to the variable in the loop must be unconditional. + /* The assignment to the variable in the loop must be unconditional and + * not inside a nested loop. */ - if (lv->conditional_assignment) + if (lv->conditional_or_nested_assignment) continue; /* Basic loop induction variables have a single assignment in the loop @@ -338,8 +389,6 @@ loop_analysis::visit_leave(ir_loop *ir) ir_rvalue *const inc = get_basic_induction_increment(lv->first_assignment, ls->var_hash); if (inc != NULL) { - lv->iv_scale = NULL; - lv->biv = lv->var; lv->increment = inc; lv->remove(); @@ -347,6 +396,75 @@ loop_analysis::visit_leave(ir_loop *ir) } } + /* Search the loop terminating conditions for those of the form 'i < c' + * where i is a loop induction variable, c is a constant, and < is any + * relative operator. From each of these we can infer an iteration count. + * Also figure out which terminator (if any) produces the smallest + * iteration count--this is the limiting terminator. + */ + foreach_list(node, &ls->terminators) { + loop_terminator *t = (loop_terminator *) node; + ir_if *if_stmt = t->ir; + + /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care + * about the former here. + */ + ir_expression *cond = if_stmt->condition->as_expression(); + if (cond == NULL) + continue; + + switch (cond->operation) { + case ir_binop_less: + case ir_binop_greater: + case ir_binop_lequal: + case ir_binop_gequal: { + /* The expressions that we care about will either be of the form + * 'counter < limit' or 'limit < counter'. Figure out which is + * which. + */ + ir_rvalue *counter = cond->operands[0]->as_dereference_variable(); + ir_constant *limit = cond->operands[1]->as_constant(); + enum ir_expression_operation cmp = cond->operation; + + if (limit == NULL) { + counter = cond->operands[1]->as_dereference_variable(); + limit = cond->operands[0]->as_constant(); + + switch (cmp) { + case ir_binop_less: cmp = ir_binop_greater; break; + case ir_binop_greater: cmp = ir_binop_less; break; + case ir_binop_lequal: cmp = ir_binop_gequal; break; + case ir_binop_gequal: cmp = ir_binop_lequal; break; + default: assert(!"Should not get here."); + } + } + + if ((counter == NULL) || (limit == NULL)) + break; + + ir_variable *var = counter->variable_referenced(); + + ir_rvalue *init = find_initial_value(ir, var); + + loop_variable *lv = ls->get(var); + if (lv != NULL && lv->is_induction_var()) { + t->iterations = calculate_iterations(init, limit, lv->increment, + cmp); + + if (t->iterations >= 0 && + (ls->limiting_terminator == NULL || + t->iterations < ls->limiting_terminator->iterations)) { + ls->limiting_terminator = t; + } + } + break; + } + + default: + break; + } + } + return visit_continue; } diff --git a/mesalib/src/glsl/loop_analysis.h b/mesalib/src/glsl/loop_analysis.h index 769d62661..f841042f0 100644 --- a/mesalib/src/glsl/loop_analysis.h +++ b/mesalib/src/glsl/loop_analysis.h @@ -39,16 +39,12 @@ analyze_loop_variables(exec_list *instructions); /** * Fill in loop control fields * - * Based on analysis of loop variables, this function tries to remove sequences - * in the loop of the form + * Based on analysis of loop variables, this function tries to remove + * redundant sequences in the loop of the form * * (if (expression bool ...) (break)) * - * and fill in the \c ir_loop::from, \c ir_loop::to, and \c ir_loop::counter - * fields of the \c ir_loop. - * - * In this process, some conditional break-statements may be eliminated - * altogether. For example, if it is provable that one loop exit condition will + * For example, if it is provable that one loop exit condition will * always be satisfied before another, the unnecessary exit condition will be * removed. */ @@ -59,6 +55,13 @@ set_loop_controls(exec_list *instructions, loop_state *ls); extern bool unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations); +ir_rvalue * +find_initial_value(ir_loop *loop, ir_variable *var); + +int +calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, + enum ir_expression_operation op); + /** * Tracking for all variables used in a loop @@ -67,15 +70,11 @@ class loop_variable_state : public exec_node { public: class loop_variable *get(const ir_variable *); class loop_variable *insert(ir_variable *); + class loop_variable *get_or_insert(ir_variable *, bool in_assignee); class loop_terminator *insert(ir_if *); /** - * Loop whose variable state is being tracked by this structure - */ - ir_loop *loop; - - /** * Variables that have not yet been classified */ exec_list variables; @@ -104,18 +103,17 @@ public: exec_list terminators; /** - * Hash table containing all variables accessed in this loop + * If any of the terminators in \c terminators leads to termination of the + * loop after a constant number of iterations, this is the terminator that + * leads to termination after the smallest number of iterations. Otherwise + * NULL. */ - hash_table *var_hash; + loop_terminator *limiting_terminator; /** - * Maximum number of loop iterations. - * - * If this value is negative, then the loop may be infinite. This actually - * means that analysis was unable to determine an upper bound on the number - * of loop iterations. + * Hash table containing all variables accessed in this loop */ - int max_iterations; + hash_table *var_hash; /** * Number of ir_loop_jump instructions that operate on this loop @@ -129,11 +127,11 @@ public: loop_variable_state() { - this->max_iterations = -1; this->num_loop_jumps = 0; this->contains_calls = false; this->var_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + this->limiting_terminator = NULL; } ~loop_variable_state() @@ -171,8 +169,11 @@ public: /** Are all variables in the RHS of the assignment loop constants? */ bool rhs_clean; - /** Is there an assignment to the variable that is conditional? */ - bool conditional_assignment; + /** + * Is there an assignment to the variable that is conditional, or inside a + * nested loop? + */ + bool conditional_or_nested_assignment; /** Reference to the first assignment to the variable in the loop body. */ ir_assignment *first_assignment; @@ -181,27 +182,30 @@ public: unsigned num_assignments; /** - * Increment values for loop induction variables + * Increment value for a loop induction variable * - * Loop induction variables have a single increment of the form - * \c b * \c biv + \c c, where \c b and \c c are loop constants and \c i - * is a basic loop induction variable. + * If this is a loop induction variable, the amount by which the variable + * is incremented on each iteration through the loop. * - * If \c iv_scale is \c NULL, 1 is used. If \c biv is the same as \c var, - * then \c var is a basic loop induction variable. + * If this is not a loop induction variable, NULL. */ - /*@{*/ - ir_rvalue *iv_scale; - ir_variable *biv; ir_rvalue *increment; - /*@}*/ + + + inline bool is_induction_var() const + { + /* Induction variables always have a non-null increment, and vice + * versa. + */ + return this->increment != NULL; + } inline bool is_loop_constant() const { const bool is_const = (this->num_assignments == 0) || ((this->num_assignments == 1) - && !this->conditional_assignment + && !this->conditional_or_nested_assignment && !this->read_before_write && this->rhs_clean); @@ -213,16 +217,35 @@ public: /* Variables that are marked read-only *MUST* be loop constant. */ - assert(!this->var->read_only || (this->var->read_only && is_const)); + assert(!this->var->data.read_only + || (this->var->data.read_only && is_const)); return is_const; } + + void record_reference(bool in_assignee, + bool in_conditional_code_or_nested_loop, + ir_assignment *current_assignment); }; class loop_terminator : public exec_node { public: + loop_terminator() + : ir(NULL), iterations(-1) + { + } + + /** + * Statement which terminates the loop. + */ ir_if *ir; + + /** + * The number of iterations after which the terminator is known to + * terminate the loop (if that is a fixed value). Otherwise -1. + */ + int iterations; }; diff --git a/mesalib/src/glsl/loop_controls.cpp b/mesalib/src/glsl/loop_controls.cpp index 26481930d..3db06ad18 100644 --- a/mesalib/src/glsl/loop_controls.cpp +++ b/mesalib/src/glsl/loop_controls.cpp @@ -183,114 +183,41 @@ loop_control_visitor::visit_leave(ir_loop *ir) return visit_continue; } - /* Search the loop terminating conditions for one of the form 'i < c' where - * i is a loop induction variable, c is a constant, and < is any relative - * operator. - */ - int max_iterations = ls->max_iterations; - - if(ir->from && ir->to && ir->increment) - max_iterations = calculate_iterations(ir->from, ir->to, ir->increment, (ir_expression_operation)ir->cmp); - - if(max_iterations < 0) - max_iterations = INT_MAX; + if (ls->limiting_terminator != NULL) { + /* If the limiting terminator has an iteration count of zero, then we've + * proven that the loop cannot run, so delete it. + */ + int iterations = ls->limiting_terminator->iterations; + if (iterations == 0) { + ir->remove(); + this->progress = true; + return visit_continue; + } + } + /* Remove the conditional break statements associated with all terminators + * that are associated with a fixed iteration count, except for the one + * associated with the limiting terminator--that one needs to stay, since + * it terminates the loop. Exception: if the loop still has a normative + * bound, then that terminates the loop, so we don't even need the limiting + * terminator. + */ foreach_list(node, &ls->terminators) { loop_terminator *t = (loop_terminator *) node; - ir_if *if_stmt = t->ir; - /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care - * about the former here. - */ - ir_expression *cond = if_stmt->condition->as_expression(); - if (cond == NULL) - continue; - - switch (cond->operation) { - case ir_binop_less: - case ir_binop_greater: - case ir_binop_lequal: - case ir_binop_gequal: { - /* The expressions that we care about will either be of the form - * 'counter < limit' or 'limit < counter'. Figure out which is - * which. - */ - ir_rvalue *counter = cond->operands[0]->as_dereference_variable(); - ir_constant *limit = cond->operands[1]->as_constant(); - enum ir_expression_operation cmp = cond->operation; - - if (limit == NULL) { - counter = cond->operands[1]->as_dereference_variable(); - limit = cond->operands[0]->as_constant(); - - switch (cmp) { - case ir_binop_less: cmp = ir_binop_greater; break; - case ir_binop_greater: cmp = ir_binop_less; break; - case ir_binop_lequal: cmp = ir_binop_gequal; break; - case ir_binop_gequal: cmp = ir_binop_lequal; break; - default: assert(!"Should not get here."); - } - } - - if ((counter == NULL) || (limit == NULL)) - break; - - ir_variable *var = counter->variable_referenced(); - - ir_rvalue *init = find_initial_value(ir, var); - - foreach_list(iv_node, &ls->induction_variables) { - loop_variable *lv = (loop_variable *) iv_node; - - if (lv->var == var) { - const int iterations = calculate_iterations(init, limit, - lv->increment, - cmp); - if (iterations >= 0) { - /* If the new iteration count is lower than the previously - * believed iteration count, update the loop control values. - */ - if (iterations < max_iterations) { - ir->from = init->clone(ir, NULL); - ir->to = limit->clone(ir, NULL); - ir->increment = lv->increment->clone(ir, NULL); - ir->counter = lv->var; - ir->cmp = cmp; - - max_iterations = iterations; - } - - /* Remove the conditional break statement. The loop - * controls are now set such that the exit condition will be - * satisfied. - */ - if_stmt->remove(); - - assert(ls->num_loop_jumps > 0); - ls->num_loop_jumps--; - - this->progress = true; - } - - break; - } - } - break; - } + if (t->iterations < 0) + continue; - default: - break; + if (t != ls->limiting_terminator) { + t->ir->remove(); + + assert(ls->num_loop_jumps > 0); + ls->num_loop_jumps--; + + this->progress = true; } } - /* If we have proven the one of the loop exit conditions is satisifed before - * running the loop once, remove the loop. - */ - if (max_iterations == 0) - ir->remove(); - else - ls->max_iterations = max_iterations; - return visit_continue; } diff --git a/mesalib/src/glsl/loop_unroll.cpp b/mesalib/src/glsl/loop_unroll.cpp index ff97766f1..6eced1736 100644 --- a/mesalib/src/glsl/loop_unroll.cpp +++ b/mesalib/src/glsl/loop_unroll.cpp @@ -37,6 +37,10 @@ public: } virtual ir_visitor_status visit_leave(ir_loop *ir); + void simple_unroll(ir_loop *ir, int iterations); + void complex_unroll(ir_loop *ir, int iterations, + bool continue_from_then_branch); + void splice_post_if_instructions(ir_if *ir_if, exec_list *splice_dest); loop_state *state; @@ -86,6 +90,138 @@ public: }; +/** + * Unroll a loop which does not contain any jumps. For example, if the input + * is: + * + * (loop (...) ...instrs...) + * + * And the iteration count is 3, the output will be: + * + * ...instrs... ...instrs... ...instrs... + */ +void +loop_unroll_visitor::simple_unroll(ir_loop *ir, int iterations) +{ + void *const mem_ctx = ralloc_parent(ir); + + for (int i = 0; i < iterations; i++) { + exec_list copy_list; + + copy_list.make_empty(); + clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); + + ir->insert_before(©_list); + } + + /* The loop has been replaced by the unrolled copies. Remove the original + * loop from the IR sequence. + */ + ir->remove(); + + this->progress = true; +} + + +/** + * Unroll a loop whose last statement is an ir_if. If \c + * continue_from_then_branch is true, the loop is repeated only when the + * "then" branch of the if is taken; otherwise it is repeated only when the + * "else" branch of the if is taken. + * + * For example, if the input is: + * + * (loop (...) + * ...body... + * (if (cond) + * (...then_instrs...) + * (...else_instrs...))) + * + * And the iteration count is 3, and \c continue_from_then_branch is true, + * then the output will be: + * + * ...body... + * (if (cond) + * (...then_instrs... + * ...body... + * (if (cond) + * (...then_instrs... + * ...body... + * (if (cond) + * (...then_instrs...) + * (...else_instrs...))) + * (...else_instrs...))) + * (...else_instrs)) + */ +void +loop_unroll_visitor::complex_unroll(ir_loop *ir, int iterations, + bool continue_from_then_branch) +{ + void *const mem_ctx = ralloc_parent(ir); + ir_instruction *ir_to_replace = ir; + + for (int i = 0; i < iterations; i++) { + exec_list copy_list; + + copy_list.make_empty(); + clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); + + ir_if *ir_if = ((ir_instruction *) copy_list.get_tail())->as_if(); + assert(ir_if != NULL); + + ir_to_replace->insert_before(©_list); + ir_to_replace->remove(); + + /* placeholder that will be removed in the next iteration */ + ir_to_replace = + new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue); + + exec_list *const list = (continue_from_then_branch) + ? &ir_if->then_instructions : &ir_if->else_instructions; + + list->push_tail(ir_to_replace); + } + + ir_to_replace->remove(); + + this->progress = true; +} + + +/** + * Move all of the instructions which follow \c ir_if to the end of + * \c splice_dest. + * + * For example, in the code snippet: + * + * (if (cond) + * (...then_instructions... + * break) + * (...else_instructions...)) + * ...post_if_instructions... + * + * If \c ir_if points to the "if" instruction, and \c splice_dest points to + * (...else_instructions...), the code snippet is transformed into: + * + * (if (cond) + * (...then_instructions... + * break) + * (...else_instructions... + * ...post_if_instructions...)) + */ +void +loop_unroll_visitor::splice_post_if_instructions(ir_if *ir_if, + exec_list *splice_dest) +{ + while (!ir_if->get_next()->is_tail_sentinel()) { + ir_instruction *move_ir = (ir_instruction *) ir_if->get_next(); + + move_ir->remove(); + splice_dest->push_tail(move_ir); + } +} + + ir_visitor_status loop_unroll_visitor::visit_leave(ir_loop *ir) { @@ -100,14 +236,14 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) return visit_continue; } - iterations = ls->max_iterations; - /* Don't try to unroll loops where the number of iterations is not known * at compile-time. */ - if (iterations < 0) + if (ls->limiting_terminator == NULL) return visit_continue; + iterations = ls->limiting_terminator->iterations; + /* Don't try to unroll loops that have zillions of iterations either. */ if (iterations > (int) max_iterations) @@ -120,127 +256,83 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) if (count.fail || count.nodes * iterations > (int)max_iterations * 5) return visit_continue; - if (ls->num_loop_jumps > 1) - return visit_continue; - else if (ls->num_loop_jumps) { - ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail(); - assert(last_ir != NULL); - - if (is_break(last_ir)) { - /* If the only loop-jump is a break at the end of the loop, the loop - * will execute exactly once. Remove the break, set the iteration - * count, and fall through to the normal unroller. - */ - last_ir->remove(); - iterations = 1; - - this->progress = true; - } else { - ir_if *ir_if = NULL; - ir_instruction *break_ir = NULL; - bool continue_from_then_branch = false; - - foreach_list(node, &ir->body_instructions) { - /* recognize loops in the form produced by ir_lower_jumps */ - ir_instruction *cur_ir = (ir_instruction *) node; - - ir_if = cur_ir->as_if(); - if (ir_if != NULL) { - /* Determine which if-statement branch, if any, ends with a - * break. The branch that did *not* have the break will get a - * temporary continue inserted in each iteration of the loop - * unroll. - * - * Note that since ls->num_loop_jumps is <= 1, it is impossible - * for both branches to end with a break. - */ - ir_instruction *ir_if_last = - (ir_instruction *) ir_if->then_instructions.get_tail(); - - if (is_break(ir_if_last)) { - continue_from_then_branch = false; - break_ir = ir_if_last; - break; - } else { - ir_if_last = - (ir_instruction *) ir_if->else_instructions.get_tail(); - - if (is_break(ir_if_last)) { - break_ir = ir_if_last; - continue_from_then_branch = true; - break; - } - } - } - } - - if (break_ir == NULL) - return visit_continue; - - /* move instructions after then if in the continue branch */ - while (!ir_if->get_next()->is_tail_sentinel()) { - ir_instruction *move_ir = (ir_instruction *) ir_if->get_next(); - - move_ir->remove(); - if (continue_from_then_branch) - ir_if->then_instructions.push_tail(move_ir); - else - ir_if->else_instructions.push_tail(move_ir); - } - - /* Remove the break from the if-statement. - */ - break_ir->remove(); - - void *const mem_ctx = ralloc_parent(ir); - ir_instruction *ir_to_replace = ir; - - for (int i = 0; i < iterations; i++) { - exec_list copy_list; + /* Note: the limiting terminator contributes 1 to ls->num_loop_jumps. + * We'll be removing the limiting terminator before we unroll. + */ + assert(ls->num_loop_jumps > 0); + unsigned predicted_num_loop_jumps = ls->num_loop_jumps - 1; - copy_list.make_empty(); - clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); + if (predicted_num_loop_jumps > 1) + return visit_continue; - ir_if = ((ir_instruction *) copy_list.get_tail())->as_if(); - assert(ir_if != NULL); + if (predicted_num_loop_jumps == 0) { + ls->limiting_terminator->ir->remove(); + simple_unroll(ir, iterations); + return visit_continue; + } - ir_to_replace->insert_before(©_list); - ir_to_replace->remove(); + ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail(); + assert(last_ir != NULL); - /* placeholder that will be removed in the next iteration */ - ir_to_replace = - new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue); + if (is_break(last_ir)) { + /* If the only loop-jump is a break at the end of the loop, the loop + * will execute exactly once. Remove the break and use the simple + * unroller with an iteration count of 1. + */ + last_ir->remove(); - exec_list *const list = (continue_from_then_branch) - ? &ir_if->then_instructions : &ir_if->else_instructions; + ls->limiting_terminator->ir->remove(); + simple_unroll(ir, 1); + return visit_continue; + } - list->push_tail(ir_to_replace); + foreach_list(node, &ir->body_instructions) { + /* recognize loops in the form produced by ir_lower_jumps */ + ir_instruction *cur_ir = (ir_instruction *) node; + + /* Skip the limiting terminator, since it will go away when we + * unroll. + */ + if (cur_ir == ls->limiting_terminator->ir) + continue; + + ir_if *ir_if = cur_ir->as_if(); + if (ir_if != NULL) { + /* Determine which if-statement branch, if any, ends with a + * break. The branch that did *not* have the break will get a + * temporary continue inserted in each iteration of the loop + * unroll. + * + * Note that since ls->num_loop_jumps is <= 1, it is impossible + * for both branches to end with a break. + */ + ir_instruction *ir_if_last = + (ir_instruction *) ir_if->then_instructions.get_tail(); + + if (is_break(ir_if_last)) { + ls->limiting_terminator->ir->remove(); + splice_post_if_instructions(ir_if, &ir_if->else_instructions); + ir_if_last->remove(); + complex_unroll(ir, iterations, false); + return visit_continue; + } else { + ir_if_last = + (ir_instruction *) ir_if->else_instructions.get_tail(); + + if (is_break(ir_if_last)) { + ls->limiting_terminator->ir->remove(); + splice_post_if_instructions(ir_if, &ir_if->then_instructions); + ir_if_last->remove(); + complex_unroll(ir, iterations, true); + return visit_continue; + } } - - ir_to_replace->remove(); - - this->progress = true; - return visit_continue; } } - void *const mem_ctx = ralloc_parent(ir); - - for (int i = 0; i < iterations; i++) { - exec_list copy_list; - - copy_list.make_empty(); - clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); - - ir->insert_before(©_list); - } - - /* The loop has been replaced by the unrolled copies. Remove the original - * loop from the IR sequence. + /* Did not find the break statement. It must be in a complex if-nesting, + * so don't try to unroll. */ - ir->remove(); - - this->progress = true; return visit_continue; } diff --git a/mesalib/src/glsl/lower_clip_distance.cpp b/mesalib/src/glsl/lower_clip_distance.cpp index 04fa6d410..bb4f6ab11 100644 --- a/mesalib/src/glsl/lower_clip_distance.cpp +++ b/mesalib/src/glsl/lower_clip_distance.cpp @@ -135,13 +135,13 @@ lower_clip_distance_visitor::visit(ir_variable *ir) "gl_ClipDistanceMESA"); this->new_clip_distance_1d_var->type = glsl_type::get_array_instance(glsl_type::vec4_type, new_size); - this->new_clip_distance_1d_var->max_array_access - = ir->max_array_access / 4; + this->new_clip_distance_1d_var->data.max_array_access + = ir->data.max_array_access / 4; ir->replace_with(this->new_clip_distance_1d_var); } else { /* 2D gl_ClipDistance (used for geometry input). */ - assert(ir->mode == ir_var_shader_in && + assert(ir->data.mode == ir_var_shader_in && this->shader_type == GL_GEOMETRY_SHADER_ARB); if (this->old_clip_distance_2d_var) return visit_continue; @@ -161,8 +161,8 @@ lower_clip_distance_visitor::visit(ir_variable *ir) glsl_type::get_array_instance(glsl_type::vec4_type, new_size), ir->type->array_size()); - this->new_clip_distance_2d_var->max_array_access - = ir->max_array_access / 4; + this->new_clip_distance_2d_var->data.max_array_access + = ir->data.max_array_access / 4; ir->replace_with(this->new_clip_distance_2d_var); } @@ -500,8 +500,8 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) this->base_ir->insert_before(temp_clip_distance); actual_param->replace_with( new(ctx) ir_dereference_variable(temp_clip_distance)); - if (formal_param->mode == ir_var_function_in - || formal_param->mode == ir_var_function_inout) { + if (formal_param->data.mode == ir_var_function_in + || formal_param->data.mode == ir_var_function_inout) { /* Copy from gl_ClipDistance to the temporary before the call. * Since we are going to insert this copy before the current * instruction, we need to visit it afterwards to make sure it @@ -513,8 +513,8 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) this->base_ir->insert_before(new_assignment); this->visit_new_assignment(new_assignment); } - if (formal_param->mode == ir_var_function_out - || formal_param->mode == ir_var_function_inout) { + if (formal_param->data.mode == ir_var_function_out + || formal_param->data.mode == ir_var_function_inout) { /* Copy from the temporary to gl_ClipDistance after the call. * Since visit_list_elements() has already decided which * instruction it's going to visit next, we need to visit diff --git a/mesalib/src/glsl/lower_instructions.cpp b/mesalib/src/glsl/lower_instructions.cpp index d01879cbd..8f8d448ea 100644 --- a/mesalib/src/glsl/lower_instructions.cpp +++ b/mesalib/src/glsl/lower_instructions.cpp @@ -383,7 +383,6 @@ lower_instructions_visitor::ldexp_to_arith(ir_expression *ir) /* Constants */ ir_constant *zeroi = ir_constant::zero(ir, ivec); - ir_constant *zerof = ir_constant::zero(ir, ir->type); ir_constant *sign_mantissa_mask = new(ir) ir_constant(0x807fffffu, vec_elem); ir_constant *sign_mask = new(ir) ir_constant(0x80000000u, vec_elem); @@ -429,8 +428,7 @@ lower_instructions_visitor::ldexp_to_arith(ir_expression *ir) */ i.insert_before(zero_sign_x); i.insert_before(assign(zero_sign_x, - bitcast_u2f(bit_or(bit_and(bitcast_f2u(x), sign_mask), - bitcast_f2u(zerof))))); + bitcast_u2f(bit_and(bitcast_f2u(x), sign_mask)))); i.insert_before(is_not_zero_or_underflow); i.insert_before(assign(is_not_zero_or_underflow, diff --git a/mesalib/src/glsl/lower_named_interface_blocks.cpp b/mesalib/src/glsl/lower_named_interface_blocks.cpp index d59d11150..09d867ea3 100644 --- a/mesalib/src/glsl/lower_named_interface_blocks.cpp +++ b/mesalib/src/glsl/lower_named_interface_blocks.cpp @@ -108,7 +108,7 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) * but, this will require changes to the other uniform block * support code. */ - if (var->mode == ir_var_uniform) + if (var->data.mode == ir_var_uniform) continue; const glsl_type * iface_t = var->type; @@ -139,8 +139,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) new_var = new(mem_ctx) ir_variable(iface_t->fields.structure[i].type, var_name, - (ir_variable_mode) var->mode); - new_var->from_named_ifc_block_nonarray = 1; + (ir_variable_mode) var->data.mode); + new_var->data.from_named_ifc_block_nonarray = 1; } else { const glsl_type *new_array_type = glsl_type::get_array_instance( @@ -149,14 +149,15 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) new_var = new(mem_ctx) ir_variable(new_array_type, var_name, - (ir_variable_mode) var->mode); - new_var->from_named_ifc_block_array = 1; + (ir_variable_mode) var->data.mode); + new_var->data.from_named_ifc_block_array = 1; } - new_var->location = iface_t->fields.structure[i].location; - new_var->explicit_location = (new_var->location >= 0); - new_var->interpolation = + new_var->data.location = iface_t->fields.structure[i].location; + new_var->data.explicit_location = (new_var->data.location >= 0); + new_var->data.interpolation = iface_t->fields.structure[i].interpolation; - new_var->centroid = iface_t->fields.structure[i].centroid; + new_var->data.centroid = iface_t->fields.structure[i].centroid; + new_var->data.sample = iface_t->fields.structure[i].sample; new_var->init_interface_type(iface_t); hash_table_insert(interface_namespace, new_var, @@ -211,7 +212,7 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) * but, this will require changes to the other uniform block * support code. */ - if (var->mode == ir_var_uniform) + if (var->data.mode == ir_var_uniform) return; if (var->get_interface_type() != NULL) { diff --git a/mesalib/src/glsl/lower_output_reads.cpp b/mesalib/src/glsl/lower_output_reads.cpp index 128b0b8cd..afe17766b 100644 --- a/mesalib/src/glsl/lower_output_reads.cpp +++ b/mesalib/src/glsl/lower_output_reads.cpp @@ -91,7 +91,7 @@ output_read_remover::~output_read_remover() ir_visitor_status output_read_remover::visit(ir_dereference_variable *ir) { - if (ir->var->mode != ir_var_shader_out) + if (ir->var->data.mode != ir_var_shader_out) return visit_continue; ir_variable *temp = (ir_variable *) hash_table_find(replacements, ir->var); diff --git a/mesalib/src/glsl/lower_packed_varyings.cpp b/mesalib/src/glsl/lower_packed_varyings.cpp index 61ee692f6..9edef5d04 100644 --- a/mesalib/src/glsl/lower_packed_varyings.cpp +++ b/mesalib/src/glsl/lower_packed_varyings.cpp @@ -258,8 +258,8 @@ lower_packed_varyings_visitor::run(exec_list *instructions) if (var == NULL) continue; - if (var->mode != this->mode || - var->location < (int) this->location_base || + if (var->data.mode != this->mode || + var->data.location < (int) this->location_base || !this->needs_lowering(var)) continue; @@ -268,18 +268,18 @@ lower_packed_varyings_visitor::run(exec_list *instructions) * safe, caller should ensure that integral varyings always use flat * interpolation, even when this is not required by GLSL. */ - assert(var->interpolation == INTERP_QUALIFIER_FLAT || + assert(var->data.interpolation == INTERP_QUALIFIER_FLAT || !var->type->contains_integer()); /* Change the old varying into an ordinary global. */ - var->mode = ir_var_auto; + var->data.mode = ir_var_auto; /* Create a reference to the old varying. */ ir_dereference_variable *deref = new(this->mem_ctx) ir_dereference_variable(var); /* Recursively pack or unpack it. */ - this->lower_rvalue(deref, var->location * 4 + var->location_frac, var, + this->lower_rvalue(deref, var->data.location * 4 + var->data.location_frac, var, var->name, this->gs_input_vertices != 0, 0); } } @@ -547,7 +547,7 @@ lower_packed_varyings_visitor::get_packed_varying_deref( if (this->packed_varyings[slot] == NULL) { char *packed_name = ralloc_asprintf(this->mem_ctx, "packed:%s", name); const glsl_type *packed_type; - if (unpacked_var->interpolation == INTERP_QUALIFIER_FLAT) + if (unpacked_var->data.interpolation == INTERP_QUALIFIER_FLAT) packed_type = glsl_type::ivec4_type; else packed_type = glsl_type::vec4_type; @@ -562,11 +562,12 @@ lower_packed_varyings_visitor::get_packed_varying_deref( /* Prevent update_array_sizes() from messing with the size of the * array. */ - packed_var->max_array_access = this->gs_input_vertices - 1; + packed_var->data.max_array_access = this->gs_input_vertices - 1; } - packed_var->centroid = unpacked_var->centroid; - packed_var->interpolation = unpacked_var->interpolation; - packed_var->location = location; + packed_var->data.centroid = unpacked_var->data.centroid; + packed_var->data.sample = unpacked_var->data.sample; + packed_var->data.interpolation = unpacked_var->data.interpolation; + packed_var->data.location = location; unpacked_var->insert_before(packed_var); this->packed_varyings[slot] = packed_var; } else { diff --git a/mesalib/src/glsl/lower_ubo_reference.cpp b/mesalib/src/glsl/lower_ubo_reference.cpp index 16b6801b8..c73b148b0 100644 --- a/mesalib/src/glsl/lower_ubo_reference.cpp +++ b/mesalib/src/glsl/lower_ubo_reference.cpp @@ -143,7 +143,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) struct gl_uniform_block *block = &shader->UniformBlocks[i]; this->ubo_var = var->is_interface_instance() - ? &block->Uniforms[0] : &block->Uniforms[var->location]; + ? &block->Uniforms[0] : &block->Uniforms[var->data.location]; break; } diff --git a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp index 699fb3903..7c5d80f43 100644 --- a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp +++ b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp @@ -365,7 +365,7 @@ public: if (var == NULL) return this->lower_temps; - switch (var->mode) { + switch (var->data.mode) { case ir_var_auto: case ir_var_temporary: return this->lower_temps; diff --git a/mesalib/src/glsl/opt_array_splitting.cpp b/mesalib/src/glsl/opt_array_splitting.cpp index c7c5f6712..e946e0ae5 100644 --- a/mesalib/src/glsl/opt_array_splitting.cpp +++ b/mesalib/src/glsl/opt_array_splitting.cpp @@ -122,8 +122,8 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var) { assert(var); - if (var->mode != ir_var_auto && - var->mode != ir_var_temporary) + if (var->data.mode != ir_var_auto && + var->data.mode != ir_var_temporary) return NULL; if (!(var->type->is_array() || var->type->is_matrix())) diff --git a/mesalib/src/glsl/opt_constant_folding.cpp b/mesalib/src/glsl/opt_constant_folding.cpp index 072fefe9a..08a47b96b 100644 --- a/mesalib/src/glsl/opt_constant_folding.cpp +++ b/mesalib/src/glsl/opt_constant_folding.cpp @@ -127,8 +127,8 @@ ir_constant_folding_visitor::visit_enter(ir_call *ir) ir_rvalue *param_rval = (ir_rvalue *)iter.get(); ir_variable *sig_param = (ir_variable *)sig_iter.get(); - if (sig_param->mode == ir_var_function_in - || sig_param->mode == ir_var_const_in) { + if (sig_param->data.mode == ir_var_function_in + || sig_param->data.mode == ir_var_const_in) { ir_rvalue *new_param = param_rval; handle_rvalue(&new_param); diff --git a/mesalib/src/glsl/opt_constant_propagation.cpp b/mesalib/src/glsl/opt_constant_propagation.cpp index 2f65937fe..f1a6fbdaa 100644 --- a/mesalib/src/glsl/opt_constant_propagation.cpp +++ b/mesalib/src/glsl/opt_constant_propagation.cpp @@ -285,8 +285,8 @@ ir_constant_propagation_visitor::visit_enter(ir_call *ir) foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); ir_rvalue *param = (ir_rvalue *)iter.get(); - if (sig_param->mode != ir_var_function_out - && sig_param->mode != ir_var_function_inout) { + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir_rvalue *new_param = param; handle_rvalue(&new_param); if (new_param != param) diff --git a/mesalib/src/glsl/opt_constant_variable.cpp b/mesalib/src/glsl/opt_constant_variable.cpp index cbe6450c6..a026c51c3 100644 --- a/mesalib/src/glsl/opt_constant_variable.cpp +++ b/mesalib/src/glsl/opt_constant_variable.cpp @@ -137,8 +137,8 @@ ir_constant_variable_visitor::visit_enter(ir_call *ir) ir_rvalue *param_rval = (ir_rvalue *)iter.get(); ir_variable *param = (ir_variable *)sig_iter.get(); - if (param->mode == ir_var_function_out || - param->mode == ir_var_function_inout) { + if (param->data.mode == ir_var_function_out || + param->data.mode == ir_var_function_inout) { ir_variable *var = param_rval->variable_referenced(); struct assignment_entry *entry; diff --git a/mesalib/src/glsl/opt_copy_propagation.cpp b/mesalib/src/glsl/opt_copy_propagation.cpp index 7282b611e..db5dfc153 100644 --- a/mesalib/src/glsl/opt_copy_propagation.cpp +++ b/mesalib/src/glsl/opt_copy_propagation.cpp @@ -189,8 +189,8 @@ ir_copy_propagation_visitor::visit_enter(ir_call *ir) foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); ir_instruction *ir = (ir_instruction *)iter.get(); - if (sig_param->mode != ir_var_function_out - && sig_param->mode != ir_var_function_inout) { + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } sig_param_iter.next(); diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp index 6a19da40d..ba8a0f532 100644 --- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp +++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp @@ -297,8 +297,8 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir) foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); ir_instruction *ir = (ir_instruction *)iter.get(); - if (sig_param->mode != ir_var_function_out - && sig_param->mode != ir_var_function_inout) { + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } sig_param_iter.next(); diff --git a/mesalib/src/glsl/opt_cse.cpp b/mesalib/src/glsl/opt_cse.cpp index 8f73940d8..a2b63ee99 100644 --- a/mesalib/src/glsl/opt_cse.cpp +++ b/mesalib/src/glsl/opt_cse.cpp @@ -193,7 +193,7 @@ is_cse_candidate_visitor::visit(ir_dereference_variable *ir) /* Currently, since we don't handle kills of the ae based on variables * getting assigned, we can only handle constant variables. */ - if (ir->var->read_only) { + if (ir->var->data.read_only) { return visit_continue; } else { ok = false; diff --git a/mesalib/src/glsl/opt_dead_builtin_varyings.cpp b/mesalib/src/glsl/opt_dead_builtin_varyings.cpp index b336bc0a8..a939a2b64 100644 --- a/mesalib/src/glsl/opt_dead_builtin_varyings.cpp +++ b/mesalib/src/glsl/opt_dead_builtin_varyings.cpp @@ -85,10 +85,10 @@ public: { ir_variable *var = ir->variable_referenced(); - if (!var || var->mode != this->mode) + if (!var || var->data.mode != this->mode) return visit_continue; - if (this->find_frag_outputs && var->location == FRAG_RESULT_DATA0) { + if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) { this->fragdata_array = var; ir_constant *index = ir->array_index->as_constant(); @@ -105,7 +105,7 @@ public: return visit_continue_with_parent; } - if (!this->find_frag_outputs && var->location == VARYING_SLOT_TEX0) { + if (!this->find_frag_outputs && var->data.location == VARYING_SLOT_TEX0) { this->texcoord_array = var; ir_constant *index = ir->array_index->as_constant(); @@ -130,17 +130,17 @@ public: { ir_variable *var = ir->variable_referenced(); - if (var->mode != this->mode || !var->type->is_array()) + if (var->data.mode != this->mode || !var->type->is_array()) return visit_continue; - if (this->find_frag_outputs && var->location == FRAG_RESULT_DATA0) { + if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) { /* This is a whole array dereference. */ this->fragdata_usage |= (1 << var->type->array_size()) - 1; this->lower_fragdata_array = false; return visit_continue; } - if (!this->find_frag_outputs && var->location == VARYING_SLOT_TEX0) { + if (!this->find_frag_outputs && var->data.location == VARYING_SLOT_TEX0) { /* This is a whole array dereference like "gl_TexCoord = x;", * there's probably no point in lowering that. */ @@ -152,7 +152,7 @@ public: virtual ir_visitor_status visit(ir_variable *var) { - if (var->mode != this->mode) + if (var->data.mode != this->mode) return visit_continue; /* Nothing to do here for fragment outputs. */ @@ -160,7 +160,7 @@ public: return visit_continue; /* Handle colors and fog. */ - switch (var->location) { + switch (var->data.location) { case VARYING_SLOT_COL0: this->color[0] = var; this->color_usage |= 1; @@ -358,9 +358,9 @@ public: new_var[i] = new(ctx) ir_variable(glsl_type::vec4_type, name, this->info->mode); - new_var[i]->location = start_location + i; - new_var[i]->explicit_location = true; - new_var[i]->explicit_index = 0; + new_var[i]->data.location = start_location + i; + new_var[i]->data.explicit_location = true; + new_var[i]->data.explicit_index = 0; } ir->head->insert_before(new_var[i]); diff --git a/mesalib/src/glsl/opt_dead_code.cpp b/mesalib/src/glsl/opt_dead_code.cpp index b65e5c2ce..a8d8b4a39 100644 --- a/mesalib/src/glsl/opt_dead_code.cpp +++ b/mesalib/src/glsl/opt_dead_code.cpp @@ -79,9 +79,9 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) /* Remove a single dead assignment to the variable we found. * Don't do so if it's a shader or function output, though. */ - if (entry->var->mode != ir_var_function_out && - entry->var->mode != ir_var_function_inout && - entry->var->mode != ir_var_shader_out) { + if (entry->var->data.mode != ir_var_function_out && + entry->var->data.mode != ir_var_function_inout && + entry->var->data.mode != ir_var_shader_out) { entry->assign->remove(); progress = true; @@ -99,7 +99,7 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) * stage. Also, once uniform locations have been assigned, the * declaration cannot be deleted. */ - if (entry->var->mode == ir_var_uniform && + if (entry->var->data.mode == ir_var_uniform && (uniform_locations_assigned || entry->var->constant_value)) continue; diff --git a/mesalib/src/glsl/opt_dead_code_local.cpp b/mesalib/src/glsl/opt_dead_code_local.cpp index 42a30b3d8..43a01662a 100644 --- a/mesalib/src/glsl/opt_dead_code_local.cpp +++ b/mesalib/src/glsl/opt_dead_code_local.cpp @@ -121,7 +121,7 @@ public: */ foreach_iter(exec_list_iterator, iter, *this->assignments) { assignment_entry *entry = (assignment_entry *)iter.get(); - if (entry->lhs->mode == ir_var_shader_out) { + if (entry->lhs->data.mode == ir_var_shader_out) { if (debug) printf("kill %s\n", entry->lhs->name); entry->remove(); diff --git a/mesalib/src/glsl/opt_flip_matrices.cpp b/mesalib/src/glsl/opt_flip_matrices.cpp index 2107b1d47..9044fd680 100644 --- a/mesalib/src/glsl/opt_flip_matrices.cpp +++ b/mesalib/src/glsl/opt_flip_matrices.cpp @@ -104,8 +104,8 @@ matrix_flipper::visit_enter(ir_expression *ir) var_ref->var = texmat_transpose; - texmat_transpose->max_array_access = - MAX2(texmat_transpose->max_array_access, mat_var->max_array_access); + texmat_transpose->data.max_array_access = + MAX2(texmat_transpose->data.max_array_access, mat_var->data.max_array_access); progress = true; } diff --git a/mesalib/src/glsl/opt_function_inlining.cpp b/mesalib/src/glsl/opt_function_inlining.cpp index f8033a095..c8f42a424 100644 --- a/mesalib/src/glsl/opt_function_inlining.cpp +++ b/mesalib/src/glsl/opt_function_inlining.cpp @@ -132,21 +132,21 @@ ir_call::generate_inline(ir_instruction *next_ir) parameters[i] = NULL; } else { parameters[i] = sig_param->clone(ctx, ht); - parameters[i]->mode = ir_var_auto; + parameters[i]->data.mode = ir_var_auto; /* Remove the read-only decoration becuase we're going to write * directly to this variable. If the cloned variable is left * read-only and the inlined function is inside a loop, the loop * analysis code will get confused. */ - parameters[i]->read_only = false; + parameters[i]->data.read_only = false; next_ir->insert_before(parameters[i]); } /* Move the actual param into our param variable if it's an 'in' type. */ - if (parameters[i] && (sig_param->mode == ir_var_function_in || - sig_param->mode == ir_var_const_in || - sig_param->mode == ir_var_function_inout)) { + if (parameters[i] && (sig_param->data.mode == ir_var_function_in || + sig_param->data.mode == ir_var_const_in || + sig_param->data.mode == ir_var_function_inout)) { ir_assignment *assign; assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]), @@ -202,8 +202,8 @@ ir_call::generate_inline(ir_instruction *next_ir) const ir_variable *const sig_param = (ir_variable *) sig_param_iter.get(); /* Move our param variable into the actual param if it's an 'out' type. */ - if (parameters[i] && (sig_param->mode == ir_var_function_out || - sig_param->mode == ir_var_function_inout)) { + if (parameters[i] && (sig_param->data.mode == ir_var_function_out || + sig_param->data.mode == ir_var_function_inout)) { ir_assignment *assign; assign = new(ctx) ir_assignment(param->clone(ctx, NULL)->as_rvalue(), diff --git a/mesalib/src/glsl/opt_structure_splitting.cpp b/mesalib/src/glsl/opt_structure_splitting.cpp index 9f4b3dd8f..414f0000d 100644 --- a/mesalib/src/glsl/opt_structure_splitting.cpp +++ b/mesalib/src/glsl/opt_structure_splitting.cpp @@ -103,8 +103,8 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var) { assert(var); - if (!var->type->is_record() || var->mode == ir_var_uniform - || var->mode == ir_var_shader_in || var->mode == ir_var_shader_out) + if (!var->type->is_record() || var->data.mode == ir_var_uniform + || var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) return NULL; foreach_iter(exec_list_iterator, iter, this->variable_list) { diff --git a/mesalib/src/glsl/opt_tree_grafting.cpp b/mesalib/src/glsl/opt_tree_grafting.cpp index 46c06e6c4..6d75a1573 100644 --- a/mesalib/src/glsl/opt_tree_grafting.cpp +++ b/mesalib/src/glsl/opt_tree_grafting.cpp @@ -211,8 +211,8 @@ ir_tree_grafting_visitor::visit_enter(ir_call *ir) ir_rvalue *ir = (ir_rvalue *)iter.get(); ir_rvalue *new_ir = ir; - if (sig_param->mode != ir_var_function_in - && sig_param->mode != ir_var_const_in) { + if (sig_param->data.mode != ir_var_function_in + && sig_param->data.mode != ir_var_const_in) { if (check_graft(ir, sig_param) == visit_stop) return visit_stop; continue; @@ -361,9 +361,9 @@ tree_grafting_basic_block(ir_instruction *bb_first, if (!lhs_var) continue; - if (lhs_var->mode == ir_var_function_out || - lhs_var->mode == ir_var_function_inout || - lhs_var->mode == ir_var_shader_out) + if (lhs_var->data.mode == ir_var_function_out || + lhs_var->data.mode == ir_var_function_inout || + lhs_var->data.mode == ir_var_shader_out) continue; ir_variable_refcount_entry *entry = info->refs->get_variable_entry(lhs_var); diff --git a/mesalib/src/glsl/standalone_scaffolding.h b/mesalib/src/glsl/standalone_scaffolding.h index 7afb1c313..9f4818a8a 100644 --- a/mesalib/src/glsl/standalone_scaffolding.h +++ b/mesalib/src/glsl/standalone_scaffolding.h @@ -60,7 +60,7 @@ _mesa_shader_type_to_index(GLenum v) return MESA_SHADER_GEOMETRY; default: assert(!"bad value in _mesa_shader_type_to_index()"); - return MESA_SHADER_TYPES; + return MESA_SHADER_VERTEX; } } diff --git a/mesalib/src/mapi/glapi/gen/ARB_clear_buffer_object.xml b/mesalib/src/mapi/glapi/gen/ARB_clear_buffer_object.xml new file mode 100644 index 000000000..cb97a0185 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_clear_buffer_object.xml @@ -0,0 +1,50 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<!-- Note: no GLX protocol info yet. --> + + +<OpenGLAPI> + +<category name="GL_ARB_clear_buffer_object" number="121"> + + <function name ="ClearBufferData" offset="assign"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="data" type="const GLvoid *"/> + </function> + + <function name ="ClearBufferSubData" offset="assign"> + <param name="target" type="GLenum"/> + <param name="internalformat" type="GLenum"/> + <param name="offset" type="GLintptr"/> + <param name="size" type="GLsizeiptr"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="data" type="const GLvoid *"/> + </function> + +<!-- <function name="ClearNamedBufferDataEXT" offset="assign"> + <param name="buffer" type="GLuint"/> + <param name="internalformat" type="GLenum"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="data" type="const GLvoid *"/> + </function> + + + <function name="ClearNamedBufferSubDataEXT" offset="assign"> + <param name="buffer" type="GLuint"/> + <param name="internalformat" type="GLenum"/> + <param name="offset" type="GLintptr"/> + <param name="size" type="GLsizeiptr"/> + <param name="format" type="GLenum"/> + <param name="type" type="GLenum"/> + <param name="data" type="const GLvoid *"/> + </function> --> + +</category> + +</OpenGLAPI> diff --git a/mesalib/src/mapi/glapi/gen/ARB_texture_view.xml b/mesalib/src/mapi/glapi/gen/ARB_texture_view.xml new file mode 100644 index 000000000..3e6b8c904 --- /dev/null +++ b/mesalib/src/mapi/glapi/gen/ARB_texture_view.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<!-- Note: no GLX protocol info yet. --> + +<OpenGLAPI> + +<category name="GL_ARB_texture_view" number="124"> + + <function name="TextureView" offset="assign"> + <param name="texture" type="GLuint"/> + <param name="target" type="GLenum"/> + <param name="origtexture" type="GLuint"/> + <param name="internalformat" type="GLenum"/> + <param name="minlevel" type="GLuint"/> + <param name="numlevels" type="GLuint"/> + <param name="minlayer" type="GLuint"/> + <param name="numlayers" type="GLuint"/> + </function> + +</category> + +</OpenGLAPI> diff --git a/mesalib/src/mapi/glapi/gen/Makefile.am b/mesalib/src/mapi/glapi/gen/Makefile.am index 7af769acf..65bd9137c 100644 --- a/mesalib/src/mapi/glapi/gen/Makefile.am +++ b/mesalib/src/mapi/glapi/gen/Makefile.am @@ -125,6 +125,7 @@ API_XML = \ ARB_texture_rg.xml \ ARB_texture_storage_multisample.xml \ ARB_texture_storage.xml \ + ARB_texture_view.xml \ ARB_vertex_array_object.xml \ ARB_vertex_attrib_binding.xml \ AMD_draw_buffers_blend.xml \ diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index 5c877aa3f..697b2ecce 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -8460,7 +8460,13 @@ </category> -<!-- ARB extensions #120...#124 --> +<!-- ARB extension #120 --> + +<xi:include href="ARB_clear_buffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + +<!-- ARB extensions #122...#123 --> + +<xi:include href="ARB_texture_view.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <xi:include href="ARB_vertex_attrib_binding.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> diff --git a/mesalib/src/mapi/glapi/gen/gl_genexec.py b/mesalib/src/mapi/glapi/gen/gl_genexec.py index 3ce190fe3..b557b3b99 100644 --- a/mesalib/src/mapi/glapi/gen/gl_genexec.py +++ b/mesalib/src/mapi/glapi/gen/gl_genexec.py @@ -102,6 +102,7 @@ header = """/** #include "main/texstate.h" #include "main/texstorage.h" #include "main/texturebarrier.h" +#include "main/textureview.h" #include "main/transformfeedback.h" #include "main/mtypes.h" #include "main/varray.h" diff --git a/mesalib/src/mapi/glapi/gen/gl_gentable.py b/mesalib/src/mapi/glapi/gen/gl_gentable.py index fa9626825..35dddc7a0 100644 --- a/mesalib/src/mapi/glapi/gen/gl_gentable.py +++ b/mesalib/src/mapi/glapi/gen/gl_gentable.py @@ -50,7 +50,9 @@ header = """/* GLXEXT is the define used in the xserver when the GLX extension i #include <execinfo.h> #endif +#ifndef _WIN32 #include <dlfcn.h> +#endif #include <stdlib.h> #include <stdio.h> diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index a60600e03..884383652 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -103,7 +103,11 @@ noinst_PROGRAMS = gen_matypes gen_matypes_SOURCES = x86/gen_matypes.c BUILT_SOURCES += matypes.h -ARCH_LIBS = libmesa_sse41.la +ARCH_LIBS = + +if SSE41_SUPPORTED +ARCH_LIBS += libmesa_sse41.la +endif if HAVE_X86_64_ASM MESA_ASM_FILES_FOR_ARCH += $(X86_64_FILES) diff --git a/mesalib/src/mesa/Makefile.sources b/mesalib/src/mesa/Makefile.sources index a84f8a788..39525bc5b 100644 --- a/mesalib/src/mesa/Makefile.sources +++ b/mesalib/src/mesa/Makefile.sources @@ -103,6 +103,7 @@ MAIN_FILES = \ $(SRCDIR)main/texstate.c \ $(SRCDIR)main/texstorage.c \ $(SRCDIR)main/texstore.c \ + $(SRCDIR)main/textureview.c \ $(SRCDIR)main/texturebarrier.c \ $(SRCDIR)main/transformfeedback.c \ $(SRCDIR)main/uniforms.c \ diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index a2bb9f131..bb9b304ef 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -133,6 +133,7 @@ main_sources = [ 'main/texstorage.c', 'main/texstore.c', 'main/texturebarrier.c', + 'main/textureview.c', 'main/transformfeedback.c', 'main/uniform_query.cpp', 'main/uniforms.c', diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c index 5faa98af1..f18568827 100644 --- a/mesalib/src/mesa/drivers/common/driverfuncs.c +++ b/mesalib/src/mesa/drivers/common/driverfuncs.c @@ -211,6 +211,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver) /* GL_ARB_texture_storage */ driver->AllocTextureStorage = _mesa_alloc_texture_storage; + /* GL_ARB_texture_view */ + driver->TextureView = NULL; + /* GL_ARB_texture_multisample */ driver->GetSamplePosition = NULL; } diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index 0bce77ea9..d64821112 100644 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -438,16 +438,19 @@ driCreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - struct gl_context *ctx = context->driverPrivate; + *error = __DRI_CTX_ERROR_SUCCESS; + return context; +} + +void +driContextSetFlags(struct gl_context *ctx, uint32_t flags) +{ if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) { ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT; ctx->Debug.DebugOutput = GL_TRUE; } - - *error = __DRI_CTX_ERROR_SUCCESS; - return context; } static __DRIcontext * @@ -873,3 +876,18 @@ const __DRIimageDriverExtension driImageDriverExtension = { .getAPIMask = driGetAPIMask, .createContextAttribs = driCreateContextAttribs, }; + +/* swrast copy sub buffer entrypoint. */ +static void driCopySubBuffer(__DRIdrawable *pdp, int x, int y, + int w, int h) +{ + assert(pdp->driScreenPriv->swrast_loader); + + pdp->driScreenPriv->driver->CopySubBuffer(pdp, x, y, w, h); +} + +/* for swrast only */ +const __DRIcopySubBufferExtension driCopySubBufferExtension = { + { __DRI_COPY_SUB_BUFFER, 1 }, + .copySubBuffer = driCopySubBuffer, +}; diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.h b/mesalib/src/mesa/drivers/dri/common/dri_util.h index 79a8564ad..a79a4ed7a 100644 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.h +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.h @@ -66,7 +66,7 @@ extern const __DRIcoreExtension driCoreExtension; extern const __DRIswrastExtension driSWRastExtension; extern const __DRIdri2Extension driDRI2Extension; extern const __DRI2configQueryExtension dri2ConfigQueryExtension; - +extern const __DRIcopySubBufferExtension driCopySubBufferExtension; /** * Driver callback functions. * @@ -115,6 +115,9 @@ struct __DriverAPIRec { int width, int height); void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer); + + void (*CopySubBuffer)(__DRIdrawable *driDrawPriv, int x, int y, + int w, int h); }; extern const struct __DriverAPIRec driDriverAPI; @@ -289,6 +292,9 @@ dri2InvalidateDrawable(__DRIdrawable *drawable); extern void driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv); +extern void +driContextSetFlags(struct gl_context *ctx, uint32_t flags); + extern const __DRIimageDriverExtension driImageDriverExtension; #endif /* _DRI_UTIL_H_ */ diff --git a/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c b/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c index 6bf5d7327..a8217703d 100644 --- a/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c +++ b/mesalib/src/mesa/drivers/dri/common/megadriver_stub.c @@ -23,6 +23,132 @@ #include <stdio.h> #include "dri_util.h" +#include <dlfcn.h> +#include "main/macros.h" + +/* We need GNU extensions to dlfcn.h in order to provide backward + * compatibility for the older DRI driver loader mechanism. (dladdr, + * Dl_info, and RTLD_DEFAULT are only defined when _GNU_SOURCE is + * defined.) + */ +#ifdef _GNU_SOURCE + +#define MEGADRIVER_STUB_MAX_EXTENSIONS 10 +#define LIB_PATH_SUFFIX "_dri.so" +#define LIB_PATH_SUFFIX_LENGTH (sizeof(LIB_PATH_SUFFIX)-1) + +/* This is the table of extensions that the loader will dlsym() for. + * + * Initially it is empty for the megadriver stub, but the library + * constructor may initialize it based on the name of the library that + * is being loaded. + */ +PUBLIC const __DRIextension * +__driDriverExtensions[MEGADRIVER_STUB_MAX_EXTENSIONS] = { + NULL +}; + +/** + * This is a constructor function for the megadriver dynamic library. + * + * When the driver is dlopen'ed, this function will run. It will + * search for the name of the foo_dri.so file that was opened using + * the dladdr function. + * + * After finding foo's name, it will call __driDriverGetExtensions_foo + * and use the return to update __driDriverExtensions to enable + * compatibility with older DRI driver loaders. + */ +__attribute__((constructor)) static void +megadriver_stub_init(void) +{ + Dl_info info; + char *driver_name; + size_t name_len; + char *get_extensions_name; + const __DRIextension **(*get_extensions)(void); + const __DRIextension **extensions; + int i; + + /* Call dladdr on __driDriverExtensions. We are really + * interested in the returned info.dli_fname so we can + * figure out the path name of the library being loaded. + */ + i = dladdr((void*) __driDriverExtensions, &info); + if (i == 0) + return; + + /* Search for the last '/' character in the path. */ + driver_name = strrchr(info.dli_fname, '/'); + if (driver_name != NULL) { + /* Skip '/' character */ + driver_name++; + } else { + /* Try using the start of the path */ + driver_name = (char*) info.dli_fname; + } + + /* Make sure the path ends with _dri.so */ + name_len = strlen(driver_name); + i = name_len - LIB_PATH_SUFFIX_LENGTH; + if (i < 0 || strcmp(driver_name + i, LIB_PATH_SUFFIX) != 0) + return; + + /* Duplicate the string so we can modify it. + * So far we've been using info.dli_fname. + */ + driver_name = strdup(driver_name); + if (!driver_name) + return; + + /* The path ends with _dri.so. Chop this part of the + * string off. Then we'll have the driver's final name. + */ + driver_name[i] = '\0'; + + i = asprintf(&get_extensions_name, "%s_%s", + __DRI_DRIVER_GET_EXTENSIONS, driver_name); + free(driver_name); + if (i == -1) + return; + + /* dlsym to get the driver's get extensions function. We + * don't have the dlopen handle, so we have to use + * RTLD_DEFAULT. It seems unlikely that the symbol will + * be found in another library, but this isn't optimal. + */ + get_extensions = dlsym(RTLD_DEFAULT, get_extensions_name); + free(get_extensions_name); + if (!get_extensions) + return; + + /* Use the newer DRI loader entrypoint to find extensions. + * We will then expose these extensions via the older + * __driDriverExtensions symbol. + */ + extensions = get_extensions(); + + /* Copy the extensions into the __driDriverExtensions array + * we declared. + */ + for (i = 0; i < ARRAY_SIZE(__driDriverExtensions); i++) { + __driDriverExtensions[i] = extensions[i]; + if (extensions[i] == NULL) + break; + } + + /* If the driver had more extensions than we reserved, then + * bail out. + */ + if (i == ARRAY_SIZE(__driDriverExtensions)) { + __driDriverExtensions[0] = NULL; + fprintf(stderr, "Megadriver stub did not reserve enough extension " + "slots.\n"); + return; + } +} + +#endif /* _GNU_SOURCE */ static const __DRIconfig **stub_error_init_screen(__DRIscreen *psp) diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index 73dc5c4c0..79a27408f 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -402,7 +402,7 @@ swrast_map_renderbuffer(struct gl_context *ctx, stride = w * cpp; xrb->Base.Buffer = malloc(h * stride); - sPriv->swrast_loader->getImage(dPriv, x, y, w, h, + sPriv->swrast_loader->getImage(dPriv, x, rb->Height - y - h, w, h, (char *) xrb->Base.Buffer, dPriv->loaderPrivate); @@ -705,6 +705,8 @@ dri_create_context(gl_api api, goto context_fail; } + driContextSetFlags(mesaCtx, flags); + /* do bounds checking to prevent segfaults and server crashes! */ mesaCtx->Const.CheckArrayBounds = GL_TRUE; @@ -820,6 +822,39 @@ dri_unbind_context(__DRIcontext * cPriv) return GL_TRUE; } +static void +dri_copy_sub_buffer(__DRIdrawable *dPriv, int x, int y, + int w, int h) +{ + __DRIscreen *sPriv = dPriv->driScreenPriv; + void *data; + int iy; + struct dri_drawable *drawable = dri_drawable(dPriv); + struct gl_framebuffer *fb; + struct dri_swrast_renderbuffer *frontrb, *backrb; + + TRACE; + + fb = &drawable->Base; + + frontrb = + dri_swrast_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer); + backrb = + dri_swrast_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer); + + /* check for signle-buffered */ + if (backrb == NULL) + return; + + iy = frontrb->Base.Base.Height - y - h; + data = (char *)backrb->Base.Buffer + (iy * backrb->pitch) + (x * ((backrb->bpp + 7) / 8)); + sPriv->swrast_loader->putImage2(dPriv, __DRI_SWRAST_IMAGE_OP_SWAP, + x, iy, w, h, + frontrb->pitch, + data, + dPriv->loaderPrivate); +} + static const struct __DriverAPIRec swrast_driver_api = { .InitScreen = dri_init_screen, @@ -831,6 +866,7 @@ static const struct __DriverAPIRec swrast_driver_api = { .SwapBuffers = dri_swap_buffers, .MakeCurrent = dri_make_current, .UnbindContext = dri_unbind_context, + .CopySubBuffer = dri_copy_sub_buffer, }; static const struct __DRIDriverVtableExtensionRec swrast_vtable = { @@ -841,6 +877,7 @@ static const struct __DRIDriverVtableExtensionRec swrast_vtable = { static const __DRIextension *swrast_driver_extensions[] = { &driCoreExtension.base, &driSWRastExtension.base, + &driCopySubBufferExtension.base, &swrast_vtable.base, NULL }; diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index c9332bd52..30c815d67 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -182,7 +182,7 @@ struct texture_state * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. */ -static void +static bool save_attrib_data(struct gl_attrib_node **head, GLbitfield kind, void *payload) { @@ -196,7 +196,42 @@ save_attrib_data(struct gl_attrib_node **head, } else { /* out of memory! */ + return false; + } + return true; +} + + +/** + * Helper function for_mesa_PushAttrib for simple attributes. + * Allocates memory for attribute data and copies the given attribute data. + * \param head head of linked list to insert attribute data into + * \param attr_bit one of the GL_<attrib>_BIT flags + * \param attr_size number of bytes to allocate for attribute data + * \param attr_data the attribute data to copy + * \return true for success, false for out of memory + */ +static bool +push_attrib(struct gl_context *ctx, struct gl_attrib_node **head, + GLbitfield attr_bit, GLuint attr_size, const void *attr_data) +{ + void *attribute; + + attribute = MALLOC(attr_size); + if (attribute == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + return false; + } + + if (save_attrib_data(head, attr_bit, attribute)) { + memcpy(attribute, attr_data, attr_size); } + else { + FREE(attribute); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + return false; + } + return true; } @@ -220,42 +255,58 @@ _mesa_PushAttrib(GLbitfield mask) head = NULL; if (mask & GL_ACCUM_BUFFER_BIT) { - struct gl_accum_attrib *attr; - attr = MALLOC_STRUCT( gl_accum_attrib ); - memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); - save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr); + if (!push_attrib(ctx, &head, GL_ACCUM_BUFFER_BIT, + sizeof(struct gl_accum_attrib), + (void*)&ctx->Accum)) + goto end; } if (mask & GL_COLOR_BUFFER_BIT) { GLuint i; struct gl_colorbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_colorbuffer_attrib ); - memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); - /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ - for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) - attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; - save_attrib_data(&head, GL_COLOR_BUFFER_BIT, attr); + if (attr == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } + + if (save_attrib_data(&head, GL_COLOR_BUFFER_BIT, attr)) { + memcpy(attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib)); + /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ + for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) + attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; + } + else { + FREE(attr); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } } if (mask & GL_CURRENT_BIT) { - struct gl_current_attrib *attr; - FLUSH_CURRENT( ctx, 0 ); - attr = MALLOC_STRUCT( gl_current_attrib ); - memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); - save_attrib_data(&head, GL_CURRENT_BIT, attr); + FLUSH_CURRENT(ctx, 0); + if (!push_attrib(ctx, &head, GL_CURRENT_BIT, + sizeof(struct gl_current_attrib), + (void*)&ctx->Current)) + goto end; } if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_depthbuffer_attrib *attr; - attr = MALLOC_STRUCT( gl_depthbuffer_attrib ); - memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); - save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr); + if (!push_attrib(ctx, &head, GL_DEPTH_BUFFER_BIT, + sizeof(struct gl_depthbuffer_attrib), + (void*)&ctx->Depth)) + goto end; } if (mask & GL_ENABLE_BIT) { struct gl_enable_attrib *attr; GLuint i; attr = MALLOC_STRUCT( gl_enable_attrib ); + if (attr == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } + /* Copy enable flags from all other attributes into the enable struct. */ attr->AlphaTest = ctx->Color.AlphaEnabled; attr->AutoNormal = ctx->Eval.AutoNormal; @@ -322,97 +373,112 @@ _mesa_PushAttrib(GLbitfield mask) /* GL_ARB_fragment_program */ attr->FragmentProgram = ctx->FragmentProgram.Enabled; - save_attrib_data(&head, GL_ENABLE_BIT, attr); + if (!save_attrib_data(&head, GL_ENABLE_BIT, attr)) { + FREE(attr); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */ attr->sRGBEnabled = ctx->Color.sRGBEnabled; } if (mask & GL_EVAL_BIT) { - struct gl_eval_attrib *attr; - attr = MALLOC_STRUCT( gl_eval_attrib ); - memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); - save_attrib_data(&head, GL_EVAL_BIT, attr); + if (!push_attrib(ctx, &head, GL_EVAL_BIT, + sizeof(struct gl_eval_attrib), + (void*)&ctx->Eval)) + goto end; } if (mask & GL_FOG_BIT) { - struct gl_fog_attrib *attr; - attr = MALLOC_STRUCT( gl_fog_attrib ); - memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); - save_attrib_data(&head, GL_FOG_BIT, attr); + if (!push_attrib(ctx, &head, GL_FOG_BIT, + sizeof(struct gl_fog_attrib), + (void*)&ctx->Fog)) + goto end; } if (mask & GL_HINT_BIT) { - struct gl_hint_attrib *attr; - attr = MALLOC_STRUCT( gl_hint_attrib ); - memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); - save_attrib_data(&head, GL_HINT_BIT, attr); + if (!push_attrib(ctx, &head, GL_HINT_BIT, + sizeof(struct gl_hint_attrib), + (void*)&ctx->Hint)) + goto end; } if (mask & GL_LIGHTING_BIT) { - struct gl_light_attrib *attr; - FLUSH_CURRENT(ctx, 0); /* flush material changes */ - attr = MALLOC_STRUCT( gl_light_attrib ); - memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); - save_attrib_data(&head, GL_LIGHTING_BIT, attr); + FLUSH_CURRENT(ctx, 0); /* flush material changes */ + if (!push_attrib(ctx, &head, GL_LIGHTING_BIT, + sizeof(struct gl_light_attrib), + (void*)&ctx->Light)) + goto end; } if (mask & GL_LINE_BIT) { - struct gl_line_attrib *attr; - attr = MALLOC_STRUCT( gl_line_attrib ); - memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); - save_attrib_data(&head, GL_LINE_BIT, attr); + if (!push_attrib(ctx, &head, GL_LINE_BIT, + sizeof(struct gl_line_attrib), + (void*)&ctx->Line)) + goto end; } if (mask & GL_LIST_BIT) { - struct gl_list_attrib *attr; - attr = MALLOC_STRUCT( gl_list_attrib ); - memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) ); - save_attrib_data(&head, GL_LIST_BIT, attr); + if (!push_attrib(ctx, &head, GL_LIST_BIT, + sizeof(struct gl_list_attrib), + (void*)&ctx->List)) + goto end; } if (mask & GL_PIXEL_MODE_BIT) { struct gl_pixel_attrib *attr; attr = MALLOC_STRUCT( gl_pixel_attrib ); - memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); - /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ - attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; - save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr); + if (attr == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } + + if (save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr)) { + memcpy(attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib)); + /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ + attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; + } + else { + FREE(attr); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib"); + goto end; + } } if (mask & GL_POINT_BIT) { - struct gl_point_attrib *attr; - attr = MALLOC_STRUCT( gl_point_attrib ); - memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); - save_attrib_data(&head, GL_POINT_BIT, attr); + if (!push_attrib(ctx, &head, GL_POINT_BIT, + sizeof(struct gl_point_attrib), + (void*)&ctx->Point)) + goto end; } if (mask & GL_POLYGON_BIT) { - struct gl_polygon_attrib *attr; - attr = MALLOC_STRUCT( gl_polygon_attrib ); - memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); - save_attrib_data(&head, GL_POLYGON_BIT, attr); + if (!push_attrib(ctx, &head, GL_POLYGON_BIT, + sizeof(struct gl_polygon_attrib), + (void*)&ctx->Polygon)) + goto end; } if (mask & GL_POLYGON_STIPPLE_BIT) { - GLuint *stipple; - stipple = malloc( 32*sizeof(GLuint) ); - memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); - save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple); + if (!push_attrib(ctx, &head, GL_POLYGON_STIPPLE_BIT, + sizeof(ctx->PolygonStipple), + (void*)&ctx->PolygonStipple)) + goto end; } if (mask & GL_SCISSOR_BIT) { - struct gl_scissor_attrib *attr; - attr = MALLOC_STRUCT( gl_scissor_attrib ); - memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); - save_attrib_data(&head, GL_SCISSOR_BIT, attr); + if (!push_attrib(ctx, &head, GL_SCISSOR_BIT, + sizeof(struct gl_scissor_attrib), + (void*)&ctx->Scissor)) + goto end; } if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_stencil_attrib *attr; - attr = MALLOC_STRUCT( gl_stencil_attrib ); - memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); - save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr); + if (!push_attrib(ctx, &head, GL_STENCIL_BUFFER_BIT, + sizeof(struct gl_stencil_attrib), + (void*)&ctx->Stencil)) + goto end; } if (mask & GL_TEXTURE_BIT) { @@ -424,6 +490,12 @@ _mesa_PushAttrib(GLbitfield mask) goto end; } + if (!save_attrib_data(&head, GL_TEXTURE_BIT, texstate)) { + FREE(texstate); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushAttrib(GL_TEXTURE_BIT)"); + goto end; + } + _mesa_lock_context_textures(ctx); /* copy/save the bulk of texture state here */ @@ -450,35 +522,35 @@ _mesa_PushAttrib(GLbitfield mask) _mesa_reference_shared_state(ctx, &texstate->SharedRef, ctx->Shared); _mesa_unlock_context_textures(ctx); - - save_attrib_data(&head, GL_TEXTURE_BIT, texstate); } if (mask & GL_TRANSFORM_BIT) { - struct gl_transform_attrib *attr; - attr = MALLOC_STRUCT( gl_transform_attrib ); - memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); - save_attrib_data(&head, GL_TRANSFORM_BIT, attr); + if (!push_attrib(ctx, &head, GL_TRANSFORM_BIT, + sizeof(struct gl_transform_attrib), + (void*)&ctx->Transform)) + goto end; } if (mask & GL_VIEWPORT_BIT) { - struct gl_viewport_attrib *attr; - attr = MALLOC_STRUCT( gl_viewport_attrib ); - memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); - save_attrib_data(&head, GL_VIEWPORT_BIT, attr); + if (!push_attrib(ctx, &head, GL_VIEWPORT_BIT, + sizeof(struct gl_viewport_attrib), + (void*)&ctx->Viewport)) + goto end; } /* GL_ARB_multisample */ if (mask & GL_MULTISAMPLE_BIT_ARB) { - struct gl_multisample_attrib *attr; - attr = MALLOC_STRUCT( gl_multisample_attrib ); - memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); - save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr); + if (!push_attrib(ctx, &head, GL_MULTISAMPLE_BIT_ARB, + sizeof(struct gl_multisample_attrib), + (void*)&ctx->Multisample)) + goto end; } end: - ctx->AttribStack[ctx->AttribStackDepth] = head; - ctx->AttribStackDepth++; + if (head != NULL) { + ctx->AttribStack[ctx->AttribStackDepth] = head; + ctx->AttribStackDepth++; + } } @@ -641,12 +713,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, !!(enabled & TEXTURE_CUBE_BIT)); } - if (ctx->Extensions.MESA_texture_array) { - _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT, - !!(enabled & TEXTURE_1D_ARRAY_BIT)); - _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT, - !!(enabled & TEXTURE_2D_ARRAY_BIT)); - } } if (ctx->Texture.Unit[i].TexGenEnabled != genEnabled) { @@ -688,12 +754,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV, !!(unit->Enabled & TEXTURE_RECT_BIT)); } - if (ctx->Extensions.MESA_texture_array) { - _mesa_set_enable(ctx, GL_TEXTURE_1D_ARRAY_EXT, - !!(unit->Enabled & TEXTURE_1D_ARRAY_BIT)); - _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT, - !!(unit->Enabled & TEXTURE_2D_ARRAY_BIT)); - } _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode); @@ -768,7 +828,7 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) } else if ((obj->Target == GL_TEXTURE_1D_ARRAY_EXT || obj->Target == GL_TEXTURE_2D_ARRAY_EXT) && - !ctx->Extensions.MESA_texture_array) { + !ctx->Extensions.EXT_texture_array) { continue; } else if (obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY && @@ -1482,13 +1542,20 @@ restore_array_attrib(struct gl_context *ctx, * init/alloc the fields of 'attrib'. * Needs to the init part matching free_array_attrib_data below. */ -static void +static bool init_array_attrib_data(struct gl_context *ctx, struct gl_array_attrib *attrib) { /* Get a non driver gl_array_object. */ attrib->ArrayObj = CALLOC_STRUCT( gl_array_object ); + + if (attrib->ArrayObj == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib"); + return false; + } + _mesa_initialize_array_object(ctx, attrib->ArrayObj, 0); + return true; } /** @@ -1529,24 +1596,65 @@ _mesa_PushClientAttrib(GLbitfield mask) struct gl_pixelstore_attrib *attr; /* packing attribs */ attr = CALLOC_STRUCT( gl_pixelstore_attrib ); - copy_pixelstore(ctx, attr, &ctx->Pack); - save_attrib_data(&head, GL_CLIENT_PACK_BIT, attr); + if (attr == NULL) { + _mesa_error( ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib" ); + goto end; + } + if (save_attrib_data(&head, GL_CLIENT_PACK_BIT, attr)) { + copy_pixelstore(ctx, attr, &ctx->Pack); + } + else { + _mesa_error( ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib" ); + FREE(attr); + goto end; + } + /* unpacking attribs */ attr = CALLOC_STRUCT( gl_pixelstore_attrib ); - copy_pixelstore(ctx, attr, &ctx->Unpack); - save_attrib_data(&head, GL_CLIENT_UNPACK_BIT, attr); + if (attr == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib"); + goto end; + } + + if (save_attrib_data(&head, GL_CLIENT_UNPACK_BIT, attr)) { + copy_pixelstore(ctx, attr, &ctx->Unpack); + } + else { + _mesa_error( ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib" ); + FREE(attr); + goto end; + } } if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) { struct gl_array_attrib *attr; attr = CALLOC_STRUCT( gl_array_attrib ); - init_array_attrib_data(ctx, attr); - save_array_attrib(ctx, attr, &ctx->Array); - save_attrib_data(&head, GL_CLIENT_VERTEX_ARRAY_BIT, attr); - } + if (attr == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib"); + goto end; + } - ctx->ClientAttribStack[ctx->ClientAttribStackDepth] = head; - ctx->ClientAttribStackDepth++; + if (!init_array_attrib_data(ctx, attr)) { + FREE(attr); + goto end; + } + + if (save_attrib_data(&head, GL_CLIENT_VERTEX_ARRAY_BIT, attr)) { + save_array_attrib(ctx, attr, &ctx->Array); + } + else { + free_array_attrib_data(ctx, attr); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glPushClientAttrib"); + FREE(attr); + /* goto to keep safe from possible later changes */ + goto end; + } + } +end: + if (head != NULL) { + ctx->ClientAttribStack[ctx->ClientAttribStackDepth] = head; + ctx->ClientAttribStackDepth++; + } } diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index 8b5ebc489..a3d8f24b1 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -41,6 +41,9 @@ #include "fbobject.h" #include "mtypes.h" #include "texobj.h" +#include "teximage.h" +#include "glformats.h" +#include "texstore.h" #include "transformfeedback.h" #include "dispatch.h" @@ -124,11 +127,13 @@ get_buffer_target(struct gl_context *ctx, GLenum target) * Get the buffer object bound to the specified target in a GL context. * \param ctx the GL context * \param target the buffer object target to be retrieved. + * \param error the GL error to record if target is illegal. * \return pointer to the buffer object bound to \c target in the * specified context or \c NULL if \c target is invalid. */ static inline struct gl_buffer_object * -get_buffer(struct gl_context *ctx, const char *func, GLenum target) +get_buffer(struct gl_context *ctx, const char *func, GLenum target, + GLenum error) { struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); @@ -138,7 +143,7 @@ get_buffer(struct gl_context *ctx, const char *func, GLenum target) } if (!_mesa_is_bufferobj(*bufObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "%s(buffer 0)", func); + _mesa_error(ctx, error, "%s(no buffer bound)", func); return NULL; } @@ -186,25 +191,58 @@ simplified_access_mode(struct gl_context *ctx, GLbitfield access) /** + * Test if the buffer is mapped, and if so, if the mapped range overlaps the + * given range. + * The regions do not overlap if and only if the end of the given + * region is before the mapped region or the start of the given region + * is after the mapped region. + * + * \param obj Buffer object target on which to operate. + * \param offset Offset of the first byte of the subdata range. + * \param size Size, in bytes, of the subdata range. + * \return true if ranges overlap, false otherwise + * + */ +static bool +bufferobj_range_mapped(const struct gl_buffer_object *obj, + GLintptr offset, GLsizeiptr size) +{ + if (_mesa_bufferobj_mapped(obj)) { + const GLintptr end = offset + size; + const GLintptr mapEnd = obj->Offset + obj->Length; + + if (!(end <= obj->Offset || offset >= mapEnd)) { + return true; + } + } + return false; +} + + +/** * Tests the subdata range parameters and sets the GL error code for - * \c glBufferSubDataARB and \c glGetBufferSubDataARB. + * \c glBufferSubDataARB, \c glGetBufferSubDataARB and + * \c glClearBufferSubData. * * \param ctx GL context. * \param target Buffer object target on which to operate. * \param offset Offset of the first byte of the subdata range. * \param size Size, in bytes, of the subdata range. + * \param mappedRange If true, checks if an overlapping range is mapped. + * If false, checks if buffer is mapped. + * \param errorNoBuffer Error code if no buffer is bound to target. * \param caller Name of calling function for recording errors. * \return A pointer to the buffer object bound to \c target in the * specified context or \c NULL if any of the parameter or state - * conditions for \c glBufferSubDataARB or \c glGetBufferSubDataARB - * are invalid. + * conditions are invalid. * - * \sa glBufferSubDataARB, glGetBufferSubDataARB + * \sa glBufferSubDataARB, glGetBufferSubDataARB, glClearBufferSubData */ static struct gl_buffer_object * -buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, - GLintptrARB offset, GLsizeiptrARB size, - const char *caller ) +buffer_object_subdata_range_good(struct gl_context * ctx, GLenum target, + GLintptrARB offset, GLsizeiptrARB size, + bool mappedRange, GLenum errorNoBuffer, + const char *caller) { struct gl_buffer_object *bufObj; @@ -218,22 +256,30 @@ buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, return NULL; } - bufObj = get_buffer(ctx, caller, target); + bufObj = get_buffer(ctx, caller, target, errorNoBuffer); if (!bufObj) return NULL; if (offset + size > bufObj->Size) { _mesa_error(ctx, GL_INVALID_VALUE, - "%s(offset %lu + size %lu > buffer size %lu)", caller, + "%s(offset %lu + size %lu > buffer size %lu)", caller, (unsigned long) offset, (unsigned long) size, (unsigned long) bufObj->Size); return NULL; } - if (_mesa_bufferobj_mapped(bufObj)) { - /* Buffer is currently mapped */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); - return NULL; + + if (mappedRange) { + if (bufferobj_range_mapped(bufObj, offset, size)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); + return NULL; + } + } + else { + if (_mesa_bufferobj_mapped(bufObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); + return NULL; + } } return bufObj; @@ -241,6 +287,98 @@ buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target, /** + * Test the format and type parameters and set the GL error code for + * \c glClearBufferData and \c glClearBufferSubData. + * + * \param ctx GL context. + * \param internalformat Format to which the data is to be converted. + * \param format Format of the supplied data. + * \param type Type of the supplied data. + * \param caller Name of calling function for recording errors. + * \return If internalformat, format and type are legal the gl_format + * corresponding to internalformat, otherwise MESA_FORMAT_NONE. + * + * \sa glClearBufferData and glClearBufferSubData + */ +static gl_format +validate_clear_buffer_format(struct gl_context *ctx, + GLenum internalformat, + GLenum format, GLenum type, + const char *caller) +{ + gl_format mesaFormat; + GLenum errorFormatType; + + mesaFormat = _mesa_validate_texbuffer_format(ctx, internalformat); + if (mesaFormat == MESA_FORMAT_NONE) { + _mesa_error(ctx, GL_INVALID_ENUM, + "%s(invalid internalformat)", caller); + return MESA_FORMAT_NONE; + } + + /* NOTE: not mentioned in ARB_clear_buffer_object but according to + * EXT_texture_integer there is no conversion between integer and + * non-integer formats + */ + if (_mesa_is_enum_format_signed_int(format) != + _mesa_is_format_integer_color(mesaFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(integer vs non-integer)", caller); + return MESA_FORMAT_NONE; + } + + if (!_mesa_is_color_format(format)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "%s(format is not a color format)", caller); + return MESA_FORMAT_NONE; + } + + errorFormatType = _mesa_error_check_format_and_type(ctx, format, type); + if (errorFormatType != GL_NO_ERROR) { + _mesa_error(ctx, GL_INVALID_ENUM, + "%s(invalid format or type)", caller); + return MESA_FORMAT_NONE; + } + + return mesaFormat; +} + + +/** + * Convert user-specified clear value to the specified internal format. + * + * \param ctx GL context. + * \param internalformat Format to which the data is converted. + * \param clearValue Points to the converted clear value. + * \param format Format of the supplied data. + * \param type Type of the supplied data. + * \param data Data which is to be converted to internalformat. + * \param caller Name of calling function for recording errors. + * \return true if data could be converted, false otherwise. + * + * \sa glClearBufferData, glClearBufferSubData + */ +static bool +convert_clear_buffer_data(struct gl_context *ctx, + gl_format internalformat, + GLubyte *clearValue, GLenum format, GLenum type, + const GLvoid *data, const char *caller) +{ + GLenum internalformatBase = _mesa_get_format_base_format(internalformat); + + if (_mesa_texstore(ctx, 1, internalformatBase, internalformat, + 0, &clearValue, 1, 1, 1, + format, type, data, &ctx->Unpack)) { + return true; + } + else { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller); + return false; + } +} + + +/** * Allocate and initialize a new buffer object. * * Default callback for the \c dd_function_table::NewBufferObject() hook. @@ -505,6 +643,82 @@ _mesa_buffer_get_subdata( struct gl_context *ctx, GLintptrARB offset, /** + * Clear a subrange of the buffer object with copies of the supplied data. + * If data is NULL the buffer is filled with zeros. + * + * This is the default callback for \c dd_function_table::ClearBufferSubData() + * Note that all GL error checking will have been done already. + * + * \param ctx GL context. + * \param offset Offset of the first byte to be cleared. + * \param size Size, in bytes, of the to be cleared range. + * \param clearValue Source of the data. + * \param clearValueSize Size, in bytes, of the supplied data. + * \param bufObj Object to be cleared. + * + * \sa glClearBufferSubData, glClearBufferData and + * dd_function_table::ClearBufferSubData. + */ +static void +_mesa_buffer_clear_subdata(struct gl_context *ctx, + GLintptr offset, GLsizeiptr size, + const GLvoid *clearValue, + GLsizeiptr clearValueSize, + struct gl_buffer_object *bufObj) +{ + GLsizeiptr i; + GLubyte *dest; + + if (_mesa_bufferobj_mapped(bufObj)) { + GLubyte *data = malloc(size); + GLubyte *dataStart = data; + if (data == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glClearBuffer[Sub]Data"); + return; + } + + if (clearValue == NULL) { + /* Clear with zeros, per the spec */ + memset(data, 0, size); + } + else { + for (i = 0; i < size/clearValueSize; ++i) { + memcpy(data, clearValue, clearValueSize); + data += clearValueSize; + } + } + ctx->Driver.BufferSubData(ctx, offset, size, dataStart, bufObj); + return; + } + + ASSERT(ctx->Driver.MapBufferRange); + dest = ctx->Driver.MapBufferRange(ctx, offset, size, + GL_MAP_WRITE_BIT | + GL_MAP_INVALIDATE_RANGE_BIT, + bufObj); + + if (!dest) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glClearBuffer[Sub]Data"); + return; + } + + if (clearValue == NULL) { + /* Clear with zeros, per the spec */ + memset(dest, 0, size); + ctx->Driver.UnmapBuffer(ctx, bufObj); + return; + } + + for (i = 0; i < size/clearValueSize; ++i) { + memcpy(dest, clearValue, clearValueSize); + dest += clearValueSize; + } + + ctx->Driver.UnmapBuffer(ctx, bufObj); +} + + +/** * Default fallback for \c dd_function_table::MapBufferRange(). * Called via glMapBufferRange(). */ @@ -810,6 +1024,9 @@ _mesa_init_buffer_object_functions(struct dd_function_table *driver) driver->GetBufferSubData = _mesa_buffer_get_subdata; driver->UnmapBuffer = _mesa_buffer_unmap; + /* GL_ARB_clear_buffer_object */ + driver->ClearBufferSubData = _mesa_buffer_clear_subdata; + /* GL_ARB_map_buffer_range */ driver->MapBufferRange = _mesa_buffer_map_range; driver->FlushMappedBufferRange = _mesa_buffer_flush_mapped_range; @@ -1064,7 +1281,7 @@ _mesa_BufferData(GLenum target, GLsizeiptrARB size, return; } - bufObj = get_buffer(ctx, "glBufferDataARB", target); + bufObj = get_buffer(ctx, "glBufferDataARB", target, GL_INVALID_OPERATION); if (!bufObj) return; @@ -1103,6 +1320,7 @@ _mesa_BufferSubData(GLenum target, GLintptrARB offset, struct gl_buffer_object *bufObj; bufObj = buffer_object_subdata_range_good( ctx, target, offset, size, + false, GL_INVALID_OPERATION, "glBufferSubDataARB" ); if (!bufObj) { /* error already recorded */ @@ -1126,8 +1344,9 @@ _mesa_GetBufferSubData(GLenum target, GLintptrARB offset, GET_CURRENT_CONTEXT(ctx); struct gl_buffer_object *bufObj; - bufObj = buffer_object_subdata_range_good( ctx, target, offset, size, - "glGetBufferSubDataARB" ); + bufObj = buffer_object_subdata_range_good(ctx, target, offset, size, + false, GL_INVALID_OPERATION, + "glGetBufferSubDataARB"); if (!bufObj) { /* error already recorded */ return; @@ -1138,6 +1357,111 @@ _mesa_GetBufferSubData(GLenum target, GLintptrARB offset, } +void GLAPIENTRY +_mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, + GLenum type, const GLvoid* data) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object* bufObj; + gl_format mesaFormat; + GLubyte clearValue[MAX_PIXEL_BYTES]; + GLsizeiptr clearValueSize; + + bufObj = get_buffer(ctx, "glClearBufferData", target, GL_INVALID_VALUE); + if (!bufObj) { + return; + } + + if (_mesa_bufferobj_mapped(bufObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glClearBufferData(buffer currently mapped)"); + return; + } + + mesaFormat = validate_clear_buffer_format(ctx, internalformat, + format, type, + "glClearBufferData"); + if (mesaFormat == MESA_FORMAT_NONE) { + return; + } + + clearValueSize = _mesa_get_format_bytes(mesaFormat); + if (bufObj->Size % clearValueSize != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glClearBufferData(size is not a multiple of " + "internalformat size)"); + return; + } + + if (data == NULL) { + /* clear to zeros, per the spec */ + ctx->Driver.ClearBufferSubData(ctx, 0, bufObj->Size, + NULL, 0, bufObj); + return; + } + + if (!convert_clear_buffer_data(ctx, mesaFormat, clearValue, + format, type, data, "glClearBufferData")) { + return; + } + + ctx->Driver.ClearBufferSubData(ctx, 0, bufObj->Size, + clearValue, clearValueSize, bufObj); +} + + +void GLAPIENTRY +_mesa_ClearBufferSubData(GLenum target, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid* data) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object* bufObj; + gl_format mesaFormat; + GLubyte clearValue[MAX_PIXEL_BYTES]; + GLsizeiptr clearValueSize; + + bufObj = buffer_object_subdata_range_good(ctx, target, offset, size, + true, GL_INVALID_VALUE, + "glClearBufferSubData"); + if (!bufObj) { + return; + } + + mesaFormat = validate_clear_buffer_format(ctx, internalformat, + format, type, + "glClearBufferSubData"); + if (mesaFormat == MESA_FORMAT_NONE) { + return; + } + + clearValueSize = _mesa_get_format_bytes(mesaFormat); + if (offset % clearValueSize != 0 || size % clearValueSize != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glClearBufferSubData(offset or size is not a multiple of " + "internalformat size)"); + return; + } + + if (data == NULL) { + /* clear to zeros, per the spec */ + ctx->Driver.ClearBufferSubData(ctx, offset, size, + NULL, 0, bufObj); + return; + } + + if (!convert_clear_buffer_data(ctx, mesaFormat, clearValue, + format, type, data, + "glClearBufferSubData")) { + return; + } + + ctx->Driver.ClearBufferSubData(ctx, offset, size, + clearValue, clearValueSize, bufObj); +} + + void * GLAPIENTRY _mesa_MapBuffer(GLenum target, GLenum access) { @@ -1172,7 +1496,7 @@ _mesa_MapBuffer(GLenum target, GLenum access) return NULL; } - bufObj = get_buffer(ctx, "glMapBufferARB", target); + bufObj = get_buffer(ctx, "glMapBufferARB", target, GL_INVALID_OPERATION); if (!bufObj) return NULL; @@ -1241,7 +1565,7 @@ _mesa_UnmapBuffer(GLenum target) GLboolean status = GL_TRUE; ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - bufObj = get_buffer(ctx, "glUnmapBufferARB", target); + bufObj = get_buffer(ctx, "glUnmapBufferARB", target, GL_INVALID_OPERATION); if (!bufObj) return GL_FALSE; @@ -1302,7 +1626,8 @@ _mesa_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); struct gl_buffer_object *bufObj; - bufObj = get_buffer(ctx, "glGetBufferParameterivARB", target); + bufObj = get_buffer(ctx, "glGetBufferParameterivARB", target, + GL_INVALID_OPERATION); if (!bufObj) return; @@ -1355,7 +1680,8 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params) GET_CURRENT_CONTEXT(ctx); struct gl_buffer_object *bufObj; - bufObj = get_buffer(ctx, "glGetBufferParameteri64v", target); + bufObj = get_buffer(ctx, "glGetBufferParameteri64v", target, + GL_INVALID_OPERATION); if (!bufObj) return; @@ -1408,7 +1734,8 @@ _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params) return; } - bufObj = get_buffer(ctx, "glGetBufferPointervARB", target); + bufObj = get_buffer(ctx, "glGetBufferPointervARB", target, + GL_INVALID_OPERATION); if (!bufObj) return; @@ -1424,11 +1751,13 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GET_CURRENT_CONTEXT(ctx); struct gl_buffer_object *src, *dst; - src = get_buffer(ctx, "glCopyBufferSubData", readTarget); + src = get_buffer(ctx, "glCopyBufferSubData", readTarget, + GL_INVALID_OPERATION); if (!src) return; - dst = get_buffer(ctx, "glCopyBufferSubData", writeTarget); + dst = get_buffer(ctx, "glCopyBufferSubData", writeTarget, + GL_INVALID_OPERATION); if (!dst) return; @@ -1572,7 +1901,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, return NULL; } - bufObj = get_buffer(ctx, "glMapBufferRange", target); + bufObj = get_buffer(ctx, "glMapBufferRange", target, GL_INVALID_OPERATION); if (!bufObj) return NULL; @@ -1651,7 +1980,8 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) return; } - bufObj = get_buffer(ctx, "glFlushMappedBufferRange", target); + bufObj = get_buffer(ctx, "glFlushMappedBufferRange", target, + GL_INVALID_OPERATION); if (!bufObj) return; @@ -2331,23 +2661,11 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset, * mapped by MapBuffer, or if the invalidate range intersects the range * currently mapped by MapBufferRange." */ - if (_mesa_bufferobj_mapped(bufObj)) { - const GLintptr mapEnd = bufObj->Offset + bufObj->Length; - - /* The regions do not overlap if and only if the end of the discard - * region is before the mapped region or the start of the discard region - * is after the mapped region. - * - * Note that 'end' and 'mapEnd' are the first byte *after* the discard - * region and the mapped region, repsectively. It is okay for that byte - * to be mapped (for 'end') or discarded (for 'mapEnd'). - */ - if (!(end <= bufObj->Offset || offset >= mapEnd)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glInvalidateBufferSubData(intersection with mapped " - "range)"); - return; - } + if (bufferobj_range_mapped(bufObj, offset, length)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glInvalidateBufferSubData(intersection with mapped " + "range)"); + return; } /* We don't actually do anything for this yet. Just return after diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h index 0b898a21b..71988b0d9 100644 --- a/mesalib/src/mesa/main/bufferobj.h +++ b/mesalib/src/mesa/main/bufferobj.h @@ -57,10 +57,10 @@ _mesa_is_bufferobj(const struct gl_buffer_object *obj) extern void -_mesa_init_buffer_objects( struct gl_context *ctx ); +_mesa_init_buffer_objects(struct gl_context *ctx); extern void -_mesa_free_buffer_objects( struct gl_context *ctx ); +_mesa_free_buffer_objects(struct gl_context *ctx); extern bool _mesa_handle_bind_buffer_gen(struct gl_context *ctx, @@ -77,9 +77,9 @@ extern struct gl_buffer_object * _mesa_lookup_bufferobj(struct gl_context *ctx, GLuint buffer); extern void -_mesa_initialize_buffer_object( struct gl_context *ctx, - struct gl_buffer_object *obj, - GLuint name, GLenum target ); +_mesa_initialize_buffer_object(struct gl_context *ctx, + struct gl_buffer_object *obj, + GLuint name, GLenum target); extern void _mesa_reference_buffer_object_(struct gl_context *ctx, @@ -105,55 +105,90 @@ _mesa_init_buffer_object_functions(struct dd_function_table *driver); /* * API functions */ - void GLAPIENTRY _mesa_BindBuffer(GLenum target, GLuint buffer); + void GLAPIENTRY _mesa_DeleteBuffers(GLsizei n, const GLuint * buffer); + void GLAPIENTRY _mesa_GenBuffers(GLsizei n, GLuint * buffer); + GLboolean GLAPIENTRY _mesa_IsBuffer(GLuint buffer); + void GLAPIENTRY -_mesa_BufferData(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); +_mesa_BufferData(GLenum target, GLsizeiptrARB size, + const GLvoid * data, GLenum usage); + void GLAPIENTRY -_mesa_BufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); +_mesa_BufferSubData(GLenum target, GLintptrARB offset, + GLsizeiptrARB size, const GLvoid * data); + void GLAPIENTRY -_mesa_GetBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); +_mesa_GetBufferSubData(GLenum target, GLintptrARB offset, + GLsizeiptrARB size, void * data); + +void GLAPIENTRY +_mesa_ClearBufferData(GLenum target, GLenum internalformat, + GLenum format, GLenum type, + const GLvoid * data); + +void GLAPIENTRY +_mesa_ClearBufferSubData(GLenum target, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid * data); + void * GLAPIENTRY _mesa_MapBuffer(GLenum target, GLenum access); + GLboolean GLAPIENTRY _mesa_UnmapBuffer(GLenum target); + void GLAPIENTRY _mesa_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params); + void GLAPIENTRY _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params); + void GLAPIENTRY _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params); + void GLAPIENTRY _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + void * GLAPIENTRY _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + void GLAPIENTRY -_mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); +_mesa_FlushMappedBufferRange(GLenum target, + GLintptr offset, GLsizeiptr length); + GLenum GLAPIENTRY _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); + GLenum GLAPIENTRY _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); + void GLAPIENTRY -_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, - GLint* params); +_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, + GLenum pname, GLint* params); + void GLAPIENTRY _mesa_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); + void GLAPIENTRY _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); + void GLAPIENTRY _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length); + void GLAPIENTRY _mesa_InvalidateBufferData(GLuint buffer); diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c index 304d135d1..f0b525fa0 100644 --- a/mesalib/src/mesa/main/clear.c +++ b/mesalib/src/mesa/main/clear.c @@ -219,7 +219,25 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer) const struct gl_renderbuffer_attachment *att = ctx->DrawBuffer->Attachment; GLbitfield mask = 0x0; - switch (drawbuffer) { + /* From the GL 4.0 specification: + * If buffer is COLOR, a particular draw buffer DRAW_BUFFERi is + * specified by passing i as the parameter drawbuffer, and value + * points to a four-element vector specifying the R, G, B, and A + * color to clear that draw buffer to. If the draw buffer is one + * of FRONT, BACK, LEFT, RIGHT, or FRONT_AND_BACK, identifying + * multiple buffers, each selected buffer is cleared to the same + * value. + * + * Note that "drawbuffer" and "draw buffer" have different meaning. + * "drawbuffer" specifies DRAW_BUFFERi, while "draw buffer" is what's + * assigned to DRAW_BUFFERi. It could be COLOR_ATTACHMENT0, FRONT, BACK, + * etc. + */ + if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) { + return INVALID_MASK; + } + + switch (ctx->DrawBuffer->ColorDrawBuffer[drawbuffer]) { case GL_FRONT: if (att[BUFFER_FRONT_LEFT].Renderbuffer) mask |= BUFFER_BIT_FRONT_LEFT; @@ -255,11 +273,12 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer) mask |= BUFFER_BIT_BACK_RIGHT; break; default: - if (drawbuffer < 0 || drawbuffer >= (GLint)ctx->Const.MaxDrawBuffers) { - mask = INVALID_MASK; - } - else if (att[BUFFER_COLOR0 + drawbuffer].Renderbuffer) { - mask |= (BUFFER_BIT_COLOR0 << drawbuffer); + { + GLuint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer]; + + if (buf >= 0 && att[buf].Renderbuffer) { + mask |= 1 << buf; + } } } diff --git a/mesalib/src/mesa/main/colortab.c b/mesalib/src/mesa/main/colortab.c index 81e92d71c..a8edb03dd 100644 --- a/mesalib/src/mesa/main/colortab.c +++ b/mesalib/src/mesa/main/colortab.c @@ -44,7 +44,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, const GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTable"); } @@ -55,7 +55,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, const GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glColorSubTable"); } @@ -65,7 +65,7 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorTable(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyColorTable"); } @@ -75,7 +75,7 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyColorSubTable(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyColorSubTable"); } @@ -85,7 +85,7 @@ _mesa_GetnColorTableARB( GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetnColorTableARB(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetnColorTableARB"); } @@ -94,7 +94,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetColorTable"); } @@ -103,7 +103,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { /* no extensions use this function */ GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameterfv(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTableParameterfv"); } @@ -113,7 +113,7 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { /* no extensions use this function */ GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameteriv(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glColorTableParameteriv"); } @@ -122,7 +122,7 @@ void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameterfv(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetColorTableParameterfv"); } @@ -131,5 +131,5 @@ void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameteriv(target)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetColorTableParameteriv"); } diff --git a/mesalib/src/mesa/main/condrender.c b/mesalib/src/mesa/main/condrender.c index 3d9b0eca1..2632f7a1a 100644 --- a/mesalib/src/mesa/main/condrender.c +++ b/mesalib/src/mesa/main/condrender.c @@ -72,7 +72,9 @@ _mesa_BeginConditionalRender(GLuint queryId, GLenum mode) } ASSERT(q->Id == queryId); - if (q->Target != GL_SAMPLES_PASSED || q->Active) { + if ((q->Target != GL_SAMPLES_PASSED && + q->Target != GL_ANY_SAMPLES_PASSED && + q->Target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE) || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginConditionalRender()"); return; } diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 87a4a3545..658499fa4 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -1194,6 +1194,7 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_free_sync_data(ctx); _mesa_free_varray_data(ctx); _mesa_free_transform_feedback(ctx); + _mesa_free_performance_monitors(ctx); _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL); diff --git a/mesalib/src/mesa/main/convolve.c b/mesalib/src/mesa/main/convolve.c index f44031a9b..b13b89535 100644 --- a/mesalib/src/mesa/main/convolve.c +++ b/mesalib/src/mesa/main/convolve.c @@ -45,7 +45,7 @@ _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, G { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter1D"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter1D"); } void GLAPIENTRY @@ -53,7 +53,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionFilter2D"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionFilter2D"); } @@ -62,7 +62,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterf"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameterf"); } @@ -71,7 +71,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameterfv"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameterfv"); } @@ -80,7 +80,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteri"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameteri"); } @@ -89,7 +89,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glConvolutionParameteriv"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glConvolutionParameteriv"); } @@ -98,7 +98,7 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter1D"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyConvolutionFilter1D"); } @@ -107,7 +107,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glCopyConvolutionFilter2D"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyConvolutionFilter2D"); } @@ -134,7 +134,7 @@ _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameterfv"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionParameterfv"); } @@ -143,7 +143,7 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetConvolutionParameteriv"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionParameteriv"); } @@ -155,7 +155,7 @@ _mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type, { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSeparableFilter"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetSeparableFilter"); } @@ -173,5 +173,5 @@ _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLs { GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glSeparableFilter2D"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glSeparableFilter2D"); } diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index b5b874f47..6e73691ea 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -375,6 +375,11 @@ struct dd_function_table { GLsizei levels, GLsizei width, GLsizei height, GLsizei depth); + /** Called as part of glTextureView to add views to origTexObj */ + GLboolean (*TextureView)(struct gl_context *ctx, + struct gl_texture_object *texObj, + struct gl_texture_object *origTexObj); + /** * Map a renderbuffer into user space. * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and @@ -569,6 +574,12 @@ struct dd_function_table { GLintptrARB offset, GLsizeiptrARB size, GLvoid *data, struct gl_buffer_object *obj ); + void (*ClearBufferSubData)( struct gl_context *ctx, + GLintptr offset, GLsizeiptr size, + const GLvoid *clearValue, + GLsizeiptr clearValueSize, + struct gl_buffer_object *obj ); + void (*CopyBufferSubData)( struct gl_context *ctx, struct gl_buffer_object *src, struct gl_buffer_object *dst, diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 595641915..cb40ff4db 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -209,18 +209,6 @@ typedef enum OPCODE_COLOR_MASK, OPCODE_COLOR_MASK_INDEXED, OPCODE_COLOR_MATERIAL, - OPCODE_COLOR_TABLE, - OPCODE_COLOR_TABLE_PARAMETER_FV, - OPCODE_COLOR_TABLE_PARAMETER_IV, - OPCODE_COLOR_SUB_TABLE, - OPCODE_CONVOLUTION_FILTER_1D, - OPCODE_CONVOLUTION_FILTER_2D, - OPCODE_CONVOLUTION_PARAMETER_I, - OPCODE_CONVOLUTION_PARAMETER_IV, - OPCODE_CONVOLUTION_PARAMETER_F, - OPCODE_CONVOLUTION_PARAMETER_FV, - OPCODE_COPY_COLOR_SUB_TABLE, - OPCODE_COPY_COLOR_TABLE, OPCODE_COPY_PIXELS, OPCODE_COPY_TEX_IMAGE1D, OPCODE_COPY_TEX_IMAGE2D, @@ -243,7 +231,6 @@ typedef enum OPCODE_FRONT_FACE, OPCODE_FRUSTUM, OPCODE_HINT, - OPCODE_HISTOGRAM, OPCODE_INDEX_MASK, OPCODE_INIT_NAMES, OPCODE_LIGHT, @@ -260,7 +247,6 @@ typedef enum OPCODE_MAPGRID1, OPCODE_MAPGRID2, OPCODE_MATRIX_MODE, - OPCODE_MIN_MAX, OPCODE_MULT_MATRIX, OPCODE_ORTHO, OPCODE_PASSTHROUGH, @@ -281,8 +267,6 @@ typedef enum OPCODE_PUSH_NAME, OPCODE_RASTER_POS, OPCODE_READ_BUFFER, - OPCODE_RESET_HISTOGRAM, - OPCODE_RESET_MIN_MAX, OPCODE_ROTATE, OPCODE_SCALE, OPCODE_SCISSOR, @@ -486,6 +470,10 @@ typedef enum * Each instruction in the display list is stored as a sequence of * contiguous nodes in memory. * Each node is the union of a variety of data types. + * + * Note, all of these members should be 4 bytes in size or less for the + * sake of compact display lists. We store 8-byte pointers in a pair of + * these nodes using the save/get_pointer() functions below. */ union gl_dlist_node { @@ -500,14 +488,61 @@ union gl_dlist_node GLenum e; GLfloat f; GLsizei si; - GLvoid *data; - void *next; /* If prev node's opcode==OPCODE_CONTINUE */ }; typedef union gl_dlist_node Node; +/** How many 4-byte dwords to store a pointer */ +#define POINTER_DWORDS (sizeof(void *) / 4) + +/* We want to keep sizeof(union gl_dlist_node) == 4 to minimize + * space for display lists. The following types and functions are + * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes. + */ +union pointer +{ + void *ptr; + GLuint dwords[POINTER_DWORDS]; +}; + + +/** + * Save a 4 or 8-byte pointer at dest (and dest+1). + */ +static inline void +save_pointer(union gl_dlist_node *dest, void *src) +{ + union pointer p; + unsigned i; + + STATIC_ASSERT(POINTER_DWORDS == 1 || POINTER_DWORDS == 2); + STATIC_ASSERT(sizeof(union gl_dlist_node) == 4); + + p.ptr = src; + + for (i = 0; i < POINTER_DWORDS; i++) + dest[i].ui = p.dwords[i]; +} + + +/** + * Retrieve a 4 or 8-byte pointer from node (node+1). + */ +static inline void * +get_pointer(const union gl_dlist_node *node) +{ + union pointer p; + unsigned i; + + for (i = 0; i < POINTER_DWORDS; i++) + p.dwords[i] = node[i].ui; + + return p.ptr; +} + + /** * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit * environment. In 64-bit env, sizeof(Node)==8 anyway. @@ -520,9 +555,9 @@ union uint64_pair /** - * How many nodes to allocate at a time. - * - * \note Reduced now that we hold vertices etc. elsewhere. + * How many nodes to allocate at a time. Note that bulk vertex data + * from glBegin/glVertex/glEnd primitives will typically wind up in + * a VBO, and not directly in the display list itself. */ #define BLOCK_SIZE 256 @@ -538,14 +573,9 @@ static GLuint InstSize[OPCODE_END_OF_LIST + 1]; void mesa_print_display_list(GLuint list); -/**********************************************************************/ -/***** Private *****/ -/**********************************************************************/ - - /** - * Make an empty display list. This is used by glGenLists() to - * reserve display list IDs. + * Allocate a gl_display_list object with an initial block of storage. + * \param count how many display list nodes/tokes to allocate */ static struct gl_display_list * make_list(GLuint name, GLuint count) @@ -637,91 +667,75 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: - free(n[6].data); + free(get_pointer(&n[6])); n += InstSize[n[0].opcode]; break; case OPCODE_MAP2: - free(n[10].data); + free(get_pointer(&n[10])); n += InstSize[n[0].opcode]; break; case OPCODE_DRAW_PIXELS: - free(n[5].data); + free(get_pointer(&n[5])); n += InstSize[n[0].opcode]; break; case OPCODE_BITMAP: - free(n[7].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COLOR_TABLE: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_COLOR_SUB_TABLE: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_1D: - free(n[6].data); - n += InstSize[n[0].opcode]; - break; - case OPCODE_CONVOLUTION_FILTER_2D: - free(n[7].data); + free(get_pointer(&n[7])); n += InstSize[n[0].opcode]; break; case OPCODE_POLYGON_STIPPLE: - free(n[1].data); + free(get_pointer(&n[1])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE1D: - free(n[8].data); + free(get_pointer(&n[8])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE2D: - free(n[9].data); + free(get_pointer(&n[9])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE3D: - free(n[10].data); + free(get_pointer(&n[10])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE1D: - free(n[7].data); + free(get_pointer(&n[7])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE2D: - free(n[9].data); + free(get_pointer(&n[9])); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE3D: - free(n[11].data); + free(get_pointer(&n[11])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_1D: - free(n[7].data); + free(get_pointer(&n[7])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_2D: - free(n[8].data); + free(get_pointer(&n[8])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_3D: - free(n[9].data); + free(get_pointer(&n[9])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: - free(n[7].data); + free(get_pointer(&n[7])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: - free(n[9].data); + free(get_pointer(&n[9])); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: - free(n[11].data); + free(get_pointer(&n[11])); n += InstSize[n[0].opcode]; break; case OPCODE_PROGRAM_STRING_ARB: - free(n[4].data); /* program string */ + free(get_pointer(&n[4])); /* program string */ n += InstSize[n[0].opcode]; break; case OPCODE_UNIFORM_1FV: @@ -736,7 +750,7 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_2UIV: case OPCODE_UNIFORM_3UIV: case OPCODE_UNIFORM_4UIV: - free(n[3].data); + free(get_pointer(&n[3])); n += InstSize[n[0].opcode]; break; case OPCODE_UNIFORM_MATRIX22: @@ -748,12 +762,15 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_MATRIX32: case OPCODE_UNIFORM_MATRIX34: case OPCODE_UNIFORM_MATRIX43: - free(n[4].data); + free(get_pointer(&n[4])); n += InstSize[n[0].opcode]; break; + case OPCODE_PIXEL_MAP: + free(get_pointer(&n[3])); + break; case OPCODE_CONTINUE: - n = (Node *) n[1].next; + n = (Node *) get_pointer(&n[1]); free(block); block = n; break; @@ -852,12 +869,6 @@ translate_id(GLsizei n, GLenum type, const GLvoid * list) } - - -/**********************************************************************/ -/***** Public *****/ -/**********************************************************************/ - /** * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects. * If width < 0 or height < 0 or format or type are invalid we'll just @@ -929,6 +940,18 @@ unpack_image(struct gl_context *ctx, GLuint dimensions, return NULL; } + +/** Return copy of memory */ +static void * +memdup(const void *src, GLsizei bytes) +{ + void *b = bytes >= 0 ? malloc(bytes) : NULL; + if (b) + memcpy(b, src, bytes); + return b; +} + + /** * Allocate space for a display list instruction (opcode + payload space). * \param opcode the instruction opcode (OPCODE_* value) @@ -939,6 +962,7 @@ static Node * dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes) { const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); + const GLuint contNodes = 1 + POINTER_DWORDS; /* size of continue info */ Node *n; if (opcode < (GLuint) OPCODE_EXT_0) { @@ -952,7 +976,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes) } } - if (ctx->ListState.CurrentPos + numNodes + 2 > BLOCK_SIZE) { + if (ctx->ListState.CurrentPos + numNodes + contNodes > BLOCK_SIZE) { /* This block is full. Allocate a new block and chain to it */ Node *newblock; n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; @@ -962,7 +986,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes) _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list"); return NULL; } - n[1].next = (Node *) newblock; + save_pointer(&n[1], newblock); ctx->ListState.CurrentBlock = newblock; ctx->ListState.CurrentPos = 0; } @@ -1043,6 +1067,37 @@ alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams) } +/** + * Called by EndList to try to reduce memory used for the list. + */ +static void +trim_list(struct gl_context *ctx) +{ + /* If the list we're ending only has one allocated block of nodes/tokens + * and its size isn't a full block size, realloc the block to use less + * memory. This is important for apps that create many small display + * lists and apps that use glXUseXFont (many lists each containing one + * glBitmap call). + * Note: we currently only trim display lists that allocated one block + * of tokens. That hits the short list case which is what we're mainly + * concerned with. Trimming longer lists would involve traversing the + * linked list of blocks. + */ + struct gl_dlist_state *list = &ctx->ListState; + + if ((list->CurrentList->Head == list->CurrentBlock) && + (list->CurrentPos < BLOCK_SIZE)) { + /* There's only one block and it's not full, so realloc */ + GLuint newSize = list->CurrentPos * sizeof(Node); + list->CurrentList->Head = + list->CurrentBlock = realloc(list->CurrentBlock, newSize); + if (!list->CurrentBlock) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEndList"); + } + } +} + + /* * Display List compilation functions @@ -1106,7 +1161,7 @@ save_Bitmap(GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BITMAP, 7); + n = alloc_instruction(ctx, OPCODE_BITMAP, 6 + POINTER_DWORDS); if (n) { n[1].i = (GLint) width; n[2].i = (GLint) height; @@ -1114,8 +1169,9 @@ save_Bitmap(GLsizei width, GLsizei height, n[4].f = yorig; n[5].f = xmove; n[6].f = ymove; - n[7].data = unpack_image(ctx, 2, width, height, 1, GL_COLOR_INDEX, - GL_BITMAP, pixels, &ctx->Unpack); + save_pointer(&n[7], + unpack_image(ctx, 2, width, height, 1, GL_COLOR_INDEX, + GL_BITMAP, pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_Bitmap(ctx->Exec, (width, height, @@ -1735,313 +1791,6 @@ save_ColorMaterial(GLenum face, GLenum mode) static void GLAPIENTRY -save_ColorTable(GLenum target, GLenum internalFormat, - GLsizei width, GLenum format, GLenum type, - const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - if (_mesa_is_proxy_texture(target)) { - /* execute immediately */ - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - else { - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, table, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ColorTable(ctx->Exec, (target, internalFormat, width, - format, type, table)); - } - } -} - - - -static void GLAPIENTRY -save_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_COLOR_TABLE_SGI || - pname == GL_POST_CONVOLUTION_COLOR_TABLE_SGI || - pname == GL_TEXTURE_COLOR_TABLE_SGI) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - } - - if (ctx->ExecuteFlag) { - CALL_ColorTableParameteriv(ctx->Exec, (target, pname, params)); - } -} - - - -static void GLAPIENTRY -save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, - GLenum format, GLenum type, const GLvoid * table) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = count; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, count, 1, 1, format, type, table, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ColorSubTable(ctx->Exec, - (target, start, count, format, type, table)); - } -} - - -static void GLAPIENTRY -save_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); - if (n) { - n[1].e = target; - n[2].i = start; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorSubTable(ctx->Exec, (target, start, x, y, width)); - } -} - - -static void GLAPIENTRY -save_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5); - if (n) { - n[1].e = target; - n[2].e = internalformat; - n[3].i = x; - n[4].i = y; - n[5].i = width; - } - if (ctx->ExecuteFlag) { - CALL_CopyColorTable(ctx->Exec, (target, internalformat, x, y, width)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, - GLenum format, GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].e = format; - n[5].e = type; - n[6].data = unpack_image(ctx, 1, width, 1, 1, format, type, filter, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter1D(ctx->Exec, (target, internalFormat, width, - format, type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const GLvoid * filter) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].i = width; - n[4].i = height; - n[5].e = format; - n[6].e = type; - n[7].data = unpack_image(ctx, 2, width, height, 1, format, type, filter, - &ctx->Unpack); - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionFilter2D(ctx->Exec, - (target, internalFormat, width, height, format, - type, filter)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteri(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - else { - n[4].i = n[5].i = n[6].i = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameteriv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = param; - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterf(ctx->Exec, (target, pname, param)); - } -} - - -static void GLAPIENTRY -save_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); - if (n) { - n[1].e = target; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_CONVOLUTION_BORDER_COLOR || - pname == GL_CONVOLUTION_FILTER_SCALE || - pname == GL_CONVOLUTION_FILTER_BIAS) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - else { - n[4].f = n[5].f = n[6].f = 0.0F; - } - } - if (ctx->ExecuteFlag) { - CALL_ConvolutionParameterfv(ctx->Exec, (target, pname, params)); - } -} - - -static void GLAPIENTRY save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) { GET_CURRENT_CONTEXT(ctx); @@ -2314,14 +2063,15 @@ save_DrawPixels(GLsizei width, GLsizei height, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 4 + POINTER_DWORDS); if (n) { n[1].i = width; n[2].i = height; n[3].e = format; n[4].e = type; - n[5].data = unpack_image(ctx, 2, width, height, 1, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[5], + unpack_image(ctx, 2, width, height, 1, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels)); @@ -2530,27 +2280,6 @@ save_Hint(GLenum target, GLenum mode) static void GLAPIENTRY -save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, - GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4); - if (n) { - n[1].e = target; - n[2].i = width; - n[3].e = internalFormat; - n[4].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Histogram(ctx->Exec, (target, width, internalFormat, sink)); - } -} - - -static void GLAPIENTRY save_IndexMask(GLuint mask) { GET_CURRENT_CONTEXT(ctx); @@ -2890,7 +2619,7 @@ save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS); if (n) { GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points); n[1].e = target; @@ -2898,7 +2627,7 @@ save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, n[3].f = (GLfloat) u2; n[4].i = _mesa_evaluator_components(target); /* stride */ n[5].i = order; - n[6].data = (void *) pnts; + save_pointer(&n[6], pnts); } if (ctx->ExecuteFlag) { CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points)); @@ -2912,7 +2641,7 @@ save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS); if (n) { GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points); n[1].e = target; @@ -2920,7 +2649,7 @@ save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, n[3].f = u2; n[4].i = _mesa_evaluator_components(target); /* stride */ n[5].i = order; - n[6].data = (void *) pnts; + save_pointer(&n[6], pnts); } if (ctx->ExecuteFlag) { CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points)); @@ -2937,7 +2666,7 @@ save_Map2d(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS); if (n) { GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder, vstride, vorder, points); @@ -2951,7 +2680,7 @@ save_Map2d(GLenum target, n[7].i = _mesa_evaluator_components(target); /*vstride */ n[8].i = uorder; n[9].i = vorder; - n[10].data = (void *) pnts; + save_pointer(&n[10], pnts); } if (ctx->ExecuteFlag) { CALL_Map2d(ctx->Exec, (target, @@ -2970,7 +2699,7 @@ save_Map2f(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS); if (n) { GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder, vstride, vorder, points); @@ -2984,7 +2713,7 @@ save_Map2f(GLenum target, n[7].i = _mesa_evaluator_components(target); /*vstride */ n[8].i = uorder; n[9].i = vorder; - n[10].data = (void *) pnts; + save_pointer(&n[10], pnts); } if (ctx->ExecuteFlag) { CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder, @@ -3067,25 +2796,6 @@ save_MatrixMode(GLenum mode) static void GLAPIENTRY -save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].b = sink; - } - if (ctx->ExecuteFlag) { - CALL_Minmax(ctx->Exec, (target, internalFormat, sink)); - } -} - - -static void GLAPIENTRY save_MultMatrixf(const GLfloat * m) { GET_CURRENT_CONTEXT(ctx); @@ -3156,12 +2866,11 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3); + n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 2 + POINTER_DWORDS); if (n) { n[1].e = map; n[2].i = mapsize; - n[3].data = malloc(mapsize * sizeof(GLfloat)); - memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); + save_pointer(&n[3], memdup(values, mapsize * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_PixelMapfv(ctx->Exec, (map, mapsize, values)); @@ -3336,10 +3045,11 @@ save_PolygonStipple(const GLubyte * pattern) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1); + n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, POINTER_DWORDS); if (n) { - n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, - pattern, &ctx->Unpack); + save_pointer(&n[1], + unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, + pattern, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern)); @@ -3667,38 +3377,6 @@ save_ReadBuffer(GLenum mode) static void GLAPIENTRY -save_ResetHistogram(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetHistogram(ctx->Exec, (target)); - } -} - - -static void GLAPIENTRY -save_ResetMinmax(GLenum target) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1); - if (n) { - n[1].e = target; - } - if (ctx->ExecuteFlag) { - CALL_ResetMinmax(ctx->Exec, (target)); - } -} - - -static void GLAPIENTRY save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { GET_CURRENT_CONTEXT(ctx); @@ -4140,7 +3818,7 @@ save_TexImage1D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 7 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4149,8 +3827,9 @@ save_TexImage1D(GLenum target, n[5].i = border; n[6].e = format; n[7].e = type; - n[8].data = unpack_image(ctx, 1, width, 1, 1, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[8], + unpack_image(ctx, 1, width, 1, 1, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexImage1D(ctx->Exec, (target, level, components, width, @@ -4175,7 +3854,7 @@ save_TexImage2D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 8 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4185,8 +3864,9 @@ save_TexImage2D(GLenum target, n[6].i = border; n[7].e = format; n[8].e = type; - n[9].data = unpack_image(ctx, 2, width, height, 1, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[9], + unpack_image(ctx, 2, width, height, 1, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexImage2D(ctx->Exec, (target, level, components, width, @@ -4213,7 +3893,7 @@ save_TexImage3D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 9 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4224,8 +3904,9 @@ save_TexImage3D(GLenum target, n[7].i = border; n[8].e = format; n[9].e = type; - n[10].data = unpack_image(ctx, 3, width, height, depth, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[10], + unpack_image(ctx, 3, width, height, depth, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width, @@ -4246,7 +3927,7 @@ save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 6 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4254,8 +3935,9 @@ save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, n[4].i = (GLint) width; n[5].e = format; n[6].e = type; - n[7].data = unpack_image(ctx, 1, width, 1, 1, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[7], + unpack_image(ctx, 1, width, 1, 1, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width, @@ -4275,7 +3957,7 @@ save_TexSubImage2D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 8 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4285,8 +3967,9 @@ save_TexSubImage2D(GLenum target, GLint level, n[6].i = (GLint) height; n[7].e = format; n[8].e = type; - n[9].data = unpack_image(ctx, 2, width, height, 1, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[9], + unpack_image(ctx, 2, width, height, 1, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset, @@ -4306,7 +3989,7 @@ save_TexSubImage3D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 10 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4318,8 +4001,9 @@ save_TexSubImage3D(GLenum target, GLint level, n[8].i = (GLint) depth; n[9].e = format; n[10].e = type; - n[11].data = unpack_image(ctx, 3, width, height, depth, format, type, - pixels, &ctx->Unpack); + save_pointer(&n[11], + unpack_image(ctx, 3, width, height, depth, format, type, + pixels, &ctx->Unpack)); } if (ctx->ExecuteFlag) { CALL_TexSubImage3D(ctx->Exec, (target, level, @@ -4626,7 +4310,8 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, + 6 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4634,7 +4319,8 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, n[4].i = (GLint) width; n[5].i = border; n[6].i = imageSize; - n[7].data = copy_data(data, imageSize, "glCompressedTexImage1DARB"); + save_pointer(&n[7], + copy_data(data, imageSize, "glCompressedTexImage1DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage1D(ctx->Exec, @@ -4662,7 +4348,8 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, + 7 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4671,7 +4358,8 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, n[5].i = (GLint) height; n[6].i = border; n[7].i = imageSize; - n[8].data = copy_data(data, imageSize, "glCompressedTexImage2DARB"); + save_pointer(&n[8], + copy_data(data, imageSize, "glCompressedTexImage2DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage2D(ctx->Exec, @@ -4699,7 +4387,8 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, + 8 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4709,7 +4398,8 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, n[6].i = (GLint) depth; n[7].i = border; n[8].i = imageSize; - n[9].data = copy_data(data, imageSize, "glCompressedTexImage3DARB"); + save_pointer(&n[9], + copy_data(data, imageSize, "glCompressedTexImage3DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage3D(ctx->Exec, @@ -4730,7 +4420,8 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, + 6 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4738,7 +4429,8 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, n[4].i = (GLint) width; n[5].e = format; n[6].i = imageSize; - n[7].data = copy_data(data, imageSize, "glCompressedTexSubImage1DARB"); + save_pointer(&n[7], + copy_data(data, imageSize, "glCompressedTexSubImage1DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage1D(ctx->Exec, (target, level, xoffset, @@ -4758,7 +4450,8 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, + 8 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4768,7 +4461,8 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, n[6].i = (GLint) height; n[7].e = format; n[8].i = imageSize; - n[9].data = copy_data(data, imageSize, "glCompressedTexSubImage2DARB"); + save_pointer(&n[9], + copy_data(data, imageSize, "glCompressedTexSubImage2DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage2D(ctx->Exec, @@ -4788,7 +4482,8 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, + 10 + POINTER_DWORDS); if (n) { n[1].e = target; n[2].i = level; @@ -4800,7 +4495,8 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, n[8].i = (GLint) depth; n[9].e = format; n[10].i = imageSize; - n[11].data = copy_data(data, imageSize, "glCompressedTexSubImage3DARB"); + save_pointer(&n[11], + copy_data(data, imageSize, "glCompressedTexSubImage3DARB")); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage3D(ctx->Exec, @@ -5098,7 +4794,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); + n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 3 + POINTER_DWORDS); if (n) { GLubyte *programCopy = malloc(len); if (!programCopy) { @@ -5109,7 +4805,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, n[1].e = target; n[2].e = format; n[3].i = len; - n[4].data = programCopy; + save_pointer(&n[4], programCopy); } if (ctx->ExecuteFlag) { CALL_ProgramStringARB(ctx->Exec, (target, format, len, string)); @@ -6284,28 +5980,17 @@ save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -/** Return copy of memory */ -static void * -memdup(const void *src, GLsizei bytes) -{ - void *b = bytes >= 0 ? malloc(bytes) : NULL; - if (b) - memcpy(b, src, bytes); - return b; -} - - static void GLAPIENTRY save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v) { GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 1 * sizeof(GLfloat)); + save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_Uniform1fv(ctx->Exec, (location, count, v)); @@ -6318,11 +6003,11 @@ save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 2 * sizeof(GLfloat)); + save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_Uniform2fv(ctx->Exec, (location, count, v)); @@ -6335,11 +6020,11 @@ save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 3 * sizeof(GLfloat)); + save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_Uniform3fv(ctx->Exec, (location, count, v)); @@ -6352,11 +6037,11 @@ save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 4 * sizeof(GLfloat)); + save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_Uniform4fv(ctx->Exec, (location, count, v)); @@ -6442,11 +6127,11 @@ save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 1 * sizeof(GLint)); + save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint))); } if (ctx->ExecuteFlag) { CALL_Uniform1iv(ctx->Exec, (location, count, v)); @@ -6459,11 +6144,11 @@ save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 2 * sizeof(GLint)); + save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint))); } if (ctx->ExecuteFlag) { CALL_Uniform2iv(ctx->Exec, (location, count, v)); @@ -6476,11 +6161,11 @@ save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 3 * sizeof(GLint)); + save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint))); } if (ctx->ExecuteFlag) { CALL_Uniform3iv(ctx->Exec, (location, count, v)); @@ -6493,11 +6178,11 @@ save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 4 * sizeof(GLfloat)); + save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_Uniform4iv(ctx->Exec, (location, count, v)); @@ -6584,11 +6269,11 @@ save_Uniform1uiv(GLint location, GLsizei count, const GLuint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 1 * sizeof(*v)); + save_pointer(&n[3], memdup(v, count * 1 * sizeof(*v))); } if (ctx->ExecuteFlag) { /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/ @@ -6601,11 +6286,11 @@ save_Uniform2uiv(GLint location, GLsizei count, const GLuint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 2 * sizeof(*v)); + save_pointer(&n[3], memdup(v, count * 2 * sizeof(*v))); } if (ctx->ExecuteFlag) { /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/ @@ -6618,11 +6303,11 @@ save_Uniform3uiv(GLint location, GLsizei count, const GLuint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 3 * sizeof(*v)); + save_pointer(&n[3], memdup(v, count * 3 * sizeof(*v))); } if (ctx->ExecuteFlag) { /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/ @@ -6635,11 +6320,11 @@ save_Uniform4uiv(GLint location, GLsizei count, const GLuint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 2 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; - n[3].data = memdup(v, count * 4 * sizeof(*v)); + save_pointer(&n[3], memdup(v, count * 4 * sizeof(*v))); } if (ctx->ExecuteFlag) { /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/ @@ -6655,12 +6340,12 @@ save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 2 * 2 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 2 * 2 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix2fv(ctx->Exec, (location, count, transpose, m)); @@ -6674,12 +6359,12 @@ save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 3 * 3 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 3 * 3 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix3fv(ctx->Exec, (location, count, transpose, m)); @@ -6693,12 +6378,12 @@ save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 4 * 4 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 4 * 4 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix4fv(ctx->Exec, (location, count, transpose, m)); @@ -6713,12 +6398,12 @@ save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 2 * 3 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 2 * 3 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix2x3fv(ctx->Exec, (location, count, transpose, m)); @@ -6732,12 +6417,12 @@ save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 3 * 2 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 3 * 2 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix3x2fv(ctx->Exec, (location, count, transpose, m)); @@ -6752,12 +6437,12 @@ save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 2 * 4 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 2 * 4 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix2x4fv(ctx->Exec, (location, count, transpose, m)); @@ -6771,12 +6456,12 @@ save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 4 * 2 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 4 * 2 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix4x2fv(ctx->Exec, (location, count, transpose, m)); @@ -6791,12 +6476,12 @@ save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 3 * 4 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 3 * 4 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix3x4fv(ctx->Exec, (location, count, transpose, m)); @@ -6810,12 +6495,12 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 3 + POINTER_DWORDS); if (n) { n[1].i = location; n[2].i = count; n[3].b = transpose; - n[4].data = memdup(m, count * 4 * 3 * sizeof(GLfloat)); + save_pointer(&n[4], memdup(m, count * 4 * 3 * sizeof(GLfloat))); } if (ctx->ExecuteFlag) { CALL_UniformMatrix4x3fv(ctx->Exec, (location, count, transpose, m)); @@ -7185,10 +6870,10 @@ save_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) if (n) { union uint64_pair p; p.uint64 = timeout; - n[1].data = sync; - n[2].e = flags; - n[3].ui = p.uint32[0]; - n[4].ui = p.uint32[1]; + n[1].bf = flags; + n[2].ui = p.uint32[0]; + n[3].ui = p.uint32[1]; + save_pointer(&n[4], sync); } if (ctx->ExecuteFlag) { CALL_WaitSync(ctx->Exec, (sync, flags, timeout)); @@ -7252,10 +6937,14 @@ static void save_error(struct gl_context *ctx, GLenum error, const char *s) { Node *n; - n = alloc_instruction(ctx, OPCODE_ERROR, 2); + n = alloc_instruction(ctx, OPCODE_ERROR, 1 + POINTER_DWORDS); if (n) { n[1].e = error; - n[2].data = (void *) s; + save_pointer(&n[2], (void *) s); + /* note: the data/string here doesn't have to be freed in + * _mesa_delete_list() since the string is never dynamically + * allocated. + */ } } @@ -7336,7 +7025,7 @@ execute_list(struct gl_context *ctx, GLuint list) else { switch (opcode) { case OPCODE_ERROR: - _mesa_error(ctx, n[1].e, "%s", (const char *) n[2].data); + _mesa_error(ctx, n[1].e, "%s", (const char *) get_pointer(&n[2])); break; case OPCODE_ACCUM: CALL_Accum(ctx->Exec, (n[1].e, n[2].f)); @@ -7353,7 +7042,7 @@ execute_list(struct gl_context *ctx, GLuint list) ctx->Unpack = ctx->DefaultPacking; CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i, n[3].f, n[4].f, n[5].f, n[6].f, - (const GLubyte *) n[7].data)); + get_pointer(&n[7]))); ctx->Unpack = save; /* restore */ } break; @@ -7478,102 +7167,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_COLOR_MATERIAL: CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e)); break; - case OPCODE_COLOR_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorTable(ctx->Exec, (n[1].e, n[2].e, n[3].i, n[4].e, - n[5].e, n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_COLOR_TABLE_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ColorTableParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ColorTableParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COLOR_SUB_TABLE: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ColorSubTable(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].e, n[5].e, n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_FILTER_1D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter1D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].e, n[5].e, - n[6].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_FILTER_2D: - { - const struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = ctx->DefaultPacking; - CALL_ConvolutionFilter2D(ctx->Exec, (n[1].e, n[2].i, n[3].i, - n[4].i, n[5].e, n[6].e, - n[7].data)); - ctx->Unpack = save; /* restore */ - } - break; - case OPCODE_CONVOLUTION_PARAMETER_I: - CALL_ConvolutionParameteri(ctx->Exec, (n[1].e, n[2].e, n[3].i)); - break; - case OPCODE_CONVOLUTION_PARAMETER_IV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_ConvolutionParameteriv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_CONVOLUTION_PARAMETER_F: - CALL_ConvolutionParameterf(ctx->Exec, (n[1].e, n[2].e, n[3].f)); - break; - case OPCODE_CONVOLUTION_PARAMETER_FV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_ConvolutionParameterfv(ctx->Exec, - (n[1].e, n[2].e, params)); - } - break; - case OPCODE_COPY_COLOR_SUB_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; - case OPCODE_COPY_COLOR_TABLE: - CALL_CopyColorSubTable(ctx->Exec, (n[1].e, n[2].i, - n[3].i, n[4].i, n[5].i)); - break; case OPCODE_COPY_PIXELS: CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i, (GLsizei) n[3].i, (GLsizei) n[4].i, @@ -7628,7 +7221,7 @@ execute_list(struct gl_context *ctx, GLuint list) const struct gl_pixelstore_attrib save = ctx->Unpack; ctx->Unpack = ctx->DefaultPacking; CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e, - n[5].data)); + get_pointer(&n[5]))); ctx->Unpack = save; /* restore */ } break; @@ -7665,9 +7258,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_HINT: CALL_Hint(ctx->Exec, (n[1].e, n[2].e)); break; - case OPCODE_HISTOGRAM: - CALL_Histogram(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].b)); - break; case OPCODE_INDEX_MASK: CALL_IndexMask(ctx->Exec, (n[1].ui)); break; @@ -7733,7 +7323,7 @@ execute_list(struct gl_context *ctx, GLuint list) GLfloat u1 = n[2].f; GLfloat u2 = n[3].f; CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder, - (GLfloat *) n[6].data)); + (GLfloat *) get_pointer(&n[6]))); } break; case OPCODE_MAP2: @@ -7749,7 +7339,7 @@ execute_list(struct gl_context *ctx, GLuint list) GLint vorder = n[9].i; CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, - (GLfloat *) n[10].data)); + (GLfloat *) get_pointer(&n[10]))); } break; case OPCODE_MAPGRID1: @@ -7762,9 +7352,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_MATRIX_MODE: CALL_MatrixMode(ctx->Exec, (n[1].e)); break; - case OPCODE_MIN_MAX: - CALL_Minmax(ctx->Exec, (n[1].e, n[2].e, n[3].b)); - break; case OPCODE_MULT_MATRIX: if (sizeof(Node) == sizeof(GLfloat)) { CALL_MultMatrixf(ctx->Exec, (&n[1].f)); @@ -7787,7 +7374,7 @@ execute_list(struct gl_context *ctx, GLuint list) break; case OPCODE_PIXEL_MAP: CALL_PixelMapfv(ctx->Exec, - (n[1].e, n[2].i, (GLfloat *) n[3].data)); + (n[1].e, n[2].i, get_pointer(&n[3]))); break; case OPCODE_PIXEL_TRANSFER: CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f)); @@ -7814,7 +7401,7 @@ execute_list(struct gl_context *ctx, GLuint list) { const struct gl_pixelstore_attrib save = ctx->Unpack; ctx->Unpack = ctx->DefaultPacking; - CALL_PolygonStipple(ctx->Exec, ((GLubyte *) n[1].data)); + CALL_PolygonStipple(ctx->Exec, (get_pointer(&n[1]))); ctx->Unpack = save; /* restore */ } break; @@ -7848,12 +7435,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_READ_BUFFER: CALL_ReadBuffer(ctx->Exec, (n[1].e)); break; - case OPCODE_RESET_HISTOGRAM: - CALL_ResetHistogram(ctx->Exec, (n[1].e)); - break; - case OPCODE_RESET_MIN_MAX: - CALL_ResetMinmax(ctx->Exec, (n[1].e)); - break; case OPCODE_ROTATE: CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f)); break; @@ -7930,7 +7511,7 @@ execute_list(struct gl_context *ctx, GLuint list) n[5].e, /* border */ n[6].e, /* format */ n[7].e, /* type */ - n[8].data)); + get_pointer(&n[8]))); ctx->Unpack = save; /* restore */ } break; @@ -7946,7 +7527,7 @@ execute_list(struct gl_context *ctx, GLuint list) n[6].e, /* border */ n[7].e, /* format */ n[8].e, /* type */ - n[9].data)); + get_pointer(&n[9]))); ctx->Unpack = save; /* restore */ } break; @@ -7963,7 +7544,7 @@ execute_list(struct gl_context *ctx, GLuint list) n[7].e, /* border */ n[8].e, /* format */ n[9].e, /* type */ - n[10].data)); + get_pointer(&n[10]))); ctx->Unpack = save; /* restore */ } break; @@ -7973,7 +7554,7 @@ execute_list(struct gl_context *ctx, GLuint list) ctx->Unpack = ctx->DefaultPacking; CALL_TexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, n[5].e, - n[6].e, n[7].data)); + n[6].e, get_pointer(&n[7]))); ctx->Unpack = save; /* restore */ } break; @@ -7984,7 +7565,7 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_TexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, n[5].e, n[6].i, n[7].e, n[8].e, - n[9].data)); + get_pointer(&n[9]))); ctx->Unpack = save; /* restore */ } break; @@ -7995,7 +7576,7 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i, n[6].i, n[7].i, n[8].i, n[9].e, n[10].e, - n[11].data)); + get_pointer(&n[11]))); ctx->Unpack = save; /* restore */ } break; @@ -8014,36 +7595,38 @@ execute_list(struct gl_context *ctx, GLuint list) break; case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */ CALL_CompressedTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].data)); + n[4].i, n[5].i, n[6].i, + get_pointer(&n[7]))); break; case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */ CALL_CompressedTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].i, n[8].data)); + n[4].i, n[5].i, n[6].i, + n[7].i, get_pointer(&n[8]))); break; case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */ CALL_CompressedTexImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].e, - n[4].i, n[5].i, n[6].i, - n[7].i, n[8].i, - n[9].data)); + n[4].i, n[5].i, n[6].i, + n[7].i, n[8].i, + get_pointer(&n[9]))); break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */ CALL_CompressedTexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, - n[5].e, n[6].i, n[7].data)); + n[5].e, n[6].i, + get_pointer(&n[7]))); break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */ CALL_CompressedTexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i, n[6].i, n[7].e, n[8].i, - n[9].data)); + get_pointer(&n[9]))); break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */ CALL_CompressedTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i, n[6].i, n[7].i, n[8].i, - n[9].e, n[10].i, n[11].data)); + n[9].e, n[10].i, + get_pointer(&n[11]))); break; case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */ CALL_SampleCoverage(ctx->Exec, (n[1].f, n[2].b)); @@ -8067,7 +7650,8 @@ execute_list(struct gl_context *ctx, GLuint list) break; case OPCODE_PROGRAM_STRING_ARB: CALL_ProgramStringARB(ctx->Exec, - (n[1].e, n[2].e, n[3].i, n[4].data)); + (n[1].e, n[2].e, n[3].i, + get_pointer(&n[4]))); break; case OPCODE_PROGRAM_ENV_PARAMETER_ARB: CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f, @@ -8126,16 +7710,16 @@ execute_list(struct gl_context *ctx, GLuint list) (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f)); break; case OPCODE_UNIFORM_1FV: - CALL_Uniform1fv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform1fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_2FV: - CALL_Uniform2fv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform2fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_3FV: - CALL_Uniform3fv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform3fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_4FV: - CALL_Uniform4fv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform4fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_1I: CALL_Uniform1i(ctx->Exec, (n[1].i, n[2].i)); @@ -8151,16 +7735,16 @@ execute_list(struct gl_context *ctx, GLuint list) (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i)); break; case OPCODE_UNIFORM_1IV: - CALL_Uniform1iv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform1iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_2IV: - CALL_Uniform2iv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform2iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_3IV: - CALL_Uniform3iv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform3iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_4IV: - CALL_Uniform4iv(ctx->Exec, (n[1].i, n[2].i, n[3].data)); + CALL_Uniform4iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3]))); break; case OPCODE_UNIFORM_1UI: /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/ @@ -8177,52 +7761,56 @@ execute_list(struct gl_context *ctx, GLuint list) */ break; case OPCODE_UNIFORM_1UIV: - /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/ + /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3])));*/ break; case OPCODE_UNIFORM_2UIV: - /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/ + /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3])));*/ break; case OPCODE_UNIFORM_3UIV: - /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/ + /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3])));*/ break; case OPCODE_UNIFORM_4UIV: - /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/ + /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, + get_pointer(&n[3])));*/ break; case OPCODE_UNIFORM_MATRIX22: CALL_UniformMatrix2fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX33: CALL_UniformMatrix3fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX44: CALL_UniformMatrix4fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX23: CALL_UniformMatrix2x3fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX32: CALL_UniformMatrix3x2fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX24: CALL_UniformMatrix2x4fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX42: CALL_UniformMatrix4x2fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX34: CALL_UniformMatrix3x4fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_UNIFORM_MATRIX43: CALL_UniformMatrix4x3fv(ctx->Exec, - (n[1].i, n[2].i, n[3].b, n[4].data)); + (n[1].i, n[2].i, n[3].b, get_pointer(&n[4]))); break; case OPCODE_CLAMP_COLOR: @@ -8476,9 +8064,10 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_WAIT_SYNC: { union uint64_pair p; - p.uint32[0] = n[3].ui; - p.uint32[1] = n[4].ui; - CALL_WaitSync(ctx->Exec, (n[1].data, n[2].bf, p.uint64)); + p.uint32[0] = n[2].ui; + p.uint32[1] = n[3].ui; + CALL_WaitSync(ctx->Exec, + (get_pointer(&n[4]), n[1].bf, p.uint64)); } break; @@ -8495,7 +8084,7 @@ execute_list(struct gl_context *ctx, GLuint list) break; case OPCODE_CONTINUE: - n = (Node *) n[1].next; + n = (Node *) get_pointer(&n[1]); break; case OPCODE_END_OF_LIST: done = GL_TRUE; @@ -8684,6 +8273,8 @@ _mesa_EndList(void) (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0); + trim_list(ctx); + /* Destroy old list, if any */ destroy_list(ctx, ctx->ListState.CurrentList->Name); @@ -8697,6 +8288,8 @@ _mesa_EndList(void) mesa_print_display_list(ctx->ListState.CurrentList->Name); ctx->ListState.CurrentList = NULL; + ctx->ListState.CurrentBlock = NULL; + ctx->ListState.CurrentPos = 0; ctx->ExecuteFlag = GL_TRUE; ctx->CompileFlag = GL_FALSE; @@ -8998,22 +8591,6 @@ _mesa_initialize_save_table(const struct gl_context *ctx) /* Not all are supported */ SET_BlendColor(table, save_BlendColor); SET_BlendEquation(table, save_BlendEquation); - SET_ColorSubTable(table, save_ColorSubTable); - SET_ColorTable(table, save_ColorTable); - SET_ColorTableParameterfv(table, save_ColorTableParameterfv); - SET_ColorTableParameteriv(table, save_ColorTableParameteriv); - SET_ConvolutionFilter1D(table, save_ConvolutionFilter1D); - SET_ConvolutionFilter2D(table, save_ConvolutionFilter2D); - SET_ConvolutionParameterf(table, save_ConvolutionParameterf); - SET_ConvolutionParameterfv(table, save_ConvolutionParameterfv); - SET_ConvolutionParameteri(table, save_ConvolutionParameteri); - SET_ConvolutionParameteriv(table, save_ConvolutionParameteriv); - SET_CopyColorSubTable(table, save_CopyColorSubTable); - SET_CopyColorTable(table, save_CopyColorTable); - SET_Histogram(table, save_Histogram); - SET_Minmax(table, save_Minmax); - SET_ResetHistogram(table, save_ResetHistogram); - SET_ResetMinmax(table, save_ResetMinmax); /* 2. GL_EXT_blend_color */ #if 0 @@ -9030,12 +8607,6 @@ _mesa_initialize_save_table(const struct gl_context *ctx) SET_TexSubImage3DEXT(table, save_TexSubImage3D); #endif - /* 14. GL_SGI_color_table */ -#if 0 - SET_ColorTableSGI(table, save_ColorTable); - SET_ColorSubTableSGI(table, save_ColorSubTable); -#endif - /* 37. GL_EXT_blend_minmax */ #if 0 SET_BlendEquationEXT(table, save_BlendEquationEXT); @@ -9332,7 +8903,8 @@ print_list(struct gl_context *ctx, GLuint list) break; case OPCODE_BITMAP: printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, - n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data); + n[3].f, n[4].f, n[5].f, n[6].f, + get_pointer(&n[7])); break; case OPCODE_CALL_LIST: printf("CallList %d\n", (int) n[1].ui); @@ -9341,16 +8913,6 @@ print_list(struct gl_context *ctx, GLuint list) printf("CallList %d + offset %u = %u\n", (int) n[1].ui, ctx->List.ListBase, ctx->List.ListBase + n[1].ui); break; - case OPCODE_COLOR_TABLE_PARAMETER_FV: - printf("ColorTableParameterfv %s %s %f %f %f %f\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].f, n[4].f, n[5].f, n[6].f); - break; - case OPCODE_COLOR_TABLE_PARAMETER_IV: - printf("ColorTableParameteriv %s %s %d %d %d %d\n", - enum_string(n[1].e), enum_string(n[2].e), - n[3].i, n[4].i, n[5].i, n[6].i); - break; case OPCODE_DISABLE: printf("Disable %s\n", enum_string(n[1].e)); break; @@ -9525,12 +9087,12 @@ print_list(struct gl_context *ctx, GLuint list) * meta opcodes/commands */ case OPCODE_ERROR: - printf("Error: %s %s\n", - enum_string(n[1].e), (const char *) n[2].data); + printf("Error: %s %s\n", enum_string(n[1].e), + (const char *) get_pointer(&n[2])); break; case OPCODE_CONTINUE: printf("DISPLAY-LIST-CONTINUE\n"); - n = (Node *) n[1].next; + n = (Node *) get_pointer(&n[1]); break; case OPCODE_END_OF_LIST: printf("END-LIST %u\n", list); diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index c047f5df2..bb4a23c91 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -934,25 +934,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->ATIFragmentShader.Enabled = state; break; - /* GL_MESA_texture_array */ - case GL_TEXTURE_1D_ARRAY_EXT: - if (ctx->API != API_OPENGL_COMPAT) - goto invalid_enum_error; - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { - return; - } - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - if (ctx->API != API_OPENGL_COMPAT) - goto invalid_enum_error; - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { - return; - } - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 42da9057c..f0e1858e4 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -82,6 +82,7 @@ static const struct extension extension_table[] = { { "GL_ARB_ES3_compatibility", o(ARB_ES3_compatibility), GL, 2012 }, { "GL_ARB_base_instance", o(ARB_base_instance), GL, 2011 }, { "GL_ARB_blend_func_extended", o(ARB_blend_func_extended), GL, 2009 }, + { "GL_ARB_clear_buffer_object", o(dummy_true), GL, 2012 }, { "GL_ARB_color_buffer_float", o(ARB_color_buffer_float), GL, 2004 }, { "GL_ARB_copy_buffer", o(dummy_true), GL, 2008 }, { "GL_ARB_conservative_depth", o(ARB_conservative_depth), GL, 2011 }, @@ -158,6 +159,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 }, { "GL_ARB_texture_storage", o(dummy_true), GL, 2011 }, { "GL_ARB_texture_storage_multisample", o(ARB_texture_multisample), GL, 2012 }, + { "GL_ARB_texture_view", o(ARB_texture_view), GL, 2012 }, { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 }, { "GL_ARB_timer_query", o(ARB_timer_query), GL, 2010 }, { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 }, @@ -199,7 +201,7 @@ static const struct extension extension_table[] = { { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 }, { "GL_EXT_map_buffer_range", o(ARB_map_buffer_range), ES1 | ES2, 2012 }, { "GL_EXT_multi_draw_arrays", o(dummy_true), GLL | ES1 | ES2, 1999 }, - { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 }, + { "GL_EXT_packed_depth_stencil", o(dummy_true), GL, 2005 }, { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 }, { "GL_EXT_packed_pixels", o(dummy_true), GLL, 1997 }, { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 }, @@ -272,7 +274,7 @@ static const struct extension extension_table[] = { { "GL_OES_framebuffer_object", o(dummy_true), ES1, 2005 }, { "GL_OES_get_program_binary", o(dummy_true), ES2, 2008 }, { "GL_OES_mapbuffer", o(dummy_true), ES1 | ES2, 2005 }, - { "GL_OES_packed_depth_stencil", o(EXT_packed_depth_stencil), ES1 | ES2, 2007 }, + { "GL_OES_packed_depth_stencil", o(dummy_true), ES1 | ES2, 2007 }, { "GL_OES_point_size_array", o(dummy_true), ES1, 2004 }, { "GL_OES_point_sprite", o(ARB_point_sprite), ES1, 2004 }, { "GL_OES_query_matrix", o(dummy_true), ES1, 2003 }, @@ -302,7 +304,7 @@ static const struct extension extension_table[] = { { "GL_AMD_performance_monitor", o(AMD_performance_monitor), GL, 2007 }, { "GL_AMD_seamless_cubemap_per_texture", o(AMD_seamless_cubemap_per_texture), GL, 2009 }, { "GL_AMD_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, - { "GL_AMD_vertex_shader_layer", o(AMD_vertex_shader_layer), GL, 2012 }, + { "GL_AMD_vertex_shader_layer", o(AMD_vertex_shader_layer), GLC, 2012 }, { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 }, { "GL_APPLE_packed_pixels", o(dummy_true), GLL, 2002 }, { "GL_APPLE_texture_max_level", o(dummy_true), ES1 | ES2, 2009 }, @@ -321,7 +323,6 @@ static const struct extension extension_table[] = { { "GL_IBM_texture_mirrored_repeat", o(dummy_true), GLL, 1998 }, { "GL_INGR_blend_func_separate", o(EXT_blend_func_separate), GLL, 1999 }, { "GL_MESA_pack_invert", o(MESA_pack_invert), GL, 2002 }, - { "GL_MESA_texture_array", o(MESA_texture_array), GLL, 2007 }, { "GL_MESA_texture_signed_rgba", o(EXT_texture_snorm), GL, 2009 }, { "GL_MESA_window_pos", o(dummy_true), GLL, 2000 }, { "GL_MESA_ycbcr_texture", o(MESA_ycbcr_texture), GL, 2002 }, @@ -333,7 +334,7 @@ static const struct extension extension_table[] = { { "GL_NV_fog_distance", o(NV_fog_distance), GLL, 2001 }, { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GLL, 2005 }, { "GL_NV_light_max_exponent", o(dummy_true), GLL, 1999 }, - { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2000 }, + { "GL_NV_packed_depth_stencil", o(dummy_true), GL, 2000 }, { "GL_NV_point_sprite", o(NV_point_sprite), GL, 2001 }, { "GL_NV_primitive_restart", o(NV_primitive_restart), GLL, 2002 }, { "GL_NV_read_buffer", o(dummy_true), ES2, 2011 }, @@ -436,7 +437,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_provoking_vertex = GL_TRUE; @@ -453,7 +453,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) /*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/ ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; ctx->Extensions.MESA_pack_invert = GL_TRUE; - ctx->Extensions.MESA_texture_array = GL_TRUE; ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; ctx->Extensions.NV_conditional_render = GL_TRUE; ctx->Extensions.NV_point_sprite = GL_TRUE; @@ -480,7 +479,8 @@ set_extension( struct gl_context *ctx, const char *name, GLboolean state ) if (ctx->Extensions.String) { /* The string was already queried - can't change it now! */ - _mesa_problem(ctx, "Trying to enable/disable extension after glGetString(GL_EXTENSIONS): %s", name); + _mesa_problem(ctx, "Trying to enable/disable extension after " + "glGetString(GL_EXTENSIONS): %s", name); return GL_FALSE; } @@ -679,10 +679,10 @@ _mesa_make_extension_string(struct gl_context *ctx) return NULL; } - /* Sort extensions in chronological order because certain old applications (e.g., - * Quake3 demo) store the extension list in a static size buffer so chronologically - * order ensure that the extensions that such applications expect will fit into - * that buffer. + /* Sort extensions in chronological order because certain old applications + * (e.g., Quake3 demo) store the extension list in a static size buffer so + * chronologically order ensure that the extensions that such applications + * expect will fit into that buffer. */ j = 0; for (i = extension_table; i->name != 0; ++i) { @@ -693,7 +693,8 @@ _mesa_make_extension_string(struct gl_context *ctx) } } assert(j == count); - qsort(extension_indices, count, sizeof *extension_indices, extension_compare); + qsort(extension_indices, count, + sizeof *extension_indices, extension_compare); /* Build the extension string.*/ for (j = 0; j < count; ++j) { diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 861885dd3..2892784f8 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -781,9 +781,8 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { + else if (ctx->Extensions.ARB_depth_texture && + baseFormat == GL_DEPTH_STENCIL) { /* OK */ } else { @@ -794,9 +793,8 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { ASSERT(format == GL_STENCIL); - if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { + if (ctx->Extensions.ARB_depth_texture && + baseFormat == GL_DEPTH_STENCIL) { /* OK */ } else { @@ -830,8 +828,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { + else if (baseFormat == GL_DEPTH_STENCIL) { /* OK */ } else { @@ -842,11 +839,8 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { assert(format == GL_STENCIL); - if (baseFormat == GL_STENCIL_INDEX) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { + if (baseFormat == GL_STENCIL_INDEX || + baseFormat == GL_DEPTH_STENCIL) { /* OK */ } else { @@ -1457,13 +1451,10 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT24: return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL_EXT: - return _mesa_is_desktop_gl(ctx) - && ctx->Extensions.EXT_packed_depth_stencil - ? GL_DEPTH_STENCIL_EXT : 0; - case GL_DEPTH24_STENCIL8_EXT: - return ctx->Extensions.EXT_packed_depth_stencil - ? GL_DEPTH_STENCIL_EXT : 0; + case GL_DEPTH_STENCIL: + return _mesa_is_desktop_gl(ctx) ? GL_DEPTH_STENCIL : 0; + case GL_DEPTH24_STENCIL8: + return GL_DEPTH_STENCIL; case GL_DEPTH_COMPONENT32F: return ctx->Version >= 30 || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float) diff --git a/mesalib/src/mesa/main/ff_fragment_shader.cpp b/mesalib/src/mesa/main/ff_fragment_shader.cpp index 01edd3ff8..ba6258d89 100644 --- a/mesalib/src/mesa/main/ff_fragment_shader.cpp +++ b/mesalib/src/mesa/main/ff_fragment_shader.cpp @@ -543,7 +543,8 @@ get_current_attrib(texenv_fragment_program *p, GLuint attrib) ir_rvalue *val; current = p->shader->symbols->get_variable("gl_CurrentAttribFragMESA"); - current->max_array_access = MAX2(current->max_array_access, attrib); + assert(current); + current->data.max_array_access = MAX2(current->data.max_array_access, attrib); val = new(p->mem_ctx) ir_dereference_variable(current); ir_rvalue *index = new(p->mem_ctx) ir_constant(attrib); return new(p->mem_ctx) ir_dereference_array(val, index); @@ -587,7 +588,7 @@ get_source(texenv_fragment_program *p, var = p->shader->symbols->get_variable("gl_TextureEnvColor"); assert(var); deref = new(p->mem_ctx) ir_dereference_variable(var); - var->max_array_access = MAX2(var->max_array_access, unit); + var->data.max_array_access = MAX2(var->data.max_array_access, unit); return new(p->mem_ctx) ir_dereference_array(deref, new(p->mem_ctx) ir_constant(unit)); @@ -927,7 +928,7 @@ static void load_texture( texenv_fragment_program *p, GLuint unit ) texcoord = new(p->mem_ctx) ir_dereference_variable(tc_array); ir_rvalue *index = new(p->mem_ctx) ir_constant(unit); texcoord = new(p->mem_ctx) ir_dereference_array(texcoord, index); - tc_array->max_array_access = MAX2(tc_array->max_array_access, unit); + tc_array->data.max_array_access = MAX2(tc_array->data.max_array_access, unit); } if (!p->state->unit[unit].enabled) { @@ -1096,14 +1097,16 @@ load_texunit_bumpmap( texenv_fragment_program *p, GLuint unit ) ir_variable *rot_mat_0, *rot_mat_1; rot_mat_0 = p->shader->symbols->get_variable("gl_BumpRotMatrix0MESA"); + assert(rot_mat_0); rot_mat_1 = p->shader->symbols->get_variable("gl_BumpRotMatrix1MESA"); + assert(rot_mat_1); ir_variable *tc_array = p->shader->symbols->get_variable("gl_TexCoord"); assert(tc_array); texcoord = new(p->mem_ctx) ir_dereference_variable(tc_array); ir_rvalue *index = new(p->mem_ctx) ir_constant(bumpedUnitNr); texcoord = new(p->mem_ctx) ir_dereference_array(texcoord, index); - tc_array->max_array_access = MAX2(tc_array->max_array_access, unit); + tc_array->data.max_array_access = MAX2(tc_array->data.max_array_access, unit); load_texenv_source( p, unit + SRC_TEXTURE0, unit ); @@ -1157,8 +1160,11 @@ emit_fog_instructions(texenv_fragment_program *p, fragcolor = swizzle_xyz(fog_result); oparams = p->shader->symbols->get_variable("gl_FogParamsOptimizedMESA"); + assert(oparams); fogcoord = p->shader->symbols->get_variable("gl_FogFragCoord"); + assert(fogcoord); params = p->shader->symbols->get_variable("gl_Fog"); + assert(params); f = new(p->mem_ctx) ir_dereference_variable(fogcoord); ir_variable *f_var = p->make_temp(glsl_type::float_type, "fog_factor"); @@ -1344,7 +1350,7 @@ create_new_program(struct gl_context *ctx, struct state_key *key) p.shader->CompileStatus = true; p.shader->Version = state->language_version; - p.shader->num_builtins_to_link = state->num_builtins_to_link; + p.shader->uses_builtin_functions = state->uses_builtin_functions; p.shader_program->Shaders = (gl_shader **)malloc(sizeof(*p.shader_program->Shaders)); p.shader_program->Shaders[0] = p.shader; diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 7f233409e..691380898 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -327,8 +327,8 @@ static const int extra_EXT_framebuffer_sRGB_and_new_buffers[] = { EXTRA_END }; -static const int extra_MESA_texture_array_es3[] = { - EXT(MESA_texture_array), +static const int extra_EXT_texture_array_es3[] = { + EXT(EXT_texture_array), EXTRA_API_ES3, EXTRA_END }; @@ -339,7 +339,7 @@ static const int extra_ARB_shader_atomic_counters_and_geometry_shader[] = { }; EXTRA_EXT(ARB_texture_cube_map); -EXTRA_EXT(MESA_texture_array); +EXTRA_EXT(EXT_texture_array); EXTRA_EXT(NV_fog_distance); EXTRA_EXT(EXT_texture_filter_anisotropic); EXTRA_EXT(NV_point_sprite); @@ -565,8 +565,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_TEXTURE_3D: - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: case GL_TEXTURE_CUBE_MAP_ARB: case GL_TEXTURE_RECTANGLE_NV: case GL_TEXTURE_EXTERNAL_OES: diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 781b796ee..653bf6256 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -376,8 +376,8 @@ descriptor=[ [ "PIXEL_UNPACK_BUFFER_BINDING_EXT", "LOC_CUSTOM, TYPE_INT, 0, extra_EXT_pixel_buffer_object" ], # GL_EXT_texture_array - [ "TEXTURE_BINDING_2D_ARRAY", "LOC_CUSTOM, TYPE_INT, TEXTURE_2D_ARRAY_INDEX, extra_MESA_texture_array_es3" ], - [ "MAX_ARRAY_TEXTURE_LAYERS_EXT", "CONTEXT_INT(Const.MaxArrayTextureLayers), extra_MESA_texture_array_es3" ], + [ "TEXTURE_BINDING_2D_ARRAY", "LOC_CUSTOM, TYPE_INT, TEXTURE_2D_ARRAY_INDEX, extra_EXT_texture_array_es3" ], + [ "MAX_ARRAY_TEXTURE_LAYERS_EXT", "CONTEXT_INT(Const.MaxArrayTextureLayers), extra_EXT_texture_array_es3" ], # GL_EXT_transform_feedback [ "TRANSFORM_FEEDBACK_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_EXT_transform_feedback" ], @@ -504,10 +504,8 @@ descriptor=[ [ "STEREO", "BUFFER_INT(Visual.stereoMode), NO_EXTRA" ], [ "TEXTURE_1D", "LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA" ], [ "TEXTURE_3D", "LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA" ], - [ "TEXTURE_1D_ARRAY_EXT", "LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA" ], - [ "TEXTURE_2D_ARRAY_EXT", "LOC_CUSTOM, TYPE_BOOLEAN, NO_OFFSET, NO_EXTRA" ], [ "TEXTURE_BINDING_1D", "LOC_CUSTOM, TYPE_INT, TEXTURE_1D_INDEX, NO_EXTRA" ], - [ "TEXTURE_BINDING_1D_ARRAY", "LOC_CUSTOM, TYPE_INT, TEXTURE_1D_ARRAY_INDEX, extra_MESA_texture_array" ], + [ "TEXTURE_BINDING_1D_ARRAY", "LOC_CUSTOM, TYPE_INT, TEXTURE_1D_ARRAY_INDEX, extra_EXT_texture_array" ], [ "TEXTURE_GEN_S", "LOC_TEXUNIT, TYPE_BIT_0, offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA" ], [ "TEXTURE_GEN_T", "LOC_TEXUNIT, TYPE_BIT_1, offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA" ], [ "TEXTURE_GEN_R", "LOC_TEXUNIT, TYPE_BIT_2, offsetof(struct gl_texture_unit, TexGenEnabled), NO_EXTRA" ], diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c index d8189115a..b66e24788 100644 --- a/mesalib/src/mesa/main/getstring.c +++ b/mesalib/src/mesa/main/getstring.c @@ -42,8 +42,6 @@ shading_language_version(struct gl_context *ctx) case API_OPENGL_COMPAT: case API_OPENGL_CORE: switch (ctx->Const.GLSLVersion) { - case 110: - return (const GLubyte *) "1.10"; case 120: return (const GLubyte *) "1.20"; case 130: diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index 740faa890..bec7a9bbb 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -1301,9 +1301,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; case GL_UNSIGNED_INT_24_8: - if (!ctx->Extensions.EXT_packed_depth_stencil) { - return GL_INVALID_ENUM; - } if (format != GL_DEPTH_STENCIL) { return GL_INVALID_OPERATION; } @@ -1484,9 +1481,8 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, else return GL_INVALID_OPERATION; - case GL_DEPTH_STENCIL_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil && - type == GL_UNSIGNED_INT_24_8) + case GL_DEPTH_STENCIL: + if (type == GL_UNSIGNED_INT_24_8) return GL_NO_ERROR; else if (ctx->Extensions.ARB_depth_buffer_float && type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV) @@ -1694,8 +1690,6 @@ GLenum _mesa_es3_error_check_format_and_type(GLenum format, GLenum type, GLenum internalFormat) { - GLboolean type_valid = GL_TRUE; - switch (format) { case GL_RGBA: switch (type) { @@ -2116,5 +2110,5 @@ _mesa_es3_error_check_format_and_type(GLenum format, GLenum type, break; } - return type_valid ? GL_NO_ERROR : GL_INVALID_OPERATION; + return GL_NO_ERROR; } diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c index 277e9476a..4afe156b0 100644 --- a/mesalib/src/mesa/main/imports.c +++ b/mesalib/src/mesa/main/imports.c @@ -168,6 +168,8 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) * \param ptr pointer to the memory to be freed. * The actual address to free is stored in the word immediately before the * address the client sees. + * Note that it is legal to pass NULL pointer to this function and will be + * handled accordingly. */ void _mesa_align_free(void *ptr) @@ -177,9 +179,11 @@ _mesa_align_free(void *ptr) #elif defined(_WIN32) && defined(_MSC_VER) _aligned_free(ptr); #else - void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); - void *realAddr = *cubbyHole; - free(realAddr); + if (ptr) { + void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); + void *realAddr = *cubbyHole; + free(realAddr); + } #endif /* defined(HAVE_POSIX_MEMALIGN) */ } @@ -199,8 +203,8 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, if (newBuf && oldBuffer && copySize > 0) { memcpy(newBuf, oldBuffer, copySize); } - if (oldBuffer) - _mesa_align_free(oldBuffer); + + _mesa_align_free(oldBuffer); return newBuf; #endif } diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c index 180f89116..033015780 100644 --- a/mesalib/src/mesa/main/mipmap.c +++ b/mesalib/src/mesa/main/mipmap.c @@ -1767,8 +1767,8 @@ _mesa_generate_mipmap_level(GLenum target, * compute next (level+1) image size * \return GL_FALSE if no smaller size can be generated (eg. src is 1x1x1 size) */ -static GLboolean -next_mipmap_level_size(GLenum target, GLint border, +GLboolean +_mesa_next_mipmap_level_size(GLenum target, GLint border, GLint srcWidth, GLint srcHeight, GLint srcDepth, GLint *dstWidth, GLint *dstHeight, GLint *dstDepth) { @@ -1911,7 +1911,7 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target, srcDepth = srcImage->Depth; border = srcImage->Border; - nextLevel = next_mipmap_level_size(target, border, + nextLevel = _mesa_next_mipmap_level_size(target, border, srcWidth, srcHeight, srcDepth, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) @@ -2102,7 +2102,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target, srcDepth = srcImage->Depth; border = srcImage->Border; - nextLevel = next_mipmap_level_size(target, border, + nextLevel = _mesa_next_mipmap_level_size(target, border, srcWidth, srcHeight, srcDepth, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) diff --git a/mesalib/src/mesa/main/mipmap.h b/mesalib/src/mesa/main/mipmap.h index d5bd1d83d..ee91df006 100644 --- a/mesalib/src/mesa/main/mipmap.h +++ b/mesalib/src/mesa/main/mipmap.h @@ -51,5 +51,9 @@ extern void _mesa_generate_mipmap(struct gl_context *ctx, GLenum target, struct gl_texture_object *texObj); +extern GLboolean +_mesa_next_mipmap_level_size(GLenum target, GLint border, + GLint srcWidth, GLint srcHeight, GLint srcDepth, + GLint *dstWidth, GLint *dstHeight, GLint *dstDepth); #endif /* MIPMAP_H */ diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index b4b432f40..f93bb5641 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -280,6 +280,7 @@ typedef enum */ #define SYSTEM_BIT_SAMPLE_ID BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_ID) #define SYSTEM_BIT_SAMPLE_POS BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_POS) +#define SYSTEM_BIT_SAMPLE_MASK_IN BITFIELD64_BIT(SYSTEM_VALUE_SAMPLE_MASK_IN) /** * Determine if the given gl_varying_slot appears in the fragment shader. @@ -1193,6 +1194,11 @@ struct gl_texture_object pressure? */ GLboolean Immutable; /**< GL_ARB_texture_storage */ + GLuint MinLevel; /**< GL_ARB_texture_view */ + GLuint MinLayer; /**< GL_ARB_texture_view */ + GLuint NumLevels; /**< GL_ARB_texture_view */ + GLuint NumLayers; /**< GL_ARB_texture_view */ + /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; @@ -1968,12 +1974,13 @@ typedef enum */ typedef enum { - SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ - SYSTEM_VALUE_VERTEX_ID, /**< Vertex shader only */ - SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ - SYSTEM_VALUE_SAMPLE_ID, /**< Fragment shader only */ - SYSTEM_VALUE_SAMPLE_POS, /**< Fragment shader only */ - SYSTEM_VALUE_MAX /**< Number of values */ + SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ + SYSTEM_VALUE_VERTEX_ID, /**< Vertex shader only */ + SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ + SYSTEM_VALUE_SAMPLE_ID, /**< Fragment shader only */ + SYSTEM_VALUE_SAMPLE_POS, /**< Fragment shader only */ + SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */ + SYSTEM_VALUE_MAX /**< Number of values */ } gl_system_value; @@ -2132,6 +2139,12 @@ struct gl_fragment_program * uses centroid interpolation, 0 otherwise. Unused inputs are 0. */ GLbitfield64 IsCentroid; + + /** + * Bitfield indicating, for each fragment shader input, 1 if that input + * uses sample interpolation, 0 otherwise. Unused inputs are 0. + */ + GLbitfield64 IsSample; }; @@ -2352,9 +2365,7 @@ struct gl_shader struct exec_list *ir; struct glsl_symbol_table *symbols; - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; + bool uses_builtin_functions; /** * Geometry shader state from GLSL 1.50 layout qualifiers. @@ -2388,9 +2399,10 @@ typedef enum MESA_SHADER_VERTEX = 0, MESA_SHADER_GEOMETRY = 1, MESA_SHADER_FRAGMENT = 2, - MESA_SHADER_TYPES = 3 } gl_shader_type; +#define MESA_SHADER_TYPES (MESA_SHADER_FRAGMENT + 1) + struct gl_uniform_buffer_variable { @@ -3374,6 +3386,7 @@ struct gl_extensions GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; GLboolean ARB_texture_rgb10_a2ui; + GLboolean ARB_texture_view; GLboolean ARB_timer_query; GLboolean ARB_transform_feedback2; GLboolean ARB_transform_feedback3; @@ -3395,7 +3408,6 @@ struct gl_extensions GLboolean EXT_framebuffer_sRGB; GLboolean EXT_gpu_program_parameters; GLboolean EXT_gpu_shader4; - GLboolean EXT_packed_depth_stencil; GLboolean EXT_packed_float; GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; @@ -3432,7 +3444,6 @@ struct gl_extensions GLboolean ATI_fragment_shader; GLboolean ATI_separate_stencil; GLboolean MESA_pack_invert; - GLboolean MESA_texture_array; GLboolean MESA_ycbcr_texture; GLboolean NV_conditional_render; GLboolean NV_fog_distance; diff --git a/mesalib/src/mesa/main/performance_monitor.c b/mesalib/src/mesa/main/performance_monitor.c index 4981e6fb2..e62f77012 100644 --- a/mesalib/src/mesa/main/performance_monitor.c +++ b/mesalib/src/mesa/main/performance_monitor.c @@ -93,6 +93,25 @@ fail: return NULL; } +static void +free_performance_monitor(GLuint key, void *data, void *user) +{ + struct gl_perf_monitor_object *m = data; + struct gl_context *ctx = user; + + ralloc_free(m->ActiveGroups); + ralloc_free(m->ActiveCounters); + ctx->Driver.DeletePerfMonitor(ctx, m); +} + +void +_mesa_free_performance_monitors(struct gl_context *ctx) +{ + _mesa_HashDeleteAll(ctx->PerfMonitor.Monitors, + free_performance_monitor, ctx); + _mesa_DeleteHashTable(ctx->PerfMonitor.Monitors); +} + static inline struct gl_perf_monitor_object * lookup_monitor(struct gl_context *ctx, GLuint id) { diff --git a/mesalib/src/mesa/main/performance_monitor.h b/mesalib/src/mesa/main/performance_monitor.h index a852a4184..76234e5c1 100644 --- a/mesalib/src/mesa/main/performance_monitor.h +++ b/mesalib/src/mesa/main/performance_monitor.h @@ -35,6 +35,9 @@ extern void _mesa_init_performance_monitors(struct gl_context *ctx); +extern void +_mesa_free_performance_monitors(struct gl_context *ctx); + extern void GLAPIENTRY _mesa_GetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups); diff --git a/mesalib/src/mesa/main/shader_query.cpp b/mesalib/src/mesa/main/shader_query.cpp index 3014a9778..f14e1a562 100644 --- a/mesalib/src/mesa/main/shader_query.cpp +++ b/mesalib/src/mesa/main/shader_query.cpp @@ -106,8 +106,8 @@ _mesa_GetActiveAttrib(GLhandleARB program, GLuint desired_index, const ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var == NULL - || var->mode != ir_var_shader_in - || var->location == -1) + || var->data.mode != ir_var_shader_in + || var->data.location == -1) continue; if (current_index == desired_index) { @@ -169,13 +169,13 @@ _mesa_GetAttribLocation(GLhandleARB program, const GLcharARB * name) * attribute, or if an error occurs, -1 will be returned." */ if (var == NULL - || var->mode != ir_var_shader_in - || var->location == -1 - || var->location < VERT_ATTRIB_GENERIC0) + || var->data.mode != ir_var_shader_in + || var->data.location == -1 + || var->data.location < VERT_ATTRIB_GENERIC0) continue; if (strcmp(var->name, name) == 0) - return var->location - VERT_ATTRIB_GENERIC0; + return var->data.location - VERT_ATTRIB_GENERIC0; } return -1; @@ -197,8 +197,8 @@ _mesa_count_active_attribs(struct gl_shader_program *shProg) const ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var == NULL - || var->mode != ir_var_shader_in - || var->location == -1) + || var->data.mode != ir_var_shader_in + || var->data.location == -1) continue; i++; @@ -223,8 +223,8 @@ _mesa_longest_attribute_name_length(struct gl_shader_program *shProg) const ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var == NULL - || var->mode != ir_var_shader_in - || var->location == -1) + || var->data.mode != ir_var_shader_in + || var->data.location == -1) continue; const size_t len = strlen(var->name); @@ -333,13 +333,13 @@ _mesa_GetFragDataIndex(GLuint program, const GLchar *name) * attribute, or if an error occurs, -1 will be returned." */ if (var == NULL - || var->mode != ir_var_shader_out - || var->location == -1 - || var->location < FRAG_RESULT_DATA0) + || var->data.mode != ir_var_shader_out + || var->data.location == -1 + || var->data.location < FRAG_RESULT_DATA0) continue; if (strcmp(var->name, name) == 0) - return var->index; + return var->data.index; } return -1; @@ -389,13 +389,13 @@ _mesa_GetFragDataLocation(GLuint program, const GLchar *name) * attribute, or if an error occurs, -1 will be returned." */ if (var == NULL - || var->mode != ir_var_shader_out - || var->location == -1 - || var->location < FRAG_RESULT_DATA0) + || var->data.mode != ir_var_shader_out + || var->data.location == -1 + || var->data.location < FRAG_RESULT_DATA0) continue; if (strcmp(var->name, name) == 0) - return var->location - FRAG_RESULT_DATA0; + return var->data.location - FRAG_RESULT_DATA0; } return -1; diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 1d9aac39d..4f3be68a4 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -414,7 +414,7 @@ detach_shader(struct gl_context *ctx, GLuint program, GLuint shader) err = GL_INVALID_OPERATION; else err = GL_INVALID_VALUE; - _mesa_error(ctx, err, "glDetachProgram(shader)"); + _mesa_error(ctx, err, "glDetachShader(shader)"); return; } } diff --git a/mesalib/src/mesa/main/shaderobj.h b/mesalib/src/mesa/main/shaderobj.h index de1c9fcaf..aff178f26 100644 --- a/mesalib/src/mesa/main/shaderobj.h +++ b/mesalib/src/mesa/main/shaderobj.h @@ -113,7 +113,7 @@ _mesa_shader_type_to_index(GLenum v) return MESA_SHADER_GEOMETRY; default: ASSERT(0 && "bad value in _mesa_shader_type_to_index()"); - return MESA_SHADER_TYPES; + return MESA_SHADER_VERTEX; } } diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index d66ca1abc..200d29c2f 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -759,8 +759,7 @@ legal_getteximage_target(struct gl_context *ctx, GLenum target) return ctx->Extensions.NV_texture_rectangle; case GL_TEXTURE_1D_ARRAY_EXT: case GL_TEXTURE_2D_ARRAY_EXT: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return ctx->Extensions.EXT_texture_array; case GL_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; default: diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 793c5d382..9c3f1e86e 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -48,6 +48,7 @@ #include "texobj.h" #include "texstate.h" #include "texstorage.h" +#include "textureview.h" #include "mtypes.h" #include "glformats.h" @@ -300,14 +301,12 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } - if (ctx->Extensions.EXT_packed_depth_stencil) { - switch (internalFormat) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_DEPTH_STENCIL_EXT; - default: - ; /* fallthrough */ - } + switch (internalFormat) { + case GL_DEPTH_STENCIL: + case GL_DEPTH24_STENCIL8: + return GL_DEPTH_STENCIL; + default: + ; /* fallthrough */ } if (ctx->Extensions.EXT_texture_sRGB) { @@ -752,8 +751,7 @@ _mesa_select_tex_object(struct gl_context *ctx, const struct gl_texture_unit *texUnit, GLenum target) { - const GLboolean arrayTex = (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + const GLboolean arrayTex = ctx->Extensions.EXT_texture_array; switch (target) { case GL_TEXTURE_1D: @@ -1018,8 +1016,7 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target) case GL_PROXY_TEXTURE_1D_ARRAY_EXT: case GL_TEXTURE_2D_ARRAY_EXT: case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array) + return ctx->Extensions.EXT_texture_array ? ctx->Const.MaxTextureLevels : 0; case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: @@ -1726,8 +1723,7 @@ target_can_be_compressed(const struct gl_context *ctx, GLenum target, return ctx->Extensions.ARB_texture_cube_map; case GL_PROXY_TEXTURE_2D_ARRAY_EXT: case GL_TEXTURE_2D_ARRAY_EXT: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return ctx->Extensions.EXT_texture_array; case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; @@ -1775,9 +1771,7 @@ legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target) && ctx->Extensions.NV_texture_rectangle; case GL_TEXTURE_1D_ARRAY_EXT: case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - return _mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array; default: return GL_FALSE; } @@ -1788,14 +1782,10 @@ legal_teximage_target(struct gl_context *ctx, GLuint dims, GLenum target) case GL_PROXY_TEXTURE_3D: return _mesa_is_desktop_gl(ctx); case GL_TEXTURE_2D_ARRAY_EXT: - return (_mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array)) + return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array) || _mesa_is_gles3(ctx); case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return _mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array; case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; @@ -1836,9 +1826,7 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) return _mesa_is_desktop_gl(ctx) && ctx->Extensions.NV_texture_rectangle; case GL_TEXTURE_1D_ARRAY_EXT: - return _mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array; default: return GL_FALSE; } @@ -1847,9 +1835,7 @@ legal_texsubimage_target(struct gl_context *ctx, GLuint dims, GLenum target) case GL_TEXTURE_3D: return GL_TRUE; case GL_TEXTURE_2D_ARRAY_EXT: - return (_mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array)) + return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array) || _mesa_is_gles3(ctx); case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: @@ -2870,7 +2856,7 @@ _mesa_choose_texture_format(struct gl_context *ctx, } /* If the application requested compression to an S3TC format but we don't - * have the DTXn library, force a generic compressed format instead. + * have the DXTn library, force a generic compressed format instead. */ if (internalFormat != format && format != GL_NONE) { const GLenum before = internalFormat; @@ -3892,87 +3878,108 @@ _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, static gl_format get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) { + if (ctx->API != API_OPENGL_CORE) { + switch (internalFormat) { + case GL_ALPHA8: + return MESA_FORMAT_A8; + case GL_ALPHA16: + return MESA_FORMAT_A16; + case GL_ALPHA16F_ARB: + return MESA_FORMAT_ALPHA_FLOAT16; + case GL_ALPHA32F_ARB: + return MESA_FORMAT_ALPHA_FLOAT32; + case GL_ALPHA8I_EXT: + return MESA_FORMAT_ALPHA_INT8; + case GL_ALPHA16I_EXT: + return MESA_FORMAT_ALPHA_INT16; + case GL_ALPHA32I_EXT: + return MESA_FORMAT_ALPHA_INT32; + case GL_ALPHA8UI_EXT: + return MESA_FORMAT_ALPHA_UINT8; + case GL_ALPHA16UI_EXT: + return MESA_FORMAT_ALPHA_UINT16; + case GL_ALPHA32UI_EXT: + return MESA_FORMAT_ALPHA_UINT32; + case GL_LUMINANCE8: + return MESA_FORMAT_L8; + case GL_LUMINANCE16: + return MESA_FORMAT_L16; + case GL_LUMINANCE16F_ARB: + return MESA_FORMAT_LUMINANCE_FLOAT16; + case GL_LUMINANCE32F_ARB: + return MESA_FORMAT_LUMINANCE_FLOAT32; + case GL_LUMINANCE8I_EXT: + return MESA_FORMAT_LUMINANCE_INT8; + case GL_LUMINANCE16I_EXT: + return MESA_FORMAT_LUMINANCE_INT16; + case GL_LUMINANCE32I_EXT: + return MESA_FORMAT_LUMINANCE_INT32; + case GL_LUMINANCE8UI_EXT: + return MESA_FORMAT_LUMINANCE_UINT8; + case GL_LUMINANCE16UI_EXT: + return MESA_FORMAT_LUMINANCE_UINT16; + case GL_LUMINANCE32UI_EXT: + return MESA_FORMAT_LUMINANCE_UINT32; + case GL_LUMINANCE8_ALPHA8: + return MESA_FORMAT_AL88; + case GL_LUMINANCE16_ALPHA16: + return MESA_FORMAT_AL1616; + case GL_LUMINANCE_ALPHA16F_ARB: + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; + case GL_LUMINANCE_ALPHA32F_ARB: + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; + case GL_LUMINANCE_ALPHA8I_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_INT8; + case GL_LUMINANCE_ALPHA16I_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_INT8; + case GL_LUMINANCE_ALPHA32I_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_INT16; + case GL_LUMINANCE_ALPHA8UI_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_UINT8; + case GL_LUMINANCE_ALPHA16UI_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_UINT16; + case GL_LUMINANCE_ALPHA32UI_EXT: + return MESA_FORMAT_LUMINANCE_ALPHA_UINT32; + case GL_INTENSITY8: + return MESA_FORMAT_I8; + case GL_INTENSITY16: + return MESA_FORMAT_I16; + case GL_INTENSITY16F_ARB: + return MESA_FORMAT_INTENSITY_FLOAT16; + case GL_INTENSITY32F_ARB: + return MESA_FORMAT_INTENSITY_FLOAT32; + case GL_INTENSITY8I_EXT: + return MESA_FORMAT_INTENSITY_INT8; + case GL_INTENSITY16I_EXT: + return MESA_FORMAT_INTENSITY_INT16; + case GL_INTENSITY32I_EXT: + return MESA_FORMAT_INTENSITY_INT32; + case GL_INTENSITY8UI_EXT: + return MESA_FORMAT_INTENSITY_UINT8; + case GL_INTENSITY16UI_EXT: + return MESA_FORMAT_INTENSITY_UINT16; + case GL_INTENSITY32UI_EXT: + return MESA_FORMAT_INTENSITY_UINT32; + default: + break; + } + } + + if (ctx->API == API_OPENGL_CORE && + ctx->Extensions.ARB_texture_buffer_object_rgb32) { + switch (internalFormat) { + case GL_RGB32F: + return MESA_FORMAT_RGB_FLOAT32; + case GL_RGB32UI: + return MESA_FORMAT_RGB_UINT32; + case GL_RGB32I: + return MESA_FORMAT_RGB_INT32; + default: + break; + } + } + switch (internalFormat) { - case GL_ALPHA8: - return MESA_FORMAT_A8; - case GL_ALPHA16: - return MESA_FORMAT_A16; - case GL_ALPHA16F_ARB: - return MESA_FORMAT_ALPHA_FLOAT16; - case GL_ALPHA32F_ARB: - return MESA_FORMAT_ALPHA_FLOAT32; - case GL_ALPHA8I_EXT: - return MESA_FORMAT_ALPHA_INT8; - case GL_ALPHA16I_EXT: - return MESA_FORMAT_ALPHA_INT16; - case GL_ALPHA32I_EXT: - return MESA_FORMAT_ALPHA_INT32; - case GL_ALPHA8UI_EXT: - return MESA_FORMAT_ALPHA_UINT8; - case GL_ALPHA16UI_EXT: - return MESA_FORMAT_ALPHA_UINT16; - case GL_ALPHA32UI_EXT: - return MESA_FORMAT_ALPHA_UINT32; - case GL_LUMINANCE8: - return MESA_FORMAT_L8; - case GL_LUMINANCE16: - return MESA_FORMAT_L16; - case GL_LUMINANCE16F_ARB: - return MESA_FORMAT_LUMINANCE_FLOAT16; - case GL_LUMINANCE32F_ARB: - return MESA_FORMAT_LUMINANCE_FLOAT32; - case GL_LUMINANCE8I_EXT: - return MESA_FORMAT_LUMINANCE_INT8; - case GL_LUMINANCE16I_EXT: - return MESA_FORMAT_LUMINANCE_INT16; - case GL_LUMINANCE32I_EXT: - return MESA_FORMAT_LUMINANCE_INT32; - case GL_LUMINANCE8UI_EXT: - return MESA_FORMAT_LUMINANCE_UINT8; - case GL_LUMINANCE16UI_EXT: - return MESA_FORMAT_LUMINANCE_UINT16; - case GL_LUMINANCE32UI_EXT: - return MESA_FORMAT_LUMINANCE_UINT32; - case GL_LUMINANCE8_ALPHA8: - return MESA_FORMAT_AL88; - case GL_LUMINANCE16_ALPHA16: - return MESA_FORMAT_AL1616; - case GL_LUMINANCE_ALPHA16F_ARB: - return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; - case GL_LUMINANCE_ALPHA32F_ARB: - return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; - case GL_LUMINANCE_ALPHA8I_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_INT8; - case GL_LUMINANCE_ALPHA16I_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_INT8; - case GL_LUMINANCE_ALPHA32I_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_INT16; - case GL_LUMINANCE_ALPHA8UI_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_UINT8; - case GL_LUMINANCE_ALPHA16UI_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_UINT16; - case GL_LUMINANCE_ALPHA32UI_EXT: - return MESA_FORMAT_LUMINANCE_ALPHA_UINT32; - case GL_INTENSITY8: - return MESA_FORMAT_I8; - case GL_INTENSITY16: - return MESA_FORMAT_I16; - case GL_INTENSITY16F_ARB: - return MESA_FORMAT_INTENSITY_FLOAT16; - case GL_INTENSITY32F_ARB: - return MESA_FORMAT_INTENSITY_FLOAT32; - case GL_INTENSITY8I_EXT: - return MESA_FORMAT_INTENSITY_INT8; - case GL_INTENSITY16I_EXT: - return MESA_FORMAT_INTENSITY_INT16; - case GL_INTENSITY32I_EXT: - return MESA_FORMAT_INTENSITY_INT32; - case GL_INTENSITY8UI_EXT: - return MESA_FORMAT_INTENSITY_UINT8; - case GL_INTENSITY16UI_EXT: - return MESA_FORMAT_INTENSITY_UINT16; - case GL_INTENSITY32UI_EXT: - return MESA_FORMAT_INTENSITY_UINT32; case GL_RGBA8: return MESA_FORMAT_RGBA8888_REV; case GL_RGBA16: @@ -4036,21 +4043,15 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) case GL_R32UI: return MESA_FORMAT_R_UINT32; - case GL_RGB32F: - return MESA_FORMAT_RGB_FLOAT32; - case GL_RGB32UI: - return MESA_FORMAT_RGB_UINT32; - case GL_RGB32I: - return MESA_FORMAT_RGB_INT32; - default: return MESA_FORMAT_NONE; } } -static gl_format -validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) +gl_format +_mesa_validate_texbuffer_format(const struct gl_context *ctx, + GLenum internalFormat) { gl_format format = get_texbuffer_format(ctx, internalFormat); GLenum datatype; @@ -4065,15 +4066,10 @@ validate_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) if (datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel) return MESA_FORMAT_NONE; - /* The GL_ARB_texture_rg and GL_ARB_texture_buffer_object specs don't make - * any mention of R/RG formats, but they appear in the GL 3.1 core - * specification. - */ - if (ctx->Version <= 30) { + if (!ctx->Extensions.ARB_texture_rg) { GLenum base_format = _mesa_get_format_base_format(format); - if (base_format == GL_R || base_format == GL_RG) - return MESA_FORMAT_NONE; + return MESA_FORMAT_NONE; } if (!ctx->Extensions.ARB_texture_buffer_object_rgb32) { @@ -4100,7 +4096,7 @@ texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat, return; } - format = validate_texbuffer_format(ctx, internalFormat); + format = _mesa_validate_texbuffer_format(ctx, internalFormat); if (format == MESA_FORMAT_NONE) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexBuffer(internalFormat 0x%x)", internalFormat); @@ -4348,6 +4344,11 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, } texObj->Immutable = immutable; + + if (immutable) { + _mesa_set_texture_view_state(ctx, texObj, target, 1); + } + _mesa_update_fbo_texture(ctx, texObj, 0, 0); } } diff --git a/mesalib/src/mesa/main/teximage.h b/mesalib/src/mesa/main/teximage.h index 792383d2f..0b5786340 100644 --- a/mesalib/src/mesa/main/teximage.h +++ b/mesalib/src/mesa/main/teximage.h @@ -147,6 +147,10 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target, GLint level, GLint width, GLint height, GLint depth, GLint border); +extern gl_format +_mesa_validate_texbuffer_format(const struct gl_context *ctx, + GLenum internalFormat); + /** * Lock a texture for updating. See also _mesa_lock_context_textures(). */ diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index abd30c563..d6510fefd 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/src/mesa/main/texobj.c @@ -552,7 +552,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, t->_MaxLevel = MIN3(t->MaxLevel, /* 'p' in the GL spec */ - baseLevel + baseImage->MaxNumLevels - 1, + (int) (baseLevel + baseImage->MaxNumLevels - 1), /* 'q' in the GL spec */ maxLevels - 1); @@ -889,6 +889,8 @@ count_tex_size(GLuint key, void *data, void *userData) (const struct gl_texture_object *) data; GLuint *total = (GLuint *) userData; + (void) key; + *total = *total + texture_size(texObj); } @@ -1171,7 +1173,7 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) * \return TEXTURE_x_INDEX or -1 if target is invalid */ static GLint -target_enum_to_index(struct gl_context *ctx, GLenum target) +target_enum_to_index(const struct gl_context *ctx, GLenum target) { switch (target) { case GL_TEXTURE_1D: @@ -1179,25 +1181,21 @@ target_enum_to_index(struct gl_context *ctx, GLenum target) case GL_TEXTURE_2D: return TEXTURE_2D_INDEX; case GL_TEXTURE_3D: - return TEXTURE_3D_INDEX; - case GL_TEXTURE_CUBE_MAP_ARB: + return ctx->API != API_OPENGLES ? TEXTURE_3D_INDEX : -1; + case GL_TEXTURE_CUBE_MAP: return ctx->Extensions.ARB_texture_cube_map ? TEXTURE_CUBE_INDEX : -1; - case GL_TEXTURE_RECTANGLE_NV: + case GL_TEXTURE_RECTANGLE: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.NV_texture_rectangle ? TEXTURE_RECT_INDEX : -1; - case GL_TEXTURE_1D_ARRAY_EXT: - return _mesa_is_desktop_gl(ctx) - && (ctx->Extensions.EXT_texture_array - || ctx->Extensions.MESA_texture_array) + case GL_TEXTURE_1D_ARRAY: + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array ? TEXTURE_1D_ARRAY_INDEX : -1; - case GL_TEXTURE_2D_ARRAY_EXT: - return (_mesa_is_desktop_gl(ctx) - && (ctx->Extensions.EXT_texture_array - || ctx->Extensions.MESA_texture_array)) + case GL_TEXTURE_2D_ARRAY: + return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array) || _mesa_is_gles3(ctx) ? TEXTURE_2D_ARRAY_INDEX : -1; - case GL_TEXTURE_BUFFER_ARB: + case GL_TEXTURE_BUFFER: return ctx->API == API_OPENGL_CORE && ctx->Extensions.ARB_texture_buffer_object ? TEXTURE_BUFFER_INDEX : -1; @@ -1205,7 +1203,8 @@ target_enum_to_index(struct gl_context *ctx, GLenum target) return _mesa_is_gles(ctx) && ctx->Extensions.OES_EGL_image_external ? TEXTURE_EXTERNAL_INDEX : -1; case GL_TEXTURE_CUBE_MAP_ARRAY: - return TEXTURE_CUBE_ARRAY_INDEX; + return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_cube_map_array + ? TEXTURE_CUBE_ARRAY_INDEX : -1; case GL_TEXTURE_2D_MULTISAMPLE: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_multisample ? TEXTURE_2D_MULTISAMPLE_INDEX: -1; diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 7092c630b..94e498d20 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -158,16 +158,13 @@ get_texobj(struct gl_context *ctx, GLenum target, GLboolean get) } break; case GL_TEXTURE_1D_ARRAY_EXT: - if (_mesa_is_desktop_gl(ctx) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array)) { + if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_array) { return texUnit->CurrentTex[TEXTURE_1D_ARRAY_INDEX]; } break; case GL_TEXTURE_2D_ARRAY_EXT: if ((_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) - && (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array)) { + && ctx->Extensions.EXT_texture_array) { return texUnit->CurrentTex[TEXTURE_2D_ARRAY_INDEX]; } break; @@ -1046,8 +1043,7 @@ legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target) case GL_PROXY_TEXTURE_1D_ARRAY_EXT: case GL_TEXTURE_2D_ARRAY_EXT: case GL_PROXY_TEXTURE_2D_ARRAY_EXT: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return ctx->Extensions.EXT_texture_array; case GL_TEXTURE_BUFFER: /* GetTexLevelParameter accepts GL_TEXTURE_BUFFER in GL 3.1+ contexts, * but not in earlier versions that expose ARB_texture_buffer_object. @@ -1166,10 +1162,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, goto invalid_pname; *params = _mesa_get_format_bits(texFormat, pname); break; - case GL_TEXTURE_STENCIL_SIZE_EXT: - if (!ctx->Extensions.EXT_packed_depth_stencil && - !ctx->Extensions.ARB_framebuffer_object) - goto invalid_pname; + case GL_TEXTURE_STENCIL_SIZE: *params = _mesa_get_format_bits(texFormat, pname); break; case GL_TEXTURE_SHARED_SIZE: @@ -1562,9 +1555,35 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (!_mesa_is_gles3(ctx)) + if (_mesa_is_gles3(ctx) || + (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view)) + *params = (GLfloat) obj->ImmutableLevels; + else goto invalid_pname; - *params = (GLfloat) obj->ImmutableLevels; + break; + + case GL_TEXTURE_VIEW_MIN_LEVEL: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLfloat) obj->MinLevel; + break; + + case GL_TEXTURE_VIEW_NUM_LEVELS: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLfloat) obj->NumLevels; + break; + + case GL_TEXTURE_VIEW_MIN_LAYER: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLfloat) obj->MinLayer; + break; + + case GL_TEXTURE_VIEW_NUM_LAYERS: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLfloat) obj->NumLayers; break; case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: @@ -1746,9 +1765,35 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) break; case GL_TEXTURE_IMMUTABLE_LEVELS: - if (!_mesa_is_gles3(ctx)) + if (_mesa_is_gles3(ctx) || + (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_view)) + *params = obj->ImmutableLevels; + else + goto invalid_pname; + break; + + case GL_TEXTURE_VIEW_MIN_LEVEL: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLint) obj->MinLevel; + break; + + case GL_TEXTURE_VIEW_NUM_LEVELS: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLint) obj->NumLevels; + break; + + case GL_TEXTURE_VIEW_MIN_LAYER: + if (!ctx->Extensions.ARB_texture_view) + goto invalid_pname; + *params = (GLint) obj->MinLayer; + break; + + case GL_TEXTURE_VIEW_NUM_LAYERS: + if (!ctx->Extensions.ARB_texture_view) goto invalid_pname; - *params = obj->ImmutableLevels; + *params = (GLint) obj->NumLayers; break; case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c index 84b8f8224..5062fdb4f 100644 --- a/mesalib/src/mesa/main/texstorage.c +++ b/mesalib/src/mesa/main/texstorage.c @@ -37,7 +37,9 @@ #include "macros.h" #include "teximage.h" #include "texobj.h" +#include "mipmap.h" #include "texstorage.h" +#include "textureview.h" #include "mtypes.h" @@ -73,8 +75,7 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) return ctx->Extensions.NV_texture_rectangle; case GL_TEXTURE_1D_ARRAY: case GL_PROXY_TEXTURE_1D_ARRAY: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return ctx->Extensions.EXT_texture_array; default: return GL_FALSE; } @@ -85,8 +86,7 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) return GL_TRUE; case GL_TEXTURE_2D_ARRAY: case GL_PROXY_TEXTURE_2D_ARRAY: - return (ctx->Extensions.MESA_texture_array || - ctx->Extensions.EXT_texture_array); + return ctx->Extensions.EXT_texture_array; case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: return ctx->Extensions.ARB_texture_cube_map_array; @@ -100,27 +100,6 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) } -/** - * Compute the size of the next mipmap level. - */ -static void -next_mipmap_level_size(GLenum target, - GLint *width, GLint *height, GLint *depth) -{ - if (*width > 1) { - *width /= 2; - } - - if ((*height > 1) && (target != GL_TEXTURE_1D_ARRAY)) { - *height /= 2; - } - - if ((*depth > 1) && (target != GL_TEXTURE_2D_ARRAY)) { - *depth /= 2; - } -} - - /** Helper to get a particular texture image in a texture object */ static struct gl_texture_image * get_tex_image(struct gl_context *ctx, @@ -164,7 +143,8 @@ initialize_texture_fields(struct gl_context *ctx, 0, internalFormat, texFormat); } - next_mipmap_level_size(target, &levelWidth, &levelHeight, &levelDepth); + _mesa_next_mipmap_level_size(target, 0, levelWidth, levelHeight, levelDepth, + &levelWidth, &levelHeight, &levelDepth); } return GL_TRUE; } @@ -436,8 +416,8 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat, return; } - texObj->Immutable = GL_TRUE; - texObj->ImmutableLevels = levels; + _mesa_set_texture_view_state(ctx, texObj, target, levels); + } } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 76d8d9ba3..5adbd5dc9 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -3864,6 +3864,7 @@ _mesa_texstore_memcpy(TEXSTORE_PARAMS) /** * Store user data into texture memory. * Called via glTex[Sub]Image1/2/3D() + * \return GL_TRUE for success, GL_FALSE for failure (out of memory). */ GLboolean _mesa_texstore(TEXSTORE_PARAMS) diff --git a/mesalib/src/mesa/main/textureview.c b/mesalib/src/mesa/main/textureview.c new file mode 100644 index 000000000..5f88a4171 --- /dev/null +++ b/mesalib/src/mesa/main/textureview.c @@ -0,0 +1,668 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 2013 LunarG, Inc. + * + * 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. + * + * Authors: + * Courtney Goeltzenleuchter <courtney@lunarg.com> + */ + + +/** + * \file textureview.c + * GL_ARB_texture_view functions + */ + +#include "glheader.h" +#include "context.h" +#include "enums.h" +#include "imports.h" +#include "macros.h" +#include "teximage.h" +#include "texobj.h" +#include "mipmap.h" +#include "texstorage.h" +#include "textureview.h" +#include "stdbool.h" +#include "mtypes.h" + +/* Table 3.X.2 (Compatible internal formats for TextureView) + --------------------------------------------------------------------------- + | Class | Internal formats | + --------------------------------------------------------------------------- + | VIEW_CLASS_128_BITS | RGBA32F, RGBA32UI, RGBA32I | + --------------------------------------------------------------------------- + | VIEW_CLASS_96_BITS | RGB32F, RGB32UI, RGB32I | + --------------------------------------------------------------------------- + | VIEW_CLASS_64_BITS | RGBA16F, RG32F, RGBA16UI, RG32UI, RGBA16I, | + | | RG32I, RGBA16, RGBA16_SNORM | + --------------------------------------------------------------------------- + | VIEW_CLASS_48_BITS | RGB16, RGB16_SNORM, RGB16F, RGB16UI, RGB16I | + --------------------------------------------------------------------------- + | VIEW_CLASS_32_BITS | RG16F, R11F_G11F_B10F, R32F, | + | | RGB10_A2UI, RGBA8UI, RG16UI, R32UI, | + | | RGBA8I, RG16I, R32I, RGB10_A2, RGBA8, RG16, | + | | RGBA8_SNORM, RG16_SNORM, SRGB8_ALPHA8, RGB9_E5 | + --------------------------------------------------------------------------- + | VIEW_CLASS_24_BITS | RGB8, RGB8_SNORM, SRGB8, RGB8UI, RGB8I | + --------------------------------------------------------------------------- + | VIEW_CLASS_16_BITS | R16F, RG8UI, R16UI, RG8I, R16I, RG8, R16, | + | | RG8_SNORM, R16_SNORM | + --------------------------------------------------------------------------- + | VIEW_CLASS_8_BITS | R8UI, R8I, R8, R8_SNORM | + --------------------------------------------------------------------------- + | VIEW_CLASS_RGTC1_RED | COMPRESSED_RED_RGTC1, | + | | COMPRESSED_SIGNED_RED_RGTC1 | + --------------------------------------------------------------------------- + | VIEW_CLASS_RGTC2_RG | COMPRESSED_RG_RGTC2, | + | | COMPRESSED_SIGNED_RG_RGTC2 | + --------------------------------------------------------------------------- + | VIEW_CLASS_BPTC_UNORM | COMPRESSED_RGBA_BPTC_UNORM, | + | | COMPRESSED_SRGB_ALPHA_BPTC_UNORM | + --------------------------------------------------------------------------- + | VIEW_CLASS_BPTC_FLOAT | COMPRESSED_RGB_BPTC_SIGNED_FLOAT, | + | | COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT | + --------------------------------------------------------------------------- + */ +struct internal_format_class_info { + GLenum view_class; + GLenum internal_format; +}; +static const struct internal_format_class_info compatible_internal_formats[] = { + {GL_VIEW_CLASS_128_BITS, GL_RGBA32F}, + {GL_VIEW_CLASS_128_BITS, GL_RGBA32UI}, + {GL_VIEW_CLASS_128_BITS, GL_RGBA32I}, + {GL_VIEW_CLASS_96_BITS, GL_RGB32F}, + {GL_VIEW_CLASS_96_BITS, GL_RGB32UI}, + {GL_VIEW_CLASS_96_BITS, GL_RGB32I}, + {GL_VIEW_CLASS_64_BITS, GL_RGBA16F}, + {GL_VIEW_CLASS_64_BITS, GL_RG32F}, + {GL_VIEW_CLASS_64_BITS, GL_RGBA16UI}, + {GL_VIEW_CLASS_64_BITS, GL_RG32UI}, + {GL_VIEW_CLASS_64_BITS, GL_RGBA16I}, + {GL_VIEW_CLASS_64_BITS, GL_RG32I}, + {GL_VIEW_CLASS_64_BITS, GL_RGBA16}, + {GL_VIEW_CLASS_64_BITS, GL_RGBA16_SNORM}, + {GL_VIEW_CLASS_48_BITS, GL_RGB16}, + {GL_VIEW_CLASS_48_BITS, GL_RGB16_SNORM}, + {GL_VIEW_CLASS_48_BITS, GL_RGB16F}, + {GL_VIEW_CLASS_48_BITS, GL_RGB16UI}, + {GL_VIEW_CLASS_48_BITS, GL_RGB16I}, + {GL_VIEW_CLASS_32_BITS, GL_RG16F}, + {GL_VIEW_CLASS_32_BITS, GL_R11F_G11F_B10F}, + {GL_VIEW_CLASS_32_BITS, GL_R32F}, + {GL_VIEW_CLASS_32_BITS, GL_RGB10_A2UI}, + {GL_VIEW_CLASS_32_BITS, GL_RGBA8UI}, + {GL_VIEW_CLASS_32_BITS, GL_RG16UI}, + {GL_VIEW_CLASS_32_BITS, GL_R32UI}, + {GL_VIEW_CLASS_32_BITS, GL_RGBA8I}, + {GL_VIEW_CLASS_32_BITS, GL_RG16I}, + {GL_VIEW_CLASS_32_BITS, GL_R32I}, + {GL_VIEW_CLASS_32_BITS, GL_RGB10_A2}, + {GL_VIEW_CLASS_32_BITS, GL_RGBA8}, + {GL_VIEW_CLASS_32_BITS, GL_RG16}, + {GL_VIEW_CLASS_32_BITS, GL_RGBA8_SNORM}, + {GL_VIEW_CLASS_32_BITS, GL_RG16_SNORM}, + {GL_VIEW_CLASS_32_BITS, GL_SRGB8_ALPHA8}, + {GL_VIEW_CLASS_32_BITS, GL_RGB9_E5}, + {GL_VIEW_CLASS_24_BITS, GL_RGB8}, + {GL_VIEW_CLASS_24_BITS, GL_RGB8_SNORM}, + {GL_VIEW_CLASS_24_BITS, GL_SRGB8}, + {GL_VIEW_CLASS_24_BITS, GL_RGB8UI}, + {GL_VIEW_CLASS_24_BITS, GL_RGB8I}, + {GL_VIEW_CLASS_16_BITS, GL_R16F}, + {GL_VIEW_CLASS_16_BITS, GL_RG8UI}, + {GL_VIEW_CLASS_16_BITS, GL_R16UI}, + {GL_VIEW_CLASS_16_BITS, GL_RG8I}, + {GL_VIEW_CLASS_16_BITS, GL_R16I}, + {GL_VIEW_CLASS_16_BITS, GL_RG8}, + {GL_VIEW_CLASS_16_BITS, GL_R16}, + {GL_VIEW_CLASS_16_BITS, GL_RG8_SNORM}, + {GL_VIEW_CLASS_16_BITS, GL_R16_SNORM}, + {GL_VIEW_CLASS_8_BITS, GL_R8UI}, + {GL_VIEW_CLASS_8_BITS, GL_R8I}, + {GL_VIEW_CLASS_8_BITS, GL_R8}, + {GL_VIEW_CLASS_8_BITS, GL_R8_SNORM}, + {GL_VIEW_CLASS_RGTC1_RED, GL_COMPRESSED_RED_RGTC1}, + {GL_VIEW_CLASS_RGTC1_RED, GL_COMPRESSED_SIGNED_RED_RGTC1}, + {GL_VIEW_CLASS_RGTC2_RG, GL_COMPRESSED_RG_RGTC2}, + {GL_VIEW_CLASS_RGTC2_RG, GL_COMPRESSED_SIGNED_RG_RGTC2}, + {GL_VIEW_CLASS_BPTC_UNORM, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB}, + {GL_VIEW_CLASS_BPTC_UNORM, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB}, + {GL_VIEW_CLASS_BPTC_FLOAT, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB}, + {GL_VIEW_CLASS_BPTC_FLOAT, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB}, +}; + +static const struct internal_format_class_info s3tc_compatible_internal_formats[] = { + {GL_VIEW_CLASS_S3TC_DXT1_RGB, GL_COMPRESSED_RGB_S3TC_DXT1_EXT}, + {GL_VIEW_CLASS_S3TC_DXT1_RGB, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT}, + {GL_VIEW_CLASS_S3TC_DXT1_RGBA, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT}, + {GL_VIEW_CLASS_S3TC_DXT1_RGBA, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT}, + {GL_VIEW_CLASS_S3TC_DXT3_RGBA, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT}, + {GL_VIEW_CLASS_S3TC_DXT3_RGBA, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT}, + {GL_VIEW_CLASS_S3TC_DXT5_RGBA, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT}, + {GL_VIEW_CLASS_S3TC_DXT5_RGBA, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}, +}; + +/** + * Lookup format view class based on internalformat + * \return VIEW_CLASS if internalformat found in table, false otherwise. + */ +static GLenum +lookup_view_class(struct gl_context *ctx, GLenum internalformat) +{ + GLuint i; + + for (i = 0; i < ARRAY_SIZE(compatible_internal_formats); i++) { + if (compatible_internal_formats[i].internal_format == internalformat) + return compatible_internal_formats[i].view_class; + } + + if (ctx->Extensions.EXT_texture_compression_s3tc && ctx->Extensions.EXT_texture_sRGB) { + for (i = 0; i < ARRAY_SIZE(s3tc_compatible_internal_formats); i++) { + if (s3tc_compatible_internal_formats[i].internal_format == internalformat) + return s3tc_compatible_internal_formats[i].view_class; + } + } + return GL_FALSE; +} + +/** + * Initialize new texture's gl_texture_image structures. Will not call driver + * to allocate new space, simply record relevant layer, face, format, etc. + * \return GL_FALSE if any error, GL_TRUE otherwise. + */ +static GLboolean +initialize_texture_fields(struct gl_context *ctx, + GLenum target, + struct gl_texture_object *texObj, + GLint levels, + GLsizei width, GLsizei height, GLsizei depth, + GLenum internalFormat, gl_format texFormat) +{ + const GLuint numFaces = _mesa_num_tex_faces(target); + GLint level, levelWidth = width, levelHeight = height, levelDepth = depth; + GLuint face; + + /* Pretend we are bound to initialize the gl_texture_image structs */ + texObj->Target = target; + + /* Set up all the texture object's gl_texture_images */ + for (level = 0; level < levels; level++) { + for (face = 0; face < numFaces; face++) { + struct gl_texture_image *texImage; + GLenum faceTarget = target; + + if (target == GL_TEXTURE_CUBE_MAP) + faceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face; + + texImage = _mesa_get_tex_image(ctx, texObj, faceTarget, level); + + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexStorage"); + return GL_FALSE; + } + + _mesa_init_teximage_fields(ctx, texImage, + levelWidth, levelHeight, levelDepth, + 0, internalFormat, texFormat); + } + + _mesa_next_mipmap_level_size(target, 0, levelWidth, levelHeight, levelDepth, + &levelWidth, &levelHeight, &levelDepth); + } + + /* "unbind" */ + texObj->Target = 0; + + return GL_TRUE; +} + +#define RETURN_IF_SUPPORTED(t) do { \ + if (newTarget == GL_ ## t) \ + return true; \ +} while (0) + +/** + * Check for compatible target + * If an error is found, record it with _mesa_error() + * \return false if any error, true otherwise. + */ +static bool +target_valid(struct gl_context *ctx, GLenum origTarget, GLenum newTarget) +{ + /* + * From ARB_texture_view spec: + --------------------------------------------------------------------------------------------------------- + | Original target | Valid new targets | + --------------------------------------------------------------------------------------------------------- + | TEXTURE_1D | TEXTURE_1D, TEXTURE_1D_ARRAY | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_2D | TEXTURE_2D, TEXTURE_2D_ARRAY | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_3D | TEXTURE_3D | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_CUBE_MAP | TEXTURE_CUBE_MAP, TEXTURE_2D, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_RECTANGLE | TEXTURE_RECTANGLE | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_BUFFER | <none> | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_1D_ARRAY | TEXTURE_1D_ARRAY, TEXTURE_1D | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_2D_ARRAY | TEXTURE_2D_ARRAY, TEXTURE_2D, TEXTURE_CUBE_MAP, TEXTURE_CUBE_MAP_ARRAY | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_CUBE_MAP_ARRAY | TEXTURE_CUBE_MAP_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_2D, TEXTURE_CUBE_MAP | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_2D_MULTISAMPLE | TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY | + | ------------------------------------------------------------------------------------------------------- | + | TEXTURE_2D_MULTISAMPLE_ARRAY | TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY | + --------------------------------------------------------------------------------------------------------- + */ + + switch (origTarget) { + case GL_TEXTURE_1D: + case GL_TEXTURE_1D_ARRAY: + RETURN_IF_SUPPORTED(TEXTURE_1D); + RETURN_IF_SUPPORTED(TEXTURE_1D_ARRAY); + break; + case GL_TEXTURE_2D: + RETURN_IF_SUPPORTED(TEXTURE_2D); + RETURN_IF_SUPPORTED(TEXTURE_2D_ARRAY); + break; + case GL_TEXTURE_3D: + RETURN_IF_SUPPORTED(TEXTURE_3D); + break; + case GL_TEXTURE_RECTANGLE: + RETURN_IF_SUPPORTED(TEXTURE_RECTANGLE); + break; + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + RETURN_IF_SUPPORTED(TEXTURE_2D); + RETURN_IF_SUPPORTED(TEXTURE_2D_ARRAY); + RETURN_IF_SUPPORTED(TEXTURE_CUBE_MAP); + RETURN_IF_SUPPORTED(TEXTURE_CUBE_MAP_ARRAY); + break; + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + RETURN_IF_SUPPORTED(TEXTURE_2D_MULTISAMPLE); + RETURN_IF_SUPPORTED(TEXTURE_2D_MULTISAMPLE_ARRAY); + break; + } + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTextureView(illegal target=%s)", + _mesa_lookup_enum_by_nr(newTarget)); + return false; +} +#undef RETURN_IF_SUPPORTED + +/** + * Check for compatible format + * If an error is found, record it with _mesa_error() + * \return false if any error, true otherwise. + */ +static bool +compatible_format(struct gl_context *ctx, const struct gl_texture_object *origTexObj, + GLenum internalformat) +{ + /* Level 0 of a texture created by glTextureStorage or glTextureView + * is always defined. + */ + struct gl_texture_image *texImage = origTexObj->Image[0][0]; + GLint origInternalFormat = texImage->InternalFormat; + unsigned int origViewClass, newViewClass; + + /* The two textures' internal formats must be compatible according to + * Table 3.X.2 (Compatible internal formats for TextureView) + * if the internal format exists in that table the view class must match. + * The internal formats must be identical if not in that table, + * or an INVALID_OPERATION error is generated. + */ + if (origInternalFormat == internalformat) + return true; + + origViewClass = lookup_view_class(ctx, origInternalFormat); + newViewClass = lookup_view_class(ctx, internalformat); + if ((origViewClass == newViewClass) && origViewClass != false) + return true; + + _mesa_error(ctx, GL_INVALID_OPERATION, + "glTextureView(internalformat %s not compatible with origtexture %s)", + _mesa_lookup_enum_by_nr(internalformat), + _mesa_lookup_enum_by_nr(origInternalFormat)); + return false; +} +/** + * Helper function for TexStorage and teximagemultisample to set immutable + * texture state needed by ARB_texture_view. + */ +void +_mesa_set_texture_view_state(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLenum target, GLuint levels) +{ + struct gl_texture_image *texImage; + + /* Get a reference to what will become this View's base level */ + texImage = _mesa_select_tex_image(ctx, texObj, target, 0); + + /* When an immutable texture is created via glTexStorage or glTexImageMultisample, + * TEXTURE_IMMUTABLE_FORMAT becomes TRUE. + * TEXTURE_IMMUTABLE_LEVELS and TEXTURE_VIEW_NUM_LEVELS become levels. + * If the texture target is TEXTURE_1D_ARRAY then + * TEXTURE_VIEW_NUM_LAYERS becomes height. + * If the texture target is TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, + * or TEXTURE_2D_MULTISAMPLE_ARRAY then TEXTURE_VIEW_NUM_LAYERS becomes depth. + * If the texture target is TEXTURE_CUBE_MAP, then + * TEXTURE_VIEW_NUM_LAYERS becomes 6. + * For any other texture target, TEXTURE_VIEW_NUM_LAYERS becomes 1. + * + * ARB_texture_multisample: Multisample textures do + * not have multiple image levels. + */ + + texObj->Immutable = GL_TRUE; + texObj->ImmutableLevels = levels; + texObj->MinLevel = 0; + texObj->NumLevels = levels; + texObj->MinLayer = 0; + texObj->NumLayers = 1; + switch (target) { + case GL_TEXTURE_1D_ARRAY: + texObj->NumLayers = texImage->Height; + break; + + case GL_TEXTURE_2D_MULTISAMPLE: + texObj->NumLevels = 1; + texObj->ImmutableLevels = 1; + break; + + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + texObj->NumLevels = 1; + texObj->ImmutableLevels = 1; + /* fall through to set NumLayers */ + + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + texObj->NumLayers = texImage->Depth; + break; + + case GL_TEXTURE_CUBE_MAP: + texObj->NumLayers = 6; + break; + + } +} + +/** + * glTextureView (ARB_texture_view) + * If an error is found, record it with _mesa_error() + * \return none. + */ +void GLAPIENTRY +_mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, + GLenum internalformat, + GLuint minlevel, GLuint numlevels, + GLuint minlayer, GLuint numlayers) +{ + struct gl_texture_object *texObj; + struct gl_texture_object *origTexObj; + struct gl_texture_image *origTexImage; + GLuint newViewMinLevel, newViewMinLayer; + GLuint newViewNumLevels, newViewNumLayers; + GLsizei width, height, depth; + gl_format texFormat; + GLboolean sizeOK, dimensionsOK; + GLenum faceTarget; + + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTextureView %d %s %d %s %d %d %d %d\n", + texture, _mesa_lookup_enum_by_nr(target), origtexture, + _mesa_lookup_enum_by_nr(internalformat), + minlevel, numlevels, minlayer, numlayers); + + if (origtexture == 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(origtexture = %u)", origtexture); + return; + } + + /* Need original texture information to validate arguments */ + origTexObj = _mesa_lookup_texture(ctx, origtexture); + + /* If <origtexture> is not the name of a texture, INVALID_VALUE is generated. */ + if (!origTexObj) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(origtexture = %u)", origtexture); + return; + } + + /* If <origtexture>'s TEXTURE_IMMUTABLE_FORMAT value is not TRUE, + * INVALID_OPERATION is generated. + */ + if (!origTexObj->Immutable) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(origtexture not immutable)"); + return; + } + + /* If <texture> is 0, INVALID_VALUE is generated. */ + if (texture == 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(texture = 0)"); + return; + } + + /* If <texture> is not a valid name returned by GenTextures, + * the error INVALID_OPERATION is generated. + */ + texObj = _mesa_lookup_texture(ctx, texture); + if (texObj == NULL) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(texture = %u non-gen name)", texture); + return; + } + + /* If <texture> has already been bound and given a target, then + * the error INVALID_OPERATION is generated. + */ + if (texObj->Target) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(texture = %u already bound)", texture); + return; + } + + /* Check for compatible target */ + if (!target_valid(ctx, origTexObj->Target, target)) { + return; /* error was recorded */ + } + + /* minlevel and minlayer are relative to the view of origtexture + * If minlevel or minlayer is greater than level or layer, respectively, + * of origtexture return INVALID_VALUE. + */ + newViewMinLevel = origTexObj->MinLevel + minlevel; + newViewMinLayer = origTexObj->MinLayer + minlayer; + if (newViewMinLevel >= (origTexObj->MinLevel + origTexObj->NumLevels)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTextureView(new minlevel (%d) > orig minlevel (%d) + orig numlevels (%d))", + newViewMinLevel, origTexObj->MinLevel, origTexObj->NumLevels); + return; + } + + if (newViewMinLayer >= (origTexObj->MinLayer + origTexObj->NumLayers)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTextureView(new minlayer (%d) > orig minlayer (%d) + orig numlayers (%d))", + newViewMinLayer, origTexObj->MinLayer, origTexObj->NumLayers); + return; + } + + if (!compatible_format(ctx, origTexObj, internalformat)) { + return; /* Error logged */ + } + + texFormat = _mesa_choose_texture_format(ctx, texObj, target, 0, + internalformat, GL_NONE, GL_NONE); + assert(texFormat != MESA_FORMAT_NONE); + if (texFormat == MESA_FORMAT_NONE) return; + + newViewNumLevels = MIN2(numlevels, origTexObj->NumLevels - minlevel); + newViewNumLayers = MIN2(numlayers, origTexObj->NumLayers - minlayer); + + faceTarget = origTexObj->Target; + if (faceTarget == GL_TEXTURE_CUBE_MAP) + faceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + minlayer; + + /* Get a reference to what will become this View's base level */ + origTexImage = _mesa_select_tex_image(ctx, origTexObj, + faceTarget, minlevel); + width = origTexImage->Width; + height = origTexImage->Height; + depth = origTexImage->Depth; + + /* Adjust width, height, depth to be appropriate for new target */ + switch (target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_3D: + break; + + case GL_TEXTURE_1D_ARRAY: + height = (GLsizei) newViewNumLayers; + break; + + case GL_TEXTURE_2D: + case GL_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_RECTANGLE: + case GL_TEXTURE_CUBE_MAP: + depth = 1; + break; + + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + depth = newViewNumLayers; + break; + } + + /* If the dimensions of the original texture are larger than the maximum + * supported dimensions of the new target, the error INVALID_OPERATION is + * generated. For example, if the original texture has a TEXTURE_2D_ARRAY + * target and its width is greater than MAX_CUBE_MAP_TEXTURE_SIZE, an error + * will be generated if TextureView is called to create a TEXTURE_CUBE_MAP + * view. + */ + dimensionsOK = _mesa_legal_texture_dimensions(ctx, target, 0, + width, height, depth, 0); + if (!dimensionsOK) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(invalid width or height or depth)"); + return; + } + + sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 0, texFormat, + width, height, depth, 0); + if (!sizeOK) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(invalid texture size)"); + return; + } + + /* If <target> is TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_RECTANGLE, + * or TEXTURE_2D_MULTISAMPLE and <numlayers> does not equal 1, the error + * INVALID_VALUE is generated. + */ + switch (target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_RECTANGLE: + case GL_TEXTURE_2D_MULTISAMPLE: + if (numlayers != 1) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(numlayers %d != 1)", numlayers); + return; + } + break; + + case GL_TEXTURE_CUBE_MAP: + /* If the new texture's target is TEXTURE_CUBE_MAP, the clamped <numlayers> + * must be equal to 6. + */ + if (newViewNumLayers != 6) { + _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(clamped numlayers %d != 6)", + newViewNumLayers); + return; + } + break; + + case GL_TEXTURE_CUBE_MAP_ARRAY: + /* If the new texture's target is TEXTURE_CUBE_MAP_ARRAY, + * then <numlayers> counts layer-faces rather than layers, + * and the clamped <numlayers> must be a multiple of 6. + * Otherwise, the error INVALID_VALUE is generated. + */ + if ((newViewNumLayers % 6) != 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glTextureView(clamped numlayers %d is not a multiple of 6)", + newViewNumLayers); + return; + } + break; + } + + /* If the new texture's target is TEXTURE_CUBE_MAP or + * TEXTURE_CUBE_MAP_ARRAY, the width and height of the original texture's + * levels must be equal otherwise the error INVALID_OPERATION is generated. + */ + if ((target == GL_TEXTURE_CUBE_MAP || target == GL_TEXTURE_CUBE_MAP_ARRAY) && + (origTexImage->Width != origTexImage->Height)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(origtexture width (%d) != height (%d))", + origTexImage->Width, origTexImage->Height); + return; + } + + /* When the original texture's target is TEXTURE_CUBE_MAP, the layer + * parameters are interpreted in the same order as if it were a + * TEXTURE_CUBE_MAP_ARRAY with 6 layer-faces. + */ + + /* If the internal format does not exactly match the internal format of the + * original texture, the contents of the memory are reinterpreted in the + * same manner as for image bindings described in + * section 3.9.20 (Texture Image Loads and Stores). + */ + + /* TEXTURE_BASE_LEVEL and TEXTURE_MAX_LEVEL are interpreted + * relative to the view and not relative to the original data store. + */ + + if (!initialize_texture_fields(ctx, target, texObj, newViewNumLevels, + width, height, depth, + internalformat, texFormat)) { + return; /* Already recorded error */ + } + + texObj->MinLevel = newViewMinLevel; + texObj->MinLayer = newViewMinLayer; + texObj->NumLevels = newViewNumLevels; + texObj->NumLayers = newViewNumLayers; + texObj->Immutable = GL_TRUE; + texObj->ImmutableLevels = origTexObj->ImmutableLevels; + texObj->Target = target; + + if (ctx->Driver.TextureView != NULL && !ctx->Driver.TextureView(ctx, texObj, origTexObj)) { + return; /* driver recorded error */ + } +} diff --git a/xorg-server/glx/glxstubs.c b/mesalib/src/mesa/main/textureview.h index 69bc00480..3088ac193 100644 --- a/xorg-server/glx/glxstubs.c +++ b/mesalib/src/mesa/main/textureview.h @@ -1,5 +1,7 @@ /* - * Copyright © 2013 Red Hat, Inc. + * Mesa 3-D graphics library + * + * Copyright (C) 2012-2013 LunarG, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -8,9 +10,8 @@ * 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 (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. + * 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, @@ -21,30 +22,22 @@ * DEALINGS IN THE SOFTWARE. * * Authors: - * Adam Jackson <ajax@redhat.com> + * Courtney Goeltzenleuchter <courtney@lunarg.com> */ -/* - * Redirection stubs for things that we call by name but that aren't exported - * from libGL by name. Strictly speaking this list should be a lot longer, - * but this is enough to get us linking against contemporary Mesa. - */ -#include <inttypes.h> -#include "glxserver.h" +#ifndef TEXTUREVIEW_H +#define TEXTUREVIEW_H -#define thunk(name, type, call_args, ...) \ - _X_HIDDEN void name(__VA_ARGS__) { \ - static type proc; \ - if (!proc) proc = __glGetProcAddress(#name); \ - proc call_args; \ - } -thunk(glSampleMaskSGIS, PFNGLSAMPLEMASKSGISPROC, - (value, invert), GLclampf value, GLboolean invert) +extern void GLAPIENTRY +_mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, + GLenum internalformat, + GLuint minlevel, GLuint numlevels, + GLuint minlayer, GLuint numlayers); -thunk(glSamplePatternSGIS, PFNGLSAMPLEPATTERNSGISPROC, - (pattern), GLenum pattern) +extern void +_mesa_set_texture_view_state(struct gl_context *ctx, struct gl_texture_object *texObj, + GLenum target, GLuint levels); -thunk(glActiveStencilFaceEXT, PFNGLACTIVESTENCILFACEEXTPROC, - (face), GLenum face) +#endif /* TEXTUREVIEW_H */ diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c index 55411faf8..00eeca764 100644 --- a/mesalib/src/mesa/main/version.c +++ b/mesalib/src/mesa/main/version.c @@ -224,7 +224,6 @@ compute_version(struct gl_context *ctx) (ctx->Extensions.EXT_stencil_two_side || ctx->Extensions.ATI_separate_stencil)); const GLboolean ver_2_1 = (ver_2_0 && - ctx->Const.GLSLVersion >= 120 && ctx->Extensions.EXT_pixel_buffer_object && ctx->Extensions.EXT_texture_sRGB); const GLboolean ver_3_0 = (ver_2_1 && diff --git a/mesalib/src/mesa/math/m_matrix.c b/mesalib/src/mesa/math/m_matrix.c index 290231527..274f969d2 100644 --- a/mesalib/src/mesa/math/m_matrix.c +++ b/mesalib/src/mesa/math/m_matrix.c @@ -1488,14 +1488,11 @@ _math_matrix_ctr( GLmatrix *m ) void _math_matrix_dtr( GLmatrix *m ) { - if (m->m) { - _mesa_align_free( m->m ); - m->m = NULL; - } - if (m->inv) { - _mesa_align_free( m->inv ); - m->inv = NULL; - } + _mesa_align_free( m->m ); + m->m = NULL; + + _mesa_align_free( m->inv ); + m->inv = NULL; } /*@}*/ diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index c833a12f2..23d479c32 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -681,11 +681,11 @@ ir_to_mesa_visitor::visit(ir_variable *ir) if (strcmp(ir->name, "gl_FragCoord") == 0) { struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; - fp->OriginUpperLeft = ir->origin_upper_left; - fp->PixelCenterInteger = ir->pixel_center_integer; + fp->OriginUpperLeft = ir->data.origin_upper_left; + fp->PixelCenterInteger = ir->data.pixel_center_integer; } - if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { + if (ir->data.mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { unsigned int i; const ir_state_slot *const slots = ir->state_slots; assert(ir->state_slots != NULL); @@ -759,49 +759,10 @@ ir_to_mesa_visitor::visit(ir_variable *ir) void ir_to_mesa_visitor::visit(ir_loop *ir) { - ir_dereference_variable *counter = NULL; - - if (ir->counter != NULL) - counter = new(mem_ctx) ir_dereference_variable(ir->counter); - - if (ir->from != NULL) { - assert(ir->counter != NULL); - - ir_assignment *a = - new(mem_ctx) ir_assignment(counter, ir->from, NULL); - - a->accept(this); - } - emit(NULL, OPCODE_BGNLOOP); - if (ir->to) { - ir_expression *e = - new(mem_ctx) ir_expression(ir->cmp, glsl_type::bool_type, - counter, ir->to); - ir_if *if_stmt = new(mem_ctx) ir_if(e); - - ir_loop_jump *brk = - new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_break); - - if_stmt->then_instructions.push_tail(brk); - - if_stmt->accept(this); - } - visit_exec_list(&ir->body_instructions, this); - if (ir->increment) { - ir_expression *e = - new(mem_ctx) ir_expression(ir_binop_add, counter->type, - counter, ir->increment); - - ir_assignment *a = - new(mem_ctx) ir_assignment(counter, e, NULL); - - a->accept(this); - } - emit(NULL, OPCODE_ENDLOOP); } @@ -1567,10 +1528,10 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->var; if (!entry) { - switch (var->mode) { + switch (var->data.mode) { case ir_var_uniform: entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM, - var->location); + var->data.location); this->variables.push_tail(entry); break; case ir_var_shader_in: @@ -1579,21 +1540,21 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir) * user-assigned generic attributes (glBindVertexLocation), * and user-defined varyings. */ - assert(var->location != -1); + assert(var->data.location != -1); entry = new(mem_ctx) variable_storage(var, PROGRAM_INPUT, - var->location); + var->data.location); break; case ir_var_shader_out: - assert(var->location != -1); + assert(var->data.location != -1); entry = new(mem_ctx) variable_storage(var, PROGRAM_OUTPUT, - var->location); + var->data.location); break; case ir_var_system_value: entry = new(mem_ctx) variable_storage(var, PROGRAM_SYSTEM_VALUE, - var->location); + var->data.location); break; case ir_var_auto: case ir_var_temporary: @@ -2443,7 +2404,7 @@ public: this->idx = -1; this->program_resource_visitor::process(var); - var->location = this->idx; + var->data.location = this->idx; } private: @@ -2538,7 +2499,7 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program foreach_list(node, sh->ir) { ir_variable *var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform) + if ((var == NULL) || (var->data.mode != ir_var_uniform) || var->is_in_uniform_block() || (strncmp(var->name, "gl_", 3) == 0)) continue; diff --git a/mesalib/src/mesa/program/prog_parameter.c b/mesalib/src/mesa/program/prog_parameter.c index 4d9cf08d2..54531d255 100644 --- a/mesalib/src/mesa/program/prog_parameter.c +++ b/mesalib/src/mesa/program/prog_parameter.c @@ -83,8 +83,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) free((void *)paramList->Parameters[i].Name); } free(paramList->Parameters); - if (paramList->ParameterValues) - _mesa_align_free(paramList->ParameterValues); + _mesa_align_free(paramList->ParameterValues); free(paramList); } diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c index 01f8c6f11..cdf1c03fa 100644 --- a/mesalib/src/mesa/program/program.c +++ b/mesalib/src/mesa/program/program.c @@ -1049,6 +1049,14 @@ _mesa_get_min_invocations_per_fragment(struct gl_context *ctx, * has no effect." */ if (ctx->Multisample.Enabled) { + /* The ARB_gpu_shader5 specification says: + * + * "Use of the "sample" qualifier on a fragment shader input + * forces per-sample shading" + */ + if (prog->IsSample) + return MAX2(ctx->DrawBuffer->Visual.samples, 1); + if (prog->Base.SystemValuesRead & (SYSTEM_BIT_SAMPLE_ID | SYSTEM_BIT_SAMPLE_POS)) return MAX2(ctx->DrawBuffer->Visual.samples, 1); diff --git a/mesalib/src/mesa/program/program_parse_extra.c b/mesalib/src/mesa/program/program_parse_extra.c index e8e1912eb..a9e364045 100644 --- a/mesalib/src/mesa/program/program_parse_extra.c +++ b/mesalib/src/mesa/program/program_parse_extra.c @@ -256,15 +256,6 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 1; } } - } else if (strncmp(option, "MESA_", 5) == 0) { - option += 5; - - if (strcmp(option, "texture_array") == 0) { - if (state->ctx->Extensions.MESA_texture_array) { - state->option.TexArray = 1; - return 1; - } - } } return 0; diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index c752640f4..51f079cda 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c @@ -44,56 +44,6 @@ /** - * When doing GL render to texture, we have to be sure that finalize_texture() - * didn't yank out the pipe_resource that we earlier created a surface for. - * Check for that here and create a new surface if needed. - */ -static void -update_renderbuffer_surface(struct st_context *st, - struct st_renderbuffer *strb) -{ - struct pipe_context *pipe = st->pipe; - struct pipe_resource *resource = strb->rtt ? strb->rtt->pt : strb->texture; - int rtt_width = strb->Base.Width; - int rtt_height = strb->Base.Height; - enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : util_format_linear(resource->format); - - if (!strb->surface || - strb->surface->texture->nr_samples != strb->Base.NumSamples || - strb->surface->format != format || - strb->surface->texture != resource || - strb->surface->width != rtt_width || - strb->surface->height != rtt_height) { - GLuint level; - /* find matching mipmap level size */ - for (level = 0; level <= resource->last_level; level++) { - if (u_minify(resource->width0, level) == rtt_width && - u_minify(resource->height0, level) == rtt_height) { - struct pipe_surface surf_tmpl; - memset(&surf_tmpl, 0, sizeof(surf_tmpl)); - surf_tmpl.format = format; - surf_tmpl.u.tex.level = level; - surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice; - surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice; - - pipe_surface_reference(&strb->surface, NULL); - - strb->surface = pipe->create_surface(pipe, - resource, - &surf_tmpl); -#if 0 - printf("-- alloc new surface %d x %d into tex %p\n", - strb->surface->width, strb->surface->height, - texture); -#endif - break; - } - } - } -} - - -/** * Update framebuffer state (color, depth, stencil, etc. buffers) */ static void @@ -121,10 +71,10 @@ update_framebuffer_state( struct st_context *st ) if (strb) { /*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/ - if (strb->rtt || + if (strb->is_rtt || (strb->texture && util_format_is_srgb(strb->texture->format))) { /* rendering to a GL texture, may have to update surface */ - update_renderbuffer_surface(st, strb); + st_update_renderbuffer_surface(st, strb); } if (strb->surface) { @@ -144,9 +94,9 @@ update_framebuffer_state( struct st_context *st ) */ strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer); if (strb) { - if (strb->rtt) { + if (strb->is_rtt) { /* rendering to a GL texture, may have to update surface */ - update_renderbuffer_surface(st, strb); + st_update_renderbuffer_surface(st, strb); } pipe_surface_reference(&framebuffer->zsbuf, strb->surface); } diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c index 302e12981..57670ce25 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c +++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c @@ -130,15 +130,20 @@ convert_sampler(struct st_context *st, struct pipe_sampler_state *sampler, GLuint texUnit) { - struct gl_texture_object *texobj; + const struct gl_texture_object *texobj; struct gl_context *ctx = st->ctx; struct gl_sampler_object *msamp; + const struct gl_texture_image *teximg; + GLenum texBaseFormat; texobj = ctx->Texture.Unit[texUnit]._Current; if (!texobj) { texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX); } + teximg = texobj->Image[0][texobj->BaseLevel]; + texBaseFormat = teximg ? teximg->_BaseFormat : GL_RGBA; + msamp = _mesa_get_samplerobj(ctx, texUnit); memset(sampler, 0, sizeof(*sampler)); @@ -170,21 +175,15 @@ convert_sampler(struct st_context *st, assert(sampler->min_lod <= sampler->max_lod); } + /* For non-black borders... */ if (msamp->BorderColor.ui[0] || msamp->BorderColor.ui[1] || msamp->BorderColor.ui[2] || msamp->BorderColor.ui[3]) { - struct st_texture_object *stobj = st_texture_object(texobj); - struct gl_texture_image *teximg; - GLboolean is_integer = GL_FALSE; + const struct st_texture_object *stobj = st_texture_object_const(texobj); + const GLboolean is_integer = texobj->_IsIntegerFormat; union pipe_color_union border_color; - teximg = texobj->Image[0][texobj->BaseLevel]; - - if (teximg) { - is_integer = _mesa_is_enum_format_integer(teximg->InternalFormat); - } - if (st->apply_texture_swizzle_to_border_color && stobj->sampler_view) { const unsigned char swz[4] = { @@ -196,25 +195,26 @@ convert_sampler(struct st_context *st, st_translate_color(&msamp->BorderColor, &border_color, - teximg ? teximg->_BaseFormat : GL_RGBA, is_integer); + texBaseFormat, is_integer); util_format_apply_color_swizzle(&sampler->border_color, &border_color, swz, is_integer); } else { st_translate_color(&msamp->BorderColor, &sampler->border_color, - teximg ? teximg->_BaseFormat : GL_RGBA, is_integer); + texBaseFormat, is_integer); } } sampler->max_anisotropy = (msamp->MaxAnisotropy == 1.0 ? 0 : (GLuint) msamp->MaxAnisotropy); - /* only care about ARB_shadow, not SGI shadow */ - if (msamp->CompareMode == GL_COMPARE_R_TO_TEXTURE) { + /* If sampling a depth texture and using shadow comparison */ + if ((texBaseFormat == GL_DEPTH_COMPONENT || + texBaseFormat == GL_DEPTH_STENCIL) && + msamp->CompareMode == GL_COMPARE_R_TO_TEXTURE) { sampler->compare_mode = PIPE_TEX_COMPARE_R_TO_TEXTURE; - sampler->compare_func - = st_compare_func_to_pipe(msamp->CompareFunc); + sampler->compare_func = st_compare_func_to_pipe(msamp->CompareFunc); } sampler->seamless_cube_map = diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c index 7fa4cbdc4..230ab5449 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -422,6 +422,9 @@ st_bufferobj_validate_usage(struct st_context *st, void st_init_bufferobject_functions(struct dd_function_table *functions) { + /* plug in default driver fallbacks (such as for ClearBufferSubData) */ + _mesa_init_buffer_object_functions(functions); + functions->NewBufferObject = st_bufferobj_alloc; functions->DeleteBuffer = st_bufferobj_free; functions->BufferData = st_bufferobj_data; diff --git a/mesalib/src/mesa/state_tracker/st_cb_clear.c b/mesalib/src/mesa/state_tracker/st_cb_clear.c index 8da664afb..887e58bd9 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_clear.c +++ b/mesalib/src/mesa/state_tracker/st_cb_clear.c @@ -51,6 +51,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "util/u_format.h" +#include "util/u_framebuffer.h" #include "util/u_inlines.h" #include "util/u_simple_shaders.h" #include "util/u_draw_quad.h" @@ -129,6 +130,26 @@ set_vertex_shader(struct st_context *st) } +static void +set_vertex_shader_layered(struct st_context *st) +{ + struct pipe_context *pipe = st->pipe; + + if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_INSTANCEID) || + !pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_VS_LAYER)) { + assert(!"Got layered clear, but the VS layer output is unsupported"); + set_vertex_shader(st); + return; + } + + if (!st->clear.vs_layered) { + st->clear.vs_layered = util_make_layered_clear_vertex_shader(pipe); + } + + cso_set_vertex_shader_handle(st->cso_context, st->clear.vs_layered); +} + + /** * Draw a screen-aligned quadrilateral. * Coords are clip coords with y=0=bottom. @@ -136,15 +157,19 @@ set_vertex_shader(struct st_context *st) static void draw_quad(struct st_context *st, float x0, float y0, float x1, float y1, GLfloat z, + unsigned num_instances, const union pipe_color_union *color) { - struct pipe_context *pipe = st->pipe; - struct pipe_resource *vbuf = NULL; - GLuint i, offset; + struct cso_context *cso = st->cso_context; + struct pipe_vertex_buffer vb = {0}; + GLuint i; float (*vertices)[2][4]; /**< vertex pos + color */ + vb.stride = 8 * sizeof(float); + if (u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]), - &offset, &vbuf, (void **) &vertices) != PIPE_OK) { + &vb.buffer_offset, &vb.buffer, + (void **) &vertices) != PIPE_OK) { return; } @@ -174,16 +199,10 @@ draw_quad(struct st_context *st, u_upload_unmap(st->uploader); /* draw */ - util_draw_vertex_buffer(pipe, - st->cso_context, - vbuf, - cso_get_aux_vertex_buffer_slot(st->cso_context), - offset, - PIPE_PRIM_TRIANGLE_FAN, - 4, /* verts */ - 2); /* attribs/vert */ - - pipe_resource_reference(&vbuf, NULL); + cso_set_vertex_buffers(cso, cso_get_aux_vertex_buffer_slot(cso), 1, &vb); + cso_draw_arrays_instanced(cso, PIPE_PRIM_TRIANGLE_FAN, 0, 4, + 0, num_instances); + pipe_resource_reference(&vb.buffer, NULL); } @@ -194,8 +213,7 @@ draw_quad(struct st_context *st, * ctx->DrawBuffer->_X/Ymin/max fields. */ static void -clear_with_quad(struct gl_context *ctx, - GLboolean color, GLboolean depth, GLboolean stencil) +clear_with_quad(struct gl_context *ctx, unsigned clear_buffers) { struct st_context *st = st_context(ctx); const struct gl_framebuffer *fb = ctx->DrawBuffer; @@ -205,7 +223,8 @@ clear_with_quad(struct gl_context *ctx, const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f; const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f; const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 1.0f; - union pipe_color_union clearColor; + unsigned num_layers = + util_framebuffer_get_num_layers(&st->state.framebuffer); /* printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, @@ -233,7 +252,7 @@ clear_with_quad(struct gl_context *ctx, { struct pipe_blend_state blend; memset(&blend, 0, sizeof(blend)); - if (color) { + if (clear_buffers & PIPE_CLEAR_COLOR) { int num_buffers = ctx->Extensions.EXT_draw_buffers2 ? ctx->DrawBuffer->_NumColorDrawBuffers : 1; int i; @@ -241,6 +260,9 @@ clear_with_quad(struct gl_context *ctx, blend.independent_blend_enable = num_buffers > 1; for (i = 0; i < num_buffers; i++) { + if (!(clear_buffers & (PIPE_CLEAR_COLOR0 << i))) + continue; + if (ctx->Color.ColorMask[i][0]) blend.rt[i].colormask |= PIPE_MASK_R; if (ctx->Color.ColorMask[i][1]) @@ -261,13 +283,13 @@ clear_with_quad(struct gl_context *ctx, { struct pipe_depth_stencil_alpha_state depth_stencil; memset(&depth_stencil, 0, sizeof(depth_stencil)); - if (depth) { + if (clear_buffers & PIPE_CLEAR_DEPTH) { depth_stencil.depth.enabled = 1; depth_stencil.depth.writemask = 1; depth_stencil.depth.func = PIPE_FUNC_ALWAYS; } - if (stencil) { + if (clear_buffers & PIPE_CLEAR_STENCIL) { struct pipe_stencil_ref stencil_ref; memset(&stencil_ref, 0, sizeof(stencil_ref)); depth_stencil.stencil[0].enabled = 1; @@ -305,21 +327,20 @@ clear_with_quad(struct gl_context *ctx, } set_fragment_shader(st); - set_vertex_shader(st); cso_set_geometry_shader_handle(st->cso_context, NULL); - if (ctx->DrawBuffer->_ColorDrawBuffers[0]) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - GLboolean is_integer = _mesa_is_enum_format_integer(rb->InternalFormat); + if (num_layers > 1) + set_vertex_shader_layered(st); + else + set_vertex_shader(st); - st_translate_color(&ctx->Color.ClearColor, - &clearColor, - ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat, - is_integer); - } + /* We can't translate the clear color to the colorbuffer format, + * because different colorbuffers may have different formats. + */ /* draw quad matching scissor rect */ - draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, &clearColor); + draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, num_layers, + (union pipe_color_union*)&ctx->Color.ClearColor); /* Restore pipe state */ cso_restore_blend(st->cso_context); @@ -352,6 +373,19 @@ is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb) /** + * Return if all of the color channels are masked. + */ +static INLINE GLboolean +is_color_disabled(struct gl_context *ctx, int i) +{ + return !ctx->Color.ColorMask[i][0] && + !ctx->Color.ColorMask[i][1] && + !ctx->Color.ColorMask[i][2] && + !ctx->Color.ColorMask[i][3]; +} + + +/** * Return if any of the color channels are masked. */ static INLINE GLboolean @@ -408,11 +442,14 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) if (!strb || !strb->surface) continue; + if (is_color_disabled(ctx, colormask_index)) + continue; + if (is_scissor_enabled(ctx, rb) || is_color_masked(ctx, colormask_index)) - quad_buffers |= PIPE_CLEAR_COLOR; + quad_buffers |= PIPE_CLEAR_COLOR0 << i; else - clear_buffers |= PIPE_CLEAR_COLOR; + clear_buffers |= PIPE_CLEAR_COLOR0 << i; } } } @@ -445,24 +482,13 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) */ if (quad_buffers) { quad_buffers |= clear_buffers; - clear_with_quad(ctx, - quad_buffers & PIPE_CLEAR_COLOR, - quad_buffers & PIPE_CLEAR_DEPTH, - quad_buffers & PIPE_CLEAR_STENCIL); + clear_with_quad(ctx, quad_buffers); } else if (clear_buffers) { - union pipe_color_union clearColor; - - if (ctx->DrawBuffer->_ColorDrawBuffers[0]) { - struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - GLboolean is_integer = _mesa_is_enum_format_integer(rb->InternalFormat); - - st_translate_color(&ctx->Color.ClearColor, - &clearColor, - ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat, - is_integer); - } - - st->pipe->clear(st->pipe, clear_buffers, &clearColor, + /* We can't translate the clear color to the colorbuffer format, + * because different colorbuffers may have different formats. + */ + st->pipe->clear(st->pipe, clear_buffers, + (union pipe_color_union*)&ctx->Color.ClearColor, ctx->Depth.Clear, ctx->Stencil.Clear); } if (mask & BUFFER_BIT_ACCUM) diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index 2ce4728ad..3058dfb5b 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -878,7 +878,8 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, } stmap = pipe_transfer_map(pipe, strb->texture, - strb->rtt_level, strb->rtt_face + strb->rtt_slice, + strb->surface->u.tex.level, + strb->surface->u.tex.first_layer, usage, x, y, width, height, &pt); @@ -1263,8 +1264,8 @@ copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* map the stencil buffer */ drawMap = pipe_transfer_map(pipe, rbDraw->texture, - rbDraw->rtt_level, - rbDraw->rtt_face + rbDraw->rtt_slice, + rbDraw->surface->u.tex.level, + rbDraw->surface->u.tex.first_layer, usage, dstx, dsty, width, height, &ptDraw); @@ -1422,20 +1423,20 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, memset(&blit, 0, sizeof(blit)); blit.src.resource = rbRead->texture; - blit.src.level = rbRead->rtt_level; + blit.src.level = rbRead->surface->u.tex.level; blit.src.format = rbRead->texture->format; blit.src.box.x = readX; blit.src.box.y = readY; - blit.src.box.z = rbRead->rtt_face + rbRead->rtt_slice; + blit.src.box.z = rbRead->surface->u.tex.first_layer; blit.src.box.width = readW; blit.src.box.height = readH; blit.src.box.depth = 1; blit.dst.resource = rbDraw->texture; - blit.dst.level = rbDraw->rtt_level; + blit.dst.level = rbDraw->surface->u.tex.level; blit.dst.format = rbDraw->texture->format; blit.dst.box.x = drawX; blit.dst.box.y = drawY; - blit.dst.box.z = rbDraw->rtt_face + rbDraw->rtt_slice; + blit.dst.box.z = rbDraw->surface->u.tex.first_layer; blit.dst.box.width = drawW; blit.dst.box.height = drawH; blit.dst.box.depth = 1; @@ -1633,11 +1634,11 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, memset(&blit, 0, sizeof(blit)); blit.src.resource = rbRead->texture; - blit.src.level = rbRead->rtt_level; + blit.src.level = rbRead->surface->u.tex.level; blit.src.format = rbRead->texture->format; blit.src.box.x = readX; blit.src.box.y = readY; - blit.src.box.z = rbRead->rtt_face + rbRead->rtt_slice; + blit.src.box.z = rbRead->surface->u.tex.first_layer; blit.src.box.width = readW; blit.src.box.height = readH; blit.src.box.depth = 1; diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 20894825f..70baa9965 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -389,6 +389,72 @@ st_bind_framebuffer(struct gl_context *ctx, GLenum target, /** + * Create or update the pipe_surface of a FBO renderbuffer. + * This is usually called after st_finalize_texture. + */ +void +st_update_renderbuffer_surface(struct st_context *st, + struct st_renderbuffer *strb) +{ + struct pipe_context *pipe = st->pipe; + struct pipe_resource *resource = strb->texture; + int rtt_width = strb->Base.Width; + int rtt_height = strb->Base.Height; + int rtt_depth = strb->Base.Depth; + enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : + util_format_linear(resource->format); + unsigned first_layer, last_layer, level; + + if (resource->target == PIPE_TEXTURE_1D_ARRAY) { + rtt_depth = rtt_height; + rtt_height = 1; + } + + /* find matching mipmap level size */ + for (level = 0; level <= resource->last_level; level++) { + if (u_minify(resource->width0, level) == rtt_width && + u_minify(resource->height0, level) == rtt_height && + (resource->target != PIPE_TEXTURE_3D || + u_minify(resource->depth0, level) == rtt_depth)) { + break; + } + } + assert(level <= resource->last_level); + + /* determine the layer bounds */ + if (strb->rtt_layered) { + first_layer = 0; + last_layer = util_max_layer(strb->texture, level); + } + else { + first_layer = + last_layer = strb->rtt_face + strb->rtt_slice; + } + + if (!strb->surface || + strb->surface->texture->nr_samples != strb->Base.NumSamples || + strb->surface->format != format || + strb->surface->texture != resource || + strb->surface->width != rtt_width || + strb->surface->height != rtt_height || + strb->surface->u.tex.level != level || + strb->surface->u.tex.first_layer != first_layer || + strb->surface->u.tex.last_layer != last_layer) { + /* create a new pipe_surface */ + struct pipe_surface surf_tmpl; + memset(&surf_tmpl, 0, sizeof(surf_tmpl)); + surf_tmpl.format = format; + surf_tmpl.u.tex.level = level; + surf_tmpl.u.tex.first_layer = first_layer; + surf_tmpl.u.tex.last_layer = last_layer; + + pipe_surface_reference(&strb->surface, NULL); + + strb->surface = pipe->create_surface(pipe, resource, &surf_tmpl); + } +} + +/** * Called by ctx->Driver.RenderTexture */ static void @@ -401,8 +467,6 @@ st_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb = att->Renderbuffer; struct st_renderbuffer *strb = st_renderbuffer(rb); struct pipe_resource *pt; - struct st_texture_object *stObj; - struct pipe_surface surf_tmpl; if (!st_finalize_texture(ctx, pipe, att->Texture)) return; @@ -410,31 +474,16 @@ st_render_texture(struct gl_context *ctx, pt = st_get_texobj_resource(att->Texture); assert(pt); - /* get the texture for the texture object */ - stObj = st_texture_object(att->Texture); - /* point renderbuffer at texobject */ - strb->rtt = stObj; - strb->rtt_level = att->TextureLevel; + strb->is_rtt = TRUE; strb->rtt_face = att->CubeMapFace; strb->rtt_slice = att->Zoffset; - - pipe_resource_reference( &strb->texture, pt ); + strb->rtt_layered = att->Layered; + pipe_resource_reference(&strb->texture, pt); pipe_surface_release(pipe, &strb->surface); - assert(strb->rtt_level <= strb->texture->last_level); - - /* new surface for rendering into the texture */ - memset(&surf_tmpl, 0, sizeof(surf_tmpl)); - surf_tmpl.format = ctx->Color.sRGBEnabled - ? strb->texture->format : util_format_linear(strb->texture->format); - surf_tmpl.u.tex.level = strb->rtt_level; - surf_tmpl.u.tex.first_layer = strb->rtt_face + strb->rtt_slice; - surf_tmpl.u.tex.last_layer = strb->rtt_face + strb->rtt_slice; - strb->surface = pipe->create_surface(pipe, - strb->texture, - &surf_tmpl); + st_update_renderbuffer_surface(st, strb); strb->Base.Format = st_pipe_format_to_mesa_format(pt->format); @@ -464,7 +513,7 @@ st_finish_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb) if (!strb) return; - strb->rtt = NULL; + strb->is_rtt = FALSE; /* restore previous framebuffer state */ st_invalidate_state(ctx, _NEW_BUFFERS); @@ -706,8 +755,8 @@ st_MapRenderbuffer(struct gl_context *ctx, map = pipe_transfer_map(pipe, strb->texture, - strb->rtt_level, - strb->rtt_face + strb->rtt_slice, + strb->surface->u.tex.level, + strb->surface->u.tex.first_layer, usage, x, y2, w, h, &strb->transfer); if (map) { if (invert) { diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.h b/mesalib/src/mesa/state_tracker/st_cb_fbo.h index f335c371b..88fccc298 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.h +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.h @@ -58,8 +58,10 @@ struct st_renderbuffer boolean software; void *data; - struct st_texture_object *rtt; /**< GL render to texture's texture */ - unsigned rtt_level, rtt_face, rtt_slice; + /* Inputs from Driver.RenderTexture, don't use directly. */ + boolean is_rtt; /**< whether Driver.RenderTexture was called */ + unsigned rtt_face, rtt_slice; + boolean rtt_layered; /**< whether glFramebufferTexture was called */ }; @@ -74,6 +76,10 @@ extern struct gl_renderbuffer * st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw); extern void +st_update_renderbuffer_surface(struct st_context *st, + struct st_renderbuffer *strb); + +extern void st_init_fbo_functions(struct dd_function_table *functions); #endif /* ST_CB_FBO_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c b/mesalib/src/mesa/state_tracker/st_cb_readpixels.c index b5df58c03..7547dfd8b 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_readpixels.c @@ -166,7 +166,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, } blit.src.resource = src; - blit.src.level = strb->rtt_level; + blit.src.level = strb->surface->u.tex.level; blit.src.format = src_format; blit.dst.resource = dst; blit.dst.level = 0; @@ -175,7 +175,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, blit.dst.box.x = 0; blit.src.box.y = y; blit.dst.box.y = 0; - blit.src.box.z = strb->rtt_face + strb->rtt_slice; + blit.src.box.z = strb->surface->u.tex.first_layer; blit.dst.box.z = 0; blit.src.box.width = blit.dst.box.width = width; blit.src.box.height = blit.dst.box.height = height; diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index faa9ee3f6..c09f34e37 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -175,10 +175,8 @@ st_FreeTextureImageBuffer(struct gl_context *ctx, pipe_resource_reference(&stImage->pt, NULL); } - if (stImage->TexData) { - _mesa_align_free(stImage->TexData); - stImage->TexData = NULL; - } + _mesa_align_free(stImage->TexData); + stImage->TexData = NULL; } @@ -1156,8 +1154,8 @@ fallback_copy_texsubimage(struct gl_context *ctx, map = pipe_transfer_map(pipe, strb->texture, - strb->rtt_level, - strb->rtt_face + strb->rtt_slice, + strb->surface->u.tex.level, + strb->surface->u.tex.first_layer, PIPE_TRANSFER_READ, srcX, srcY, width, height, &src_trans); diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h index ab89b4947..cd0a5ae98 100644 --- a/mesalib/src/mesa/state_tracker/st_context.h +++ b/mesalib/src/mesa/state_tracker/st_context.h @@ -178,6 +178,7 @@ struct st_context struct pipe_viewport_state viewport; void *vs; void *fs; + void *vs_layered; } clear; /** used for anything using util_draw_vertex_buffer */ diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index cd10a0c9d..5e4a3b398 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -406,7 +406,6 @@ void st_init_extensions(struct st_context *st) { o(NV_texture_barrier), PIPE_CAP_TEXTURE_BARRIER }, /* GL_NV_point_sprite is not supported by gallium because we don't * support the GL_POINT_SPRITE_R_MODE_NV option. */ - { o(MESA_texture_array), PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS }, { o(OES_standard_derivatives), PIPE_CAP_SM3 }, { o(ARB_texture_cube_map_array), PIPE_CAP_CUBE_MAP_ARRAY }, @@ -444,11 +443,6 @@ void st_init_extensions(struct st_context *st) { { o(ARB_depth_buffer_float) }, { PIPE_FORMAT_Z32_FLOAT, PIPE_FORMAT_Z32_FLOAT_S8X24_UINT } }, - - { { o(EXT_packed_depth_stencil) }, - { PIPE_FORMAT_S8_UINT_Z24_UNORM, - PIPE_FORMAT_Z24_UNORM_S8_UINT }, - GL_TRUE }, /* at least one format must be supported */ }; /* Required: sampler support */ @@ -605,6 +599,13 @@ void st_init_extensions(struct st_context *st) ctx->Const.ForceGLSLVersion = st->options.force_glsl_version; } + /* This extension needs full OpenGL 3.2, but we don't know if that's + * supported at this point. Only check the GLSL version. */ + if (ctx->Const.GLSLVersion >= 150 && + screen->get_param(screen, PIPE_CAP_TGSI_VS_LAYER)) { + ctx->Extensions.AMD_vertex_shader_layer = GL_TRUE; + } + if (ctx->Const.GLSLVersion >= 130) { ctx->Const.NativeIntegers = GL_TRUE; ctx->Const.MaxClipPlanes = 8; @@ -758,8 +759,7 @@ void st_init_extensions(struct st_context *st) PIPE_BUFFER, PIPE_BIND_SAMPLER_VIEW); } - if (screen->get_param(screen, PIPE_CAP_MIXED_FRAMEBUFFER_SIZES) && - ctx->Extensions.EXT_packed_depth_stencil) { + if (screen->get_param(screen, PIPE_CAP_MIXED_FRAMEBUFFER_SIZES)) { ctx->Extensions.ARB_framebuffer_object = GL_TRUE; } diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index ec2552384..6acf98390 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -1854,12 +1854,12 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, * Similarly for texture border colors. */ void -st_translate_color(union gl_color_union *colorIn, +st_translate_color(const union gl_color_union *colorIn, union pipe_color_union *colorOut, GLenum baseFormat, GLboolean is_integer) { if (is_integer) { - int *in = colorIn->i; + const int *in = colorIn->i; int *out = colorOut->i; switch (baseFormat) { @@ -1901,7 +1901,7 @@ st_translate_color(union gl_color_union *colorIn, } } else { - float *in = colorIn->f; + const float *in = colorIn->f; float *out = colorOut->f; switch (baseFormat) { diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h index 6e97dcb96..3278748d0 100644 --- a/mesalib/src/mesa/state_tracker/st_format.h +++ b/mesalib/src/mesa/state_tracker/st_format.h @@ -73,7 +73,7 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, extern void -st_translate_color(union gl_color_union *colorIn, +st_translate_color(const union gl_color_union *colorIn, union pipe_color_union *colorOut, GLenum baseFormat, GLboolean is_integer); diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index ac95968d6..1331c73dc 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1056,11 +1056,11 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir) if (strcmp(ir->name, "gl_FragCoord") == 0) { struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; - fp->OriginUpperLeft = ir->origin_upper_left; - fp->PixelCenterInteger = ir->pixel_center_integer; + fp->OriginUpperLeft = ir->data.origin_upper_left; + fp->PixelCenterInteger = ir->data.pixel_center_integer; } - if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { + if (ir->data.mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { unsigned int i; const ir_state_slot *const slots = ir->state_slots; assert(ir->state_slots != NULL); @@ -1137,53 +1137,10 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir) void glsl_to_tgsi_visitor::visit(ir_loop *ir) { - ir_dereference_variable *counter = NULL; - - if (ir->counter != NULL) - counter = new(ir) ir_dereference_variable(ir->counter); - - if (ir->from != NULL) { - assert(ir->counter != NULL); - - ir_assignment *a = new(ir) ir_assignment(counter, ir->from, NULL); - - a->accept(this); - delete a; - } - emit(NULL, TGSI_OPCODE_BGNLOOP); - if (ir->to) { - ir_expression *e = - new(ir) ir_expression(ir->cmp, glsl_type::bool_type, - counter, ir->to); - ir_if *if_stmt = new(ir) ir_if(e); - - ir_loop_jump *brk = new(ir) ir_loop_jump(ir_loop_jump::jump_break); - - if_stmt->then_instructions.push_tail(brk); - - if_stmt->accept(this); - - delete if_stmt; - delete e; - delete brk; - } - visit_exec_list(&ir->body_instructions, this); - if (ir->increment) { - ir_expression *e = - new(ir) ir_expression(ir_binop_add, counter->type, - counter, ir->increment); - - ir_assignment *a = new(ir) ir_assignment(counter, e, NULL); - - a->accept(this); - delete a; - delete e; - } - emit(NULL, TGSI_OPCODE_ENDLOOP); } @@ -2063,10 +2020,10 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->var; if (!entry) { - switch (var->mode) { + switch (var->data.mode) { case ir_var_uniform: entry = new(mem_ctx) variable_storage(var, PROGRAM_UNIFORM, - var->location); + var->data.location); this->variables.push_tail(entry); break; case ir_var_shader_in: @@ -2075,21 +2032,22 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir) * generic attributes (glBindVertexLocation), and * user-defined varyings. */ - assert(var->location != -1); + assert(var->data.location != -1); entry = new(mem_ctx) variable_storage(var, PROGRAM_INPUT, - var->location); + var->data.location); break; case ir_var_shader_out: - assert(var->location != -1); + assert(var->data.location != -1); entry = new(mem_ctx) variable_storage(var, PROGRAM_OUTPUT, - var->location + var->index); + var->data.location + + var->data.index); break; case ir_var_system_value: entry = new(mem_ctx) variable_storage(var, PROGRAM_SYSTEM_VALUE, - var->location); + var->data.location); break; case ir_var_auto: case ir_var_temporary: @@ -2388,7 +2346,7 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir) assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector()); l.writemask = WRITEMASK_XYZW; } else if (ir->lhs->type->is_scalar() && - ir->lhs->variable_referenced()->mode == ir_var_shader_out) { + ir->lhs->variable_referenced()->data.mode == ir_var_shader_out) { /* FINISHME: This hack makes writing to gl_FragDepth, which lives in the * FINISHME: W component of fragment shader output zero, work correctly. */ @@ -2664,8 +2622,8 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) ir_rvalue *param_rval = (ir_rvalue *)iter.get(); ir_variable *param = (ir_variable *)sig_iter.get(); - if (param->mode == ir_var_function_in || - param->mode == ir_var_function_inout) { + if (param->data.mode == ir_var_function_in || + param->data.mode == ir_var_function_inout) { variable_storage *storage = find_variable_storage(param); assert(storage); @@ -2700,8 +2658,8 @@ glsl_to_tgsi_visitor::visit(ir_call *ir) ir_rvalue *param_rval = (ir_rvalue *)iter.get(); ir_variable *param = (ir_variable *)sig_iter.get(); - if (param->mode == ir_var_function_out || - param->mode == ir_var_function_inout) { + if (param->data.mode == ir_var_function_out || + param->data.mode == ir_var_function_inout) { variable_storage *storage = find_variable_storage(param); assert(storage); diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index f010e1889..f72122b4f 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -258,6 +258,10 @@ st_prepare_vertex_program(struct gl_context *ctx, stvp->output_semantic_name[slot] = TGSI_SEMANTIC_CLIPVERTEX; stvp->output_semantic_index[slot] = 0; break; + case VARYING_SLOT_LAYER: + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_LAYER; + stvp->output_semantic_index[slot] = 0; + break; case VARYING_SLOT_TEX0: case VARYING_SLOT_TEX1: @@ -563,6 +567,11 @@ st_translate_fragment_program(struct st_context *st, input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; break; + case VARYING_SLOT_PRIMITIVE_ID: + input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID; + input_semantic_index[slot] = 0; + interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; + break; case VARYING_SLOT_CLIP_DIST0: input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_index[slot] = 0; diff --git a/mesalib/src/mesa/state_tracker/st_texture.h b/mesalib/src/mesa/state_tracker/st_texture.h index c15aeaea6..ac93d9655 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.h +++ b/mesalib/src/mesa/state_tracker/st_texture.h @@ -112,6 +112,12 @@ st_texture_object(struct gl_texture_object *obj) return (struct st_texture_object *) obj; } +static INLINE const struct st_texture_object * +st_texture_object_const(const struct gl_texture_object *obj) +{ + return (const struct st_texture_object *) obj; +} + static INLINE struct pipe_resource * st_get_texobj_resource(struct gl_texture_object *texObj) diff --git a/mesalib/src/mesa/swrast/s_texture.c b/mesalib/src/mesa/swrast/s_texture.c index 27803c553..c08a4e9d1 100644 --- a/mesalib/src/mesa/swrast/s_texture.c +++ b/mesalib/src/mesa/swrast/s_texture.c @@ -164,10 +164,9 @@ _swrast_free_texture_image_buffer(struct gl_context *ctx, struct gl_texture_image *texImage) { struct swrast_texture_image *swImage = swrast_texture_image(texImage); - if (swImage->Buffer) { - _mesa_align_free(swImage->Buffer); - swImage->Buffer = NULL; - } + + _mesa_align_free(swImage->Buffer); + swImage->Buffer = NULL; free(swImage->ImageSlices); swImage->ImageSlices = NULL; diff --git a/mesalib/src/mesa/tnl/t_vertex.c b/mesalib/src/mesa/tnl/t_vertex.c index c7a745ed7..8c4195eed 100644 --- a/mesalib/src/mesa/tnl/t_vertex.c +++ b/mesalib/src/mesa/tnl/t_vertex.c @@ -546,10 +546,8 @@ void _tnl_free_vertices( struct gl_context *ctx ) struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); struct tnl_clipspace_fastpath *fp, *tmp; - if (vtx->vertex_buf) { - _mesa_align_free(vtx->vertex_buf); - vtx->vertex_buf = NULL; - } + _mesa_align_free(vtx->vertex_buf); + vtx->vertex_buf = NULL; for (fp = vtx->fastpath ; fp ; fp = tmp) { tmp = fp->next; diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c index c84d97f56..6feda1657 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_api.c +++ b/mesalib/src/mesa/vbo/vbo_exec_api.c @@ -990,11 +990,10 @@ void vbo_use_buffer_objects(struct gl_context *ctx) /* Make sure this func is only used once */ assert(exec->vtx.bufferobj == ctx->Shared->NullBufferObj); - if (exec->vtx.buffer_map) { - _mesa_align_free(exec->vtx.buffer_map); - exec->vtx.buffer_map = NULL; - exec->vtx.buffer_ptr = NULL; - } + + _mesa_align_free(exec->vtx.buffer_map); + exec->vtx.buffer_map = NULL; + exec->vtx.buffer_ptr = NULL; /* Allocate a real buffer object now */ _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL); diff --git a/mesalib/src/mesa/x86/rtasm/x86sse.c b/mesalib/src/mesa/x86/rtasm/x86sse.c deleted file mode 100644 index c93faba79..000000000 --- a/mesalib/src/mesa/x86/rtasm/x86sse.c +++ /dev/null @@ -1,1203 +0,0 @@ -#ifdef USE_X86_ASM -#if defined(__i386__) || defined(__386__) - -#include "main/imports.h" -#include "x86sse.h" - -#define DISASSEM 0 -#define X86_TWOB 0x0f - -#if 0 -static unsigned char *cptr( void (*label)() ) -{ - return (unsigned char *)(unsigned long)label; -} -#endif - - -static void do_realloc( struct x86_function *p ) -{ - if (p->size == 0) { - p->size = 1024; - p->store = _mesa_exec_malloc(p->size); - p->csr = p->store; - } - else { - unsigned used = p->csr - p->store; - unsigned char *tmp = p->store; - p->size *= 2; - p->store = _mesa_exec_malloc(p->size); - memcpy(p->store, tmp, used); - p->csr = p->store + used; - _mesa_exec_free(tmp); - } -} - -/* Emit bytes to the instruction stream: - */ -static unsigned char *reserve( struct x86_function *p, int bytes ) -{ - if (p->csr + bytes - p->store > p->size) - do_realloc(p); - - { - unsigned char *csr = p->csr; - p->csr += bytes; - return csr; - } -} - - - -static void emit_1b( struct x86_function *p, char b0 ) -{ - char *csr = (char *)reserve(p, 1); - *csr = b0; -} - -static void emit_1i( struct x86_function *p, int i0 ) -{ - int *icsr = (int *)reserve(p, sizeof(i0)); - *icsr = i0; -} - -static void emit_1ub( struct x86_function *p, unsigned char b0 ) -{ - unsigned char *csr = reserve(p, 1); - *csr++ = b0; -} - -static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) -{ - unsigned char *csr = reserve(p, 2); - *csr++ = b0; - *csr++ = b1; -} - -static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) -{ - unsigned char *csr = reserve(p, 3); - *csr++ = b0; - *csr++ = b1; - *csr++ = b2; -} - - -/* Build a modRM byte + possible displacement. No treatment of SIB - * indexing. BZZT - no way to encode an absolute address. - */ -static void emit_modrm( struct x86_function *p, - struct x86_reg reg, - struct x86_reg regmem ) -{ - unsigned char val = 0; - - assert(reg.mod == mod_REG); - - val |= regmem.mod << 6; /* mod field */ - val |= reg.idx << 3; /* reg field */ - val |= regmem.idx; /* r/m field */ - - emit_1ub(p, val); - - /* Oh-oh we've stumbled into the SIB thing. - */ - if (regmem.file == file_REG32 && - regmem.idx == reg_SP) { - emit_1ub(p, 0x24); /* simplistic! */ - } - - switch (regmem.mod) { - case mod_REG: - case mod_INDIRECT: - break; - case mod_DISP8: - emit_1b(p, regmem.disp); - break; - case mod_DISP32: - emit_1i(p, regmem.disp); - break; - default: - assert(0); - break; - } -} - - -static void emit_modrm_noreg( struct x86_function *p, - unsigned op, - struct x86_reg regmem ) -{ - struct x86_reg dummy = x86_make_reg(file_REG32, op); - emit_modrm(p, dummy, regmem); -} - -/* Many x86 instructions have two opcodes to cope with the situations - * where the destination is a register or memory reference - * respectively. This function selects the correct opcode based on - * the arguments presented. - */ -static void emit_op_modrm( struct x86_function *p, - unsigned char op_dst_is_reg, - unsigned char op_dst_is_mem, - struct x86_reg dst, - struct x86_reg src ) -{ - switch (dst.mod) { - case mod_REG: - emit_1ub(p, op_dst_is_reg); - emit_modrm(p, dst, src); - break; - case mod_INDIRECT: - case mod_DISP32: - case mod_DISP8: - assert(src.mod == mod_REG); - emit_1ub(p, op_dst_is_mem); - emit_modrm(p, src, dst); - break; - default: - assert(0); - break; - } -} - - - - - - - -/* Create and manipulate registers and regmem values: - */ -struct x86_reg x86_make_reg( enum x86_reg_file file, - enum x86_reg_name idx ) -{ - struct x86_reg reg; - - reg.file = file; - reg.idx = idx; - reg.mod = mod_REG; - reg.disp = 0; - - return reg; -} - -struct x86_reg x86_make_disp( struct x86_reg reg, - int disp ) -{ - assert(reg.file == file_REG32); - - if (reg.mod == mod_REG) - reg.disp = disp; - else - reg.disp += disp; - - if (reg.disp == 0) - reg.mod = mod_INDIRECT; - else if (reg.disp <= 127 && reg.disp >= -128) - reg.mod = mod_DISP8; - else - reg.mod = mod_DISP32; - - return reg; -} - -struct x86_reg x86_deref( struct x86_reg reg ) -{ - return x86_make_disp(reg, 0); -} - -struct x86_reg x86_get_base_reg( struct x86_reg reg ) -{ - return x86_make_reg( reg.file, reg.idx ); -} - -unsigned char *x86_get_label( struct x86_function *p ) -{ - return p->csr; -} - - - -/*********************************************************************** - * x86 instructions - */ - - -void x86_jcc( struct x86_function *p, - enum x86_cc cc, - unsigned char *label ) -{ - int offset = label - (x86_get_label(p) + 2); - - if (offset <= 127 && offset >= -128) { - emit_1ub(p, 0x70 + cc); - emit_1b(p, (char) offset); - } - else { - offset = label - (x86_get_label(p) + 6); - emit_2ub(p, 0x0f, 0x80 + cc); - emit_1i(p, offset); - } -} - -/* Always use a 32bit offset for forward jumps: - */ -unsigned char *x86_jcc_forward( struct x86_function *p, - enum x86_cc cc ) -{ - emit_2ub(p, 0x0f, 0x80 + cc); - emit_1i(p, 0); - return x86_get_label(p); -} - -unsigned char *x86_jmp_forward( struct x86_function *p) -{ - emit_1ub(p, 0xe9); - emit_1i(p, 0); - return x86_get_label(p); -} - -unsigned char *x86_call_forward( struct x86_function *p) -{ - emit_1ub(p, 0xe8); - emit_1i(p, 0); - return x86_get_label(p); -} - -/* Fixup offset from forward jump: - */ -void x86_fixup_fwd_jump( struct x86_function *p, - unsigned char *fixup ) -{ - *(int *)(fixup - 4) = x86_get_label(p) - fixup; -} - -void x86_jmp( struct x86_function *p, unsigned char *label) -{ - emit_1ub(p, 0xe9); - emit_1i(p, label - x86_get_label(p) - 4); -} - -#if 0 -/* This doesn't work once we start reallocating & copying the - * generated code on buffer fills, because the call is relative to the - * current pc. - */ -void x86_call( struct x86_function *p, void (*label)()) -{ - emit_1ub(p, 0xe8); - emit_1i(p, cptr(label) - x86_get_label(p) - 4); -} -#else -void x86_call( struct x86_function *p, struct x86_reg reg) -{ - emit_1ub(p, 0xff); - emit_modrm_noreg(p, 2, reg); -} -#endif - - -/* michal: - * Temporary. As I need immediate operands, and dont want to mess with the codegen, - * I load the immediate into general purpose register and use it. - */ -void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) -{ - assert(dst.mod == mod_REG); - emit_1ub(p, 0xb8 + dst.idx); - emit_1i(p, imm); -} - -void x86_push( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x50 + reg.idx); - p->stack_offset += 4; -} - -void x86_pop( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x58 + reg.idx); - p->stack_offset -= 4; -} - -void x86_inc( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x40 + reg.idx); -} - -void x86_dec( struct x86_function *p, - struct x86_reg reg ) -{ - assert(reg.mod == mod_REG); - emit_1ub(p, 0x48 + reg.idx); -} - -void x86_ret( struct x86_function *p ) -{ - emit_1ub(p, 0xc3); -} - -void x86_sahf( struct x86_function *p ) -{ - emit_1ub(p, 0x9e); -} - -void x86_mov( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x8b, 0x89, dst, src ); -} - -void x86_xor( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x33, 0x31, dst, src ); -} - -void x86_cmp( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x3b, 0x39, dst, src ); -} - -void x86_lea( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, 0x8d); - emit_modrm( p, dst, src ); -} - -void x86_test( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, 0x85); - emit_modrm( p, dst, src ); -} - -void x86_add( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm(p, 0x03, 0x01, dst, src ); -} - -void x86_mul( struct x86_function *p, - struct x86_reg src ) -{ - assert (src.file == file_REG32 && src.mod == mod_REG); - emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); -} - -void x86_sub( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm(p, 0x2b, 0x29, dst, src ); -} - -void x86_or( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x0b, 0x09, dst, src ); -} - -void x86_and( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_op_modrm( p, 0x23, 0x21, dst, src ); -} - - - -/*********************************************************************** - * SSE instructions - */ - - -void sse_movss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, 0xF3, X86_TWOB); - emit_op_modrm( p, 0x10, 0x11, dst, src ); -} - -void sse_movaps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x28, 0x29, dst, src ); -} - -void sse_movups( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x10, 0x11, dst, src ); -} - -void sse_movhps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod != mod_REG || src.mod != mod_REG); - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ -} - -void sse_movlps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod != mod_REG || src.mod != mod_REG); - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ -} - -void sse_maxps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5F); - emit_modrm( p, dst, src ); -} - -void sse_maxss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x5F); - emit_modrm( p, dst, src ); -} - -void sse_divss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x5E); - emit_modrm( p, dst, src ); -} - -void sse_minps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5D); - emit_modrm( p, dst, src ); -} - -void sse_subps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x5C); - emit_modrm( p, dst, src ); -} - -void sse_mulps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x59); - emit_modrm( p, dst, src ); -} - -void sse_mulss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x59); - emit_modrm( p, dst, src ); -} - -void sse_addps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x58); - emit_modrm( p, dst, src ); -} - -void sse_addss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x58); - emit_modrm( p, dst, src ); -} - -void sse_andnps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x55); - emit_modrm( p, dst, src ); -} - -void sse_andps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x54); - emit_modrm( p, dst, src ); -} - -void sse_rsqrtps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x52); - emit_modrm( p, dst, src ); -} - -void sse_rsqrtss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x52); - emit_modrm( p, dst, src ); - -} - -void sse_movhlps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod == mod_REG && src.mod == mod_REG); - emit_2ub(p, X86_TWOB, 0x12); - emit_modrm( p, dst, src ); -} - -void sse_movlhps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.mod == mod_REG && src.mod == mod_REG); - emit_2ub(p, X86_TWOB, 0x16); - emit_modrm( p, dst, src ); -} - -void sse_orps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x56); - emit_modrm( p, dst, src ); -} - -void sse_xorps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x57); - emit_modrm( p, dst, src ); -} - -void sse_cvtps2pi( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_XMM || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x2d); - emit_modrm( p, dst, src ); -} - - -/* Shufps can also be used to implement a reduced swizzle when dest == - * arg0. - */ -void sse_shufps( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char shuf) -{ - emit_2ub(p, X86_TWOB, 0xC6); - emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); -} - -void sse_cmpps( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char cc) -{ - emit_2ub(p, X86_TWOB, 0xC2); - emit_modrm(p, dest, arg0); - emit_1ub(p, cc); -} - -void sse_pmovmskb( struct x86_function *p, - struct x86_reg dest, - struct x86_reg src) -{ - emit_3ub(p, 0x66, X86_TWOB, 0xD7); - emit_modrm(p, dest, src); -} - -/*********************************************************************** - * SSE2 instructions - */ - -/** - * Perform a reduced swizzle: - */ -void sse2_pshufd( struct x86_function *p, - struct x86_reg dest, - struct x86_reg arg0, - unsigned char shuf) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x70); - emit_modrm(p, dest, arg0); - emit_1ub(p, shuf); -} - -void sse2_cvttps2dq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); - emit_modrm( p, dst, src ); -} - -void sse2_cvtps2dq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x5B); - emit_modrm( p, dst, src ); -} - -void sse2_packssdw( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x6B); - emit_modrm( p, dst, src ); -} - -void sse2_packsswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x63); - emit_modrm( p, dst, src ); -} - -void sse2_packuswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0x66, X86_TWOB, 0x67); - emit_modrm( p, dst, src ); -} - -void sse2_rcpps( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, X86_TWOB, 0x53); - emit_modrm( p, dst, src ); -} - -void sse2_rcpss( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_3ub(p, 0xF3, X86_TWOB, 0x53); - emit_modrm( p, dst, src ); -} - -void sse2_movd( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - emit_2ub(p, 0x66, X86_TWOB); - emit_op_modrm( p, 0x6e, 0x7e, dst, src ); -} - - - - -/*********************************************************************** - * x87 instructions - */ -void x87_fist( struct x86_function *p, struct x86_reg dst ) -{ - emit_1ub(p, 0xdb); - emit_modrm_noreg(p, 2, dst); -} - -void x87_fistp( struct x86_function *p, struct x86_reg dst ) -{ - emit_1ub(p, 0xdb); - emit_modrm_noreg(p, 3, dst); -} - -void x87_fild( struct x86_function *p, struct x86_reg arg ) -{ - emit_1ub(p, 0xdf); - emit_modrm_noreg(p, 0, arg); -} - -void x87_fldz( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xee); -} - - -void x87_fldcw( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_REG32); - assert(arg.mod != mod_REG); - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 5, arg); -} - -void x87_fld1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe8); -} - -void x87_fldl2e( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xea); -} - -void x87_fldln2( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xed); -} - -void x87_fwait( struct x86_function *p ) -{ - emit_1ub(p, 0x9b); -} - -void x87_fnclex( struct x86_function *p ) -{ - emit_2ub(p, 0xdb, 0xe2); -} - -void x87_fclex( struct x86_function *p ) -{ - x87_fwait(p); - x87_fnclex(p); -} - - -static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, - unsigned char dst0ub0, - unsigned char dst0ub1, - unsigned char arg0ub0, - unsigned char arg0ub1, - unsigned char argmem_noreg) -{ - assert(dst.file == file_x87); - - if (arg.file == file_x87) { - if (dst.idx == 0) - emit_2ub(p, dst0ub0, dst0ub1+arg.idx); - else if (arg.idx == 0) - emit_2ub(p, arg0ub0, arg0ub1+arg.idx); - else - assert(0); - } - else if (dst.idx == 0) { - assert(arg.file == file_REG32); - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, argmem_noreg, arg); - } - else - assert(0); -} - -void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xc8, - 0xdc, 0xc8, - 4); -} - -void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xe0, - 0xdc, 0xe8, - 4); -} - -void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xe8, - 0xdc, 0xe0, - 5); -} - -void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xc0, - 0xdc, 0xc0, - 0); -} - -void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xf0, - 0xdc, 0xf8, - 6); -} - -void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) -{ - x87_arith_op(p, dst, arg, - 0xd8, 0xf8, - 0xdc, 0xf0, - 7); -} - -void x87_fmulp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xc8+dst.idx); -} - -void x87_fsubp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xe8+dst.idx); -} - -void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xe0+dst.idx); -} - -void x87_faddp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xc0+dst.idx); -} - -void x87_fdivp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xf8+dst.idx); -} - -void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_x87); - assert(dst.idx >= 1); - emit_2ub(p, 0xde, 0xf0+dst.idx); -} - -void x87_fucom( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xdd, 0xe0+arg.idx); -} - -void x87_fucomp( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xdd, 0xe8+arg.idx); -} - -void x87_fucompp( struct x86_function *p ) -{ - emit_2ub(p, 0xda, 0xe9); -} - -void x87_fxch( struct x86_function *p, struct x86_reg arg ) -{ - assert(arg.file == file_x87); - emit_2ub(p, 0xd9, 0xc8+arg.idx); -} - -void x87_fabs( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe1); -} - -void x87_fchs( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xe0); -} - -void x87_fcos( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xff); -} - - -void x87_fprndint( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfc); -} - -void x87_fscale( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfd); -} - -void x87_fsin( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfe); -} - -void x87_fsincos( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfb); -} - -void x87_fsqrt( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xfa); -} - -void x87_fxtract( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf4); -} - -/* st0 = (2^st0)-1 - * - * Restrictions: -1.0 <= st0 <= 1.0 - */ -void x87_f2xm1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf0); -} - -/* st1 = st1 * log2(st0); - * pop_stack; - */ -void x87_fyl2x( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf1); -} - -/* st1 = st1 * log2(st0 + 1.0); - * pop_stack; - * - * A fast operation, with restrictions: -.29 < st0 < .29 - */ -void x87_fyl2xp1( struct x86_function *p ) -{ - emit_2ub(p, 0xd9, 0xf9); -} - - -void x87_fld( struct x86_function *p, struct x86_reg arg ) -{ - if (arg.file == file_x87) - emit_2ub(p, 0xd9, 0xc0 + arg.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 0, arg); - } -} - -void x87_fst( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xdd, 0xd0 + dst.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 2, dst); - } -} - -void x87_fstp( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xdd, 0xd8 + dst.idx); - else { - emit_1ub(p, 0xd9); - emit_modrm_noreg(p, 3, dst); - } -} - -void x87_fcom( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xd8, 0xd0 + dst.idx); - else { - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, 2, dst); - } -} - -void x87_fcomp( struct x86_function *p, struct x86_reg dst ) -{ - if (dst.file == file_x87) - emit_2ub(p, 0xd8, 0xd8 + dst.idx); - else { - emit_1ub(p, 0xd8); - emit_modrm_noreg(p, 3, dst); - } -} - - -void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) -{ - assert(dst.file == file_REG32); - - if (dst.idx == reg_AX && - dst.mod == mod_REG) - emit_2ub(p, 0xdf, 0xe0); - else { - emit_1ub(p, 0xdd); - emit_modrm_noreg(p, 7, dst); - } -} - - - - -/*********************************************************************** - * MMX instructions - */ - -void mmx_emms( struct x86_function *p ) -{ - assert(p->need_emms); - emit_2ub(p, 0x0f, 0x77); - p->need_emms = 0; -} - -void mmx_packssdw( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_MMX || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x6b); - emit_modrm( p, dst, src ); -} - -void mmx_packuswb( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - assert(dst.file == file_MMX && - (src.file == file_MMX || src.mod != mod_REG)); - - p->need_emms = 1; - - emit_2ub(p, X86_TWOB, 0x67); - emit_modrm( p, dst, src ); -} - -void mmx_movd( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - p->need_emms = 1; - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x6e, 0x7e, dst, src ); -} - -void mmx_movq( struct x86_function *p, - struct x86_reg dst, - struct x86_reg src ) -{ - p->need_emms = 1; - emit_1ub(p, X86_TWOB); - emit_op_modrm( p, 0x6f, 0x7f, dst, src ); -} - - -/*********************************************************************** - * Helper functions - */ - - -/* Retreive a reference to one of the function arguments, taking into - * account any push/pop activity: - */ -struct x86_reg x86_fn_arg( struct x86_function *p, - unsigned arg ) -{ - return x86_make_disp(x86_make_reg(file_REG32, reg_SP), - p->stack_offset + arg * 4); /* ??? */ -} - - -void x86_init_func( struct x86_function *p ) -{ - p->size = 0; - p->store = NULL; - p->csr = p->store; -} - -int x86_init_func_size( struct x86_function *p, unsigned code_size ) -{ - p->size = code_size; - p->store = _mesa_exec_malloc(code_size); - p->csr = p->store; - return p->store != NULL; -} - -void x86_release_func( struct x86_function *p ) -{ - _mesa_exec_free(p->store); - p->store = NULL; - p->csr = NULL; - p->size = 0; -} - - -void (*x86_get_func( struct x86_function *p ))(void) -{ - if (DISASSEM && p->store) - printf("disassemble %p %p\n", p->store, p->csr); - return (void (*)(void)) (unsigned long) p->store; -} - -#else - -void x86sse_dummy( void ) -{ -} - -#endif - -#else /* USE_X86_ASM */ - -int x86sse_c_dummy_var; /* silence warning */ - -#endif /* USE_X86_ASM */ diff --git a/mesalib/src/mesa/x86/rtasm/x86sse.h b/mesalib/src/mesa/x86/rtasm/x86sse.h deleted file mode 100644 index f6282f5bd..000000000 --- a/mesalib/src/mesa/x86/rtasm/x86sse.h +++ /dev/null @@ -1,256 +0,0 @@ - -#ifndef _X86SSE_H_ -#define _X86SSE_H_ - -#if defined(__i386__) || defined(__386__) - -/* It is up to the caller to ensure that instructions issued are - * suitable for the host cpu. There are no checks made in this module - * for mmx/sse/sse2 support on the cpu. - */ -struct x86_reg { - unsigned file:3; - unsigned idx:3; - unsigned mod:2; /* mod_REG if this is just a register */ - int disp:24; /* only +/- 23bits of offset - should be enough... */ -}; - -struct x86_function { - unsigned size; - unsigned char *store; - unsigned char *csr; - unsigned stack_offset; - int need_emms; - const char *fn; -}; - -enum x86_reg_file { - file_REG32, - file_MMX, - file_XMM, - file_x87 -}; - -/* Values for mod field of modr/m byte - */ -enum x86_reg_mod { - mod_INDIRECT, - mod_DISP8, - mod_DISP32, - mod_REG -}; - -enum x86_reg_name { - reg_AX, - reg_CX, - reg_DX, - reg_BX, - reg_SP, - reg_BP, - reg_SI, - reg_DI -}; - - -enum x86_cc { - cc_O, /* overflow */ - cc_NO, /* not overflow */ - cc_NAE, /* not above or equal / carry */ - cc_AE, /* above or equal / not carry */ - cc_E, /* equal / zero */ - cc_NE /* not equal / not zero */ -}; - -enum sse_cc { - cc_Equal, - cc_LessThan, - cc_LessThanEqual, - cc_Unordered, - cc_NotEqual, - cc_NotLessThan, - cc_NotLessThanEqual, - cc_Ordered -}; - -#define cc_Z cc_E -#define cc_NZ cc_NE - -/* Begin/end/retreive function creation: - */ - - -void x86_init_func( struct x86_function *p ); -int x86_init_func_size( struct x86_function *p, unsigned code_size ); -void x86_release_func( struct x86_function *p ); -void (*x86_get_func( struct x86_function *p ))( void ); - - - -/* Create and manipulate registers and regmem values: - */ -struct x86_reg x86_make_reg( enum x86_reg_file file, - enum x86_reg_name idx ); - -struct x86_reg x86_make_disp( struct x86_reg reg, - int disp ); - -struct x86_reg x86_deref( struct x86_reg reg ); - -struct x86_reg x86_get_base_reg( struct x86_reg reg ); - - -/* Labels, jumps and fixup: - */ -unsigned char *x86_get_label( struct x86_function *p ); - -void x86_jcc( struct x86_function *p, - enum x86_cc cc, - unsigned char *label ); - -unsigned char *x86_jcc_forward( struct x86_function *p, - enum x86_cc cc ); - -unsigned char *x86_jmp_forward( struct x86_function *p); - -unsigned char *x86_call_forward( struct x86_function *p); - -void x86_fixup_fwd_jump( struct x86_function *p, - unsigned char *fixup ); - -void x86_jmp( struct x86_function *p, unsigned char *label ); - -/* void x86_call( struct x86_function *p, void (*label)() ); */ -void x86_call( struct x86_function *p, struct x86_reg reg); - -/* michal: - * Temporary. As I need immediate operands, and dont want to mess with the codegen, - * I load the immediate into general purpose register and use it. - */ -void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ); - - -/* Macro for sse_shufps() and sse2_pshufd(): - */ -#define SHUF(_x,_y,_z,_w) (((_x)<<0) | ((_y)<<2) | ((_z)<<4) | ((_w)<<6)) -#define SHUF_NOOP RSW(0,1,2,3) -#define GET_SHUF(swz, idx) (((swz) >> ((idx)*2)) & 0x3) - -void mmx_emms( struct x86_function *p ); -void mmx_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_movq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void mmx_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); - -void sse2_cvtps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_cvttps2dq( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_movd( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packssdw( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packsswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_packuswb( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_pshufd( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf ); -void sse2_rcpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse2_rcpss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); - -void sse_addps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_addss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_cvtps2pi( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_divss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_andnps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_andps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_cmpps( struct x86_function *p, struct x86_reg dst, struct x86_reg src, - unsigned char cc ); -void sse_maxps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_maxss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_minps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movaps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movhlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movlhps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movlps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_movups( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_mulps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_mulss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_orps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_xorps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_subps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_rsqrtps( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_rsqrtss( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void sse_shufps( struct x86_function *p, struct x86_reg dest, struct x86_reg arg0, - unsigned char shuf ); -void sse_pmovmskb( struct x86_function *p, struct x86_reg dest, struct x86_reg src ); - -void x86_add( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_and( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_cmp( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_dec( struct x86_function *p, struct x86_reg reg ); -void x86_inc( struct x86_function *p, struct x86_reg reg ); -void x86_lea( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_mov( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_mul( struct x86_function *p, struct x86_reg src ); -void x86_or( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_pop( struct x86_function *p, struct x86_reg reg ); -void x86_push( struct x86_function *p, struct x86_reg reg ); -void x86_ret( struct x86_function *p ); -void x86_sub( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_test( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_xor( struct x86_function *p, struct x86_reg dst, struct x86_reg src ); -void x86_sahf( struct x86_function *p ); - -void x87_f2xm1( struct x86_function *p ); -void x87_fabs( struct x86_function *p ); -void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_faddp( struct x86_function *p, struct x86_reg dst ); -void x87_fchs( struct x86_function *p ); -void x87_fclex( struct x86_function *p ); -void x87_fcom( struct x86_function *p, struct x86_reg dst ); -void x87_fcomp( struct x86_function *p, struct x86_reg dst ); -void x87_fcos( struct x86_function *p ); -void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fdivp( struct x86_function *p, struct x86_reg dst ); -void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fdivrp( struct x86_function *p, struct x86_reg dst ); -void x87_fild( struct x86_function *p, struct x86_reg arg ); -void x87_fist( struct x86_function *p, struct x86_reg dst ); -void x87_fistp( struct x86_function *p, struct x86_reg dst ); -void x87_fld( struct x86_function *p, struct x86_reg arg ); -void x87_fld1( struct x86_function *p ); -void x87_fldcw( struct x86_function *p, struct x86_reg arg ); -void x87_fldl2e( struct x86_function *p ); -void x87_fldln2( struct x86_function *p ); -void x87_fldz( struct x86_function *p ); -void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fmulp( struct x86_function *p, struct x86_reg dst ); -void x87_fnclex( struct x86_function *p ); -void x87_fprndint( struct x86_function *p ); -void x87_fscale( struct x86_function *p ); -void x87_fsin( struct x86_function *p ); -void x87_fsincos( struct x86_function *p ); -void x87_fsqrt( struct x86_function *p ); -void x87_fst( struct x86_function *p, struct x86_reg dst ); -void x87_fstp( struct x86_function *p, struct x86_reg dst ); -void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fsubp( struct x86_function *p, struct x86_reg dst ); -void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ); -void x87_fsubrp( struct x86_function *p, struct x86_reg dst ); -void x87_fxch( struct x86_function *p, struct x86_reg dst ); -void x87_fxtract( struct x86_function *p ); -void x87_fyl2x( struct x86_function *p ); -void x87_fyl2xp1( struct x86_function *p ); -void x87_fwait( struct x86_function *p ); -void x87_fnstsw( struct x86_function *p, struct x86_reg dst ); -void x87_fucompp( struct x86_function *p ); -void x87_fucomp( struct x86_function *p, struct x86_reg arg ); -void x87_fucom( struct x86_function *p, struct x86_reg arg ); - - - -/* Retreive a reference to one of the function arguments, taking into - * account any push/pop activity. Note - doesn't track explict - * manipulation of ESP by other instructions. - */ -struct x86_reg x86_fn_arg( struct x86_function *p, unsigned arg ); - -#endif -#endif diff --git a/pixman/pixman/pixman-combine-float.c b/pixman/pixman/pixman-combine-float.c index 5ea739f76..e9aab4833 100644 --- a/pixman/pixman/pixman-combine-float.c +++ b/pixman/pixman/pixman-combine-float.c @@ -438,7 +438,7 @@ blend_hard_light (float sa, float s, float da, float d) static force_inline float blend_soft_light (float sa, float s, float da, float d) { - if (2 * s < sa) + if (2 * s <= sa) { if (FLOAT_IS_ZERO (da)) return d * sa; diff --git a/pixman/pixman/pixman-combine32.c b/pixman/pixman/pixman-combine32.c index 450114a52..44ca7e857 100644 --- a/pixman/pixman/pixman-combine32.c +++ b/pixman/pixman/pixman-combine32.c @@ -848,7 +848,7 @@ blend_soft_light (uint32_t d_org, double as = as_org * (1.0 / MASK); double r; - if (2 * s < as) + if (2 * s <= as) { if (ad == 0) r = d * as; diff --git a/pixman/pixman/pixman-general.c b/pixman/pixman/pixman-general.c index a653fa71a..8bce7c006 100644 --- a/pixman/pixman/pixman-general.c +++ b/pixman/pixman/pixman-general.c @@ -183,11 +183,7 @@ general_composite_rect (pixman_implementation_t *imp, mask_image = NULL; } - component_alpha = - mask_image && - mask_image->common.type == BITS && - mask_image->common.component_alpha && - PIXMAN_FORMAT_RGB (mask_image->bits.format); + component_alpha = mask_image && mask_image->common.component_alpha; _pixman_implementation_iter_init ( imp->toplevel, &mask_iter, diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c index ea03f475d..df8235841 100644 --- a/pixman/test/blitters-test.c +++ b/pixman/test/blitters-test.c @@ -394,6 +394,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0xE0A07495, + 0x63B4E3F3, test_composite, argc, argv); } diff --git a/pixman/test/composite.c b/pixman/test/composite.c index 9e51a8f65..594c69772 100644 --- a/pixman/test/composite.c +++ b/pixman/test/composite.c @@ -299,17 +299,6 @@ composite_test (image_t *dst, } } - if (mask) - { - if (component_alpha && PIXMAN_FORMAT_R (mask->format) == 0) - { - /* Ax component-alpha masks expand alpha into - * all color channels. - */ - tmsk.r = tmsk.g = tmsk.b = tmsk.a; - } - } - if (PIXMAN_FORMAT_TYPE (dst->format) == PIXMAN_TYPE_ARGB_SRGB) { tdst.r = convert_linear_to_srgb (tdst.r); diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c index 2b3a5704e..ce0d072da 100644 --- a/xorg-server/Xext/panoramiX.c +++ b/xorg-server/Xext/panoramiX.c @@ -54,6 +54,7 @@ Equipment Corporation. #include "resource.h" #include "picturestr.h" #include "xfixesint.h" +#include "damageextint.h" #ifdef COMPOSITE #include "compint.h" #endif @@ -73,7 +74,7 @@ int PanoramiXPixWidth = 0; int PanoramiXPixHeight = 0; int PanoramiXNumScreens = 0; -static RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL }; +_X_EXPORT RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL }; static int PanoramiXNumDepths; static DepthPtr PanoramiXDepths; @@ -582,6 +583,7 @@ PanoramiXExtensionInit(void) PanoramiXRenderInit(); PanoramiXFixesInit(); + PanoramiXDamageInit(); #ifdef COMPOSITE PanoramiXCompositeInit(); #endif @@ -887,6 +889,7 @@ PanoramiXResetProc(ExtensionEntry * extEntry) PanoramiXRenderReset(); PanoramiXFixesReset(); + PanoramiXDamageReset(); #ifdef COMPOSITE PanoramiXCompositeReset (); #endif diff --git a/xorg-server/Xext/panoramiXsrv.h b/xorg-server/Xext/panoramiXsrv.h index 7c605fe66..0fcde4fd5 100644 --- a/xorg-server/Xext/panoramiXsrv.h +++ b/xorg-server/Xext/panoramiXsrv.h @@ -11,6 +11,7 @@ extern _X_EXPORT int PanoramiXNumScreens; extern _X_EXPORT int PanoramiXPixWidth; extern _X_EXPORT int PanoramiXPixHeight; +extern _X_EXPORT RegionRec PanoramiXScreenRegion; extern _X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig); extern _X_EXPORT void PanoramiXConsolidate(void); diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c index d014b9194..1957a9525 100644 --- a/xorg-server/Xext/shm.c +++ b/xorg-server/Xext/shm.c @@ -37,6 +37,7 @@ in this Software without prior written authorization from The Open Group. #include <sys/shm.h> #include <unistd.h> #include <sys/stat.h> +#include <fcntl.h> #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" @@ -1177,6 +1178,35 @@ ProcShmAttachFd(ClientPtr client) } static int +shm_tmpfile(void) +{ +#ifdef SHMDIR + int fd; + int flags; + char template[] = SHMDIR "/shmfd-XXXXXX"; +#ifdef O_TMPFILE + fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666); + if (fd >= 0) { + ErrorF ("Using O_TMPFILE\n"); + return fd; + } + ErrorF ("Not using O_TMPFILE\n"); +#endif + fd = mkstemp(template); + if (fd < 0) + return -1; + unlink(template); + if (fcntl(fd, F_GETFD, &flags) >= 0) { + flags |= FD_CLOEXEC; + (void) fcntl(fd, F_SETFD, &flags); + } + return fd; +#else + return -1; +#endif +} + +static int ProcShmCreateSegment(ClientPtr client) { int fd; @@ -1188,17 +1218,15 @@ ProcShmCreateSegment(ClientPtr client) .sequenceNumber = client->sequence, .length = 0, }; - char template[] = "/tmp/shm-XXXXXX"; REQUEST_SIZE_MATCH(xShmCreateSegmentReq); if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { client->errorValue = stuff->readOnly; return BadValue; } - fd = mkstemp(template); + fd = shm_tmpfile(); if (fd < 0) return BadAlloc; - unlink(template); if (ftruncate(fd, stuff->size) < 0) { close(fd); return BadAlloc; diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 5dc902054..dff0a92b0 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -1413,7 +1413,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, !(ev->device_event.flags & TOUCH_CLIENT_ID)) TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch); - if (deliveries && ev->any.type == ET_TouchEnd && + if (ev->any.type == ET_TouchEnd && + ti->num_listeners == 1 && !dev->button->buttonsDown && dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) { (*dev->deviceGrab.DeactivateGrab) (dev); @@ -1845,7 +1846,8 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, if (rc == Success) { listener->state = LISTENER_IS_OWNER; /* async grabs cannot replay, so automatically accept this touch */ - if (dev->deviceGrab.grab && + if (listener->type == LISTENER_POINTER_GRAB && + dev->deviceGrab.grab && dev->deviceGrab.fromPassiveGrab && dev->deviceGrab.grab->pointerMode == GrabModeAsync) ActivateEarlyAccept(dev, ti); diff --git a/xorg-server/composite/compinit.c b/xorg-server/composite/compinit.c index bc1130e78..3c910914e 100644 --- a/xorg-server/composite/compinit.c +++ b/xorg-server/composite/compinit.c @@ -117,11 +117,11 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) if (ret && (mask & CWBackingStore) && pScreen->backingStoreSupport != NotUseful) { - if (pWin->backingStore != NotUseful) { + if (pWin->backingStore != NotUseful && !pWin->backStorage) { compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = (pointer) (intptr_t) 1; } - else { + else if (pWin->backingStore == NotUseful && pWin->backStorage) { compUnredirectWindow(serverClient, pWin, CompositeRedirectAutomatic); pWin->backStorage = NULL; @@ -355,6 +355,9 @@ compScreenInit(ScreenPtr pScreen) return FALSE; } + if (!disableBackingStore) + pScreen->backingStoreSupport = WhenMapped; + cs->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = compPositionWindow; diff --git a/xorg-server/composite/compoverlay.c b/xorg-server/composite/compoverlay.c index d3cfaf06f..bf5434ccb 100644 --- a/xorg-server/composite/compoverlay.c +++ b/xorg-server/composite/compoverlay.c @@ -133,16 +133,19 @@ compCreateOverlayWindow(ScreenPtr pScreen) int result; int w = pScreen->width; int h = pScreen->height; + int x = 0, y = 0; #ifdef PANORAMIX if (!noPanoramiXExtension) { + x = -pScreen->x; + y = -pScreen->y; w = PanoramiXPixWidth; h = PanoramiXPixHeight; } #endif pWin = cs->pOverlayWin = - CreateWindow(cs->overlayWid, pRoot, 0, 0, w, h, 0, + CreateWindow(cs->overlayWid, pRoot, x, y, w, h, 0, InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0], pRoot->drawable.depth, serverClient, pScreen->rootVisual, &result); diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 6197e9bed..7ec19976b 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.14.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2013-11-23" -RELEASE_NAME="Apple Pie" +AC_INIT([xorg-server], 1.14.99.905, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2013-12-19" +RELEASE_NAME="Kraken" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AC_USE_SYSTEM_EXTENSIONS @@ -782,12 +782,12 @@ DRI3PROTO="dri3proto >= 1.0" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.16" +GLPROTO="glproto >= 1.4.17" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" -XSHMFENCE="xshmfence" +XSHMFENCE="xshmfence >= 1.1" dnl Required modules XPROTO="xproto >= 7.0.22" @@ -1086,6 +1086,49 @@ case "$DRI2,$HAVE_DRI2PROTO" in esac AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) +dnl +dnl Locate a suitable tmp file system for creating shared memeory files +dnl + +AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]), +[], +[with_shared_memory_dir=yes]) + +shmdirs="/run/shm /var/tmp /tmp" + +case x"$with_shared_memory_dir" in +xyes) + for dir in $shmdirs; do + case x"$with_shared_memory_dir" in + xyes) + echo Checking temp dir "$dir" + if test -d "$dir"; then + with_shared_memory_dir="$dir" + fi + ;; + esac + done + ;; +x/*) + ;; +xno) + ;; +*) + AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir]) + ;; +esac + +case x"$with_shared_memory_dir" in +xyes) + AC_MSG_ERROR([No directory found for shared memory temp files.]) + ;; +xno) + ;; +*) + AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files]) + ;; +esac + AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto]) case "x$XTRANS_SEND_FDS" in @@ -1175,7 +1218,7 @@ case "$DRI3,$HAVE_XSHMFENCE" in yes,yes | auto,yes) ;; yes,no) - AC_MSG_ERROR("DRI3 requested, but xshmfence not found.]) + AC_MSG_ERROR([DRI3 requested, but xshmfence not found.]) DRI3=no ;; no,*) @@ -1830,7 +1873,7 @@ if test "x$XORG" = xyes; then if test "x$CONFIG_UDEV_KMS" = xyes; then AC_MSG_ERROR([Platform device enumeration requires libpciaccess]) fi - if test "x$INT10" != xstub; then + if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then AC_MSG_ERROR([Cannot build int10 without libpciaccess]) fi fi @@ -2065,8 +2108,8 @@ if test "x$XWIN" = xyes; then ;; esac - XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS" + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" AC_SUBST(XWIN_LIBS) AC_SUBST(XWIN_SERVER_NAME) AC_SUBST(XWIN_SYS_LIBS) @@ -2082,10 +2125,16 @@ if test "x$XWIN" = xyes; then dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then - AC_CHECK_PROG(PYTHON, python, python) - if test -z "$PYTHON"; then - AC_MSG_ERROR([python not found]) + AC_CHECK_PROG(PYTHON3, python3, python3) + if test -z "$PYTHON3"; then + AC_MSG_ERROR([python3 not found]) + fi + AC_MSG_CHECKING(for python module lxml) + $PYTHON3 -c "import lxml;" + if test $? -ne 0 ; then + AC_MSG_ERROR([not found]) fi + AC_MSG_RESULT(yes) if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry]) KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir` @@ -2109,7 +2158,7 @@ if test "x$XQUARTZ" = xyes; then AC_DEFINE(XQUARTZ,1,[Have Quartz]) AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" + XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $PRESENT_LIB" AC_SUBST([XQUARTZ_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) diff --git a/xorg-server/damageext/damageext.c b/xorg-server/damageext/damageext.c index 9521c2676..5650953f2 100644 --- a/xorg-server/damageext/damageext.c +++ b/xorg-server/damageext/damageext.c @@ -1,5 +1,6 @@ /* * Copyright © 2002 Keith Packard + * Copyright 2013 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -25,9 +26,24 @@ #endif #include "damageextint.h" +#include "damagestr.h" #include "protocol-versions.h" #include "extinit.h" +#ifdef PANORAMIX +#include "panoramiX.h" +#include "panoramiXsrv.h" + +typedef struct { + DamageExtPtr ext; + DamagePtr damage[MAXSCREENS]; +} PanoramiXDamageRes; + +static RESTYPE XRT_DAMAGE; +static int (*PanoramiXSaveDamageCreate) (ClientPtr); + +#endif + static unsigned char DamageReqCode; static int DamageEventBase; static RESTYPE DamageExtType; @@ -37,13 +53,49 @@ static DevPrivateKeyRec DamageClientPrivateKeyRec; #define DamageClientPrivateKey (&DamageClientPrivateKeyRec) static void +DamageNoteCritical(ClientPtr pClient) +{ + DamageClientPtr pDamageClient = GetDamageClient(pClient); + + /* Composite extension marks clients with manual Subwindows as critical */ + if (pDamageClient->critical > 0) { + SetCriticalOutputPending(); + pClient->smart_priority = SMART_MAX_PRIORITY; + } +} + +static void +damageGetGeometry(DrawablePtr draw, int *x, int *y, int *w, int *h) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension && draw->type == DRAWABLE_WINDOW) { + WindowPtr win = (WindowPtr)draw; + + if (!win->parent) { + *x = screenInfo.x; + *y = screenInfo.y; + *w = screenInfo.width; + *h = screenInfo.height; + return; + } + } +#endif + + *x = draw->x; + *y = draw->y; + *w = draw->width; + *h = draw->height; +} + +static void DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes) { ClientPtr pClient = pDamageExt->pClient; - DamageClientPtr pDamageClient = GetDamageClient(pClient); DrawablePtr pDrawable = pDamageExt->pDrawable; xDamageNotifyEvent ev; - int i; + int i, x, y, w, h; + + damageGetGeometry(pDrawable, &x, &y, &w, &h); UpdateCurrentTimeIf(); ev = (xDamageNotifyEvent) { @@ -52,10 +104,10 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes) .drawable = pDamageExt->drawable, .damage = pDamageExt->id, .timestamp = currentTime.milliseconds, - .geometry.x = pDrawable->x, - .geometry.y = pDrawable->y, - .geometry.width = pDrawable->width, - .geometry.height = pDrawable->height + .geometry.x = x, + .geometry.y = y, + .geometry.width = w, + .geometry.height = h }; if (pBoxes) { for (i = 0; i < nBoxes; i++) { @@ -72,15 +124,12 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes) else { ev.area.x = 0; ev.area.y = 0; - ev.area.width = pDrawable->width; - ev.area.height = pDrawable->height; + ev.area.width = w; + ev.area.height = h; WriteEventsToClient(pClient, 1, (xEvent *) &ev); } - /* Composite extension marks clients with manual Subwindows as critical */ - if (pDamageClient->critical > 0) { - SetCriticalOutputPending(); - pClient->smart_priority = SMART_MAX_PRIORITY; - } + + DamageNoteCritical(pClient); } static void @@ -162,23 +211,62 @@ ProcDamageQueryVersion(ClientPtr client) return Success; } -static int -ProcDamageCreate(ClientPtr client) +static void +DamageExtRegister(DrawablePtr pDrawable, DamagePtr pDamage, Bool report) +{ + DamageSetReportAfterOp(pDamage, TRUE); + DamageRegister(pDrawable, pDamage); + + if (report) { + RegionPtr pRegion = &((WindowPtr) pDrawable)->borderClip; + RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); + DamageReportDamage(pDamage, pRegion); + RegionTranslate(pRegion, pDrawable->x, pDrawable->y); + } +} + +static DamageExtPtr +DamageExtCreate(DrawablePtr pDrawable, DamageReportLevel level, + ClientPtr client, XID id, XID drawable) +{ + DamageExtPtr pDamageExt = malloc(sizeof(DamageExtRec)); + if (!pDamageExt) + return NULL; + + pDamageExt->id = id; + pDamageExt->drawable = drawable; + pDamageExt->pDrawable = pDrawable; + pDamageExt->level = level; + pDamageExt->pClient = client; + pDamageExt->pDamage = DamageCreate(DamageExtReport, DamageExtDestroy, level, + FALSE, pDrawable->pScreen, pDamageExt); + if (!pDamageExt->pDamage) { + free(pDamageExt); + return NULL; + } + + if (!AddResource(id, DamageExtType, (pointer) pDamageExt)) + return NULL; + + DamageExtRegister(pDrawable, pDamageExt->pDamage, + pDrawable->type == DRAWABLE_WINDOW); + + return pDamageExt; +} + +static DamageExtPtr +doDamageCreate(ClientPtr client, int *rc) { DrawablePtr pDrawable; DamageExtPtr pDamageExt; DamageReportLevel level; - RegionPtr pRegion; - int rc; REQUEST(xDamageCreateReq); - REQUEST_SIZE_MATCH(xDamageCreateReq); - LEGAL_NEW_RESOURCE(stuff->damage, client); - rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, - DixGetAttrAccess | DixReadAccess); - if (rc != Success) - return rc; + *rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, + DixGetAttrAccess | DixReadAccess); + if (*rc != Success) + return NULL; switch (stuff->level) { case XDamageReportRawRectangles: @@ -195,39 +283,27 @@ ProcDamageCreate(ClientPtr client) break; default: client->errorValue = stuff->level; - return BadValue; + *rc = BadValue; + return NULL; } - pDamageExt = malloc(sizeof(DamageExtRec)); + pDamageExt = DamageExtCreate(pDrawable, level, client, stuff->damage, + stuff->drawable); if (!pDamageExt) - return BadAlloc; - pDamageExt->id = stuff->damage; - pDamageExt->drawable = stuff->drawable; - pDamageExt->pDrawable = pDrawable; - pDamageExt->level = level; - pDamageExt->pClient = client; - pDamageExt->pDamage = DamageCreate(DamageExtReport, - DamageExtDestroy, - level, - FALSE, pDrawable->pScreen, pDamageExt); - if (!pDamageExt->pDamage) { - free(pDamageExt); - return BadAlloc; - } - if (!AddResource(stuff->damage, DamageExtType, (pointer) pDamageExt)) - return BadAlloc; - - DamageSetReportAfterOp(pDamageExt->pDamage, TRUE); - DamageRegister(pDamageExt->pDrawable, pDamageExt->pDamage); + *rc = BadAlloc; - if (pDrawable->type == DRAWABLE_WINDOW) { - pRegion = &((WindowPtr) pDrawable)->borderClip; - RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); - DamageReportDamage(pDamageExt->pDamage, pRegion); - RegionTranslate(pRegion, pDrawable->x, pDrawable->y); - } + return pDamageExt; +} - return Success; +static int +ProcDamageCreate(ClientPtr client) +{ + int rc; + REQUEST(xDamageCreateReq); + REQUEST_SIZE_MATCH(xDamageCreateReq); + LEGAL_NEW_RESOURCE(stuff->damage, client); + doDamageCreate(client, &rc); + return rc; } static int @@ -242,6 +318,88 @@ ProcDamageDestroy(ClientPtr client) return Success; } +#ifdef PANORAMIX +static RegionPtr +DamageExtSubtractWindowClip(DamageExtPtr pDamageExt) +{ + WindowPtr win = (WindowPtr)pDamageExt->pDrawable; + PanoramiXRes *res = NULL; + RegionPtr ret; + int i; + + if (!win->parent) + return &PanoramiXScreenRegion; + + dixLookupResourceByType((void **)&res, win->drawable.id, XRT_WINDOW, + serverClient, DixReadAccess); + if (!res) + return NULL; + + ret = RegionCreate(NULL, 0); + if (!ret) + return NULL; + + FOR_NSCREENS_FORWARD(i) { + ScreenPtr screen; + if (Success != dixLookupWindow(&win, res->info[i].id, serverClient, + DixReadAccess)) + goto out; + + screen = win->drawable.pScreen; + + RegionTranslate(ret, -screen->x, -screen->y); + if (!RegionUnion(ret, ret, &win->borderClip)) + goto out; + RegionTranslate(ret, screen->x, screen->y); + } + + return ret; + +out: + RegionDestroy(ret); + return NULL; +} + +static void +DamageExtFreeWindowClip(RegionPtr reg) +{ + if (reg != &PanoramiXScreenRegion) + RegionDestroy(reg); +} +#endif + +/* + * DamageSubtract intersects with borderClip, so we must reconstruct the + * protocol's perspective of same... + */ +static Bool +DamageExtSubtract(DamageExtPtr pDamageExt, const RegionPtr pRegion) +{ + DamagePtr pDamage = pDamageExt->pDamage; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + RegionPtr damage = DamageRegion(pDamage); + RegionSubtract(damage, damage, pRegion); + + if (pDamageExt->pDrawable->type == DRAWABLE_WINDOW) { + DrawablePtr pDraw = pDamageExt->pDrawable; + RegionPtr clip = DamageExtSubtractWindowClip(pDamageExt); + if (clip) { + RegionTranslate(clip, -pDraw->x, -pDraw->y); + RegionIntersect(damage, damage, clip); + RegionTranslate(clip, pDraw->x, pDraw->y); + DamageExtFreeWindowClip(clip); + } + } + + return RegionNotEmpty(damage); + } +#endif + + return DamageSubtract(pDamage, pRegion); +} + static int ProcDamageSubtract(ClientPtr client) { @@ -261,7 +419,7 @@ ProcDamageSubtract(ClientPtr client) if (pRepair) { if (pParts) RegionIntersect(pParts, DamageRegion(pDamage), pRepair); - if (DamageSubtract(pDamage, pRepair)) + if (DamageExtSubtract(pDamageExt, pRepair)) DamageExtReport(pDamage, DamageRegion(pDamage), (void *) pDamageExt); } @@ -271,6 +429,7 @@ ProcDamageSubtract(ClientPtr client) DamageEmpty(pDamage); } } + return Success; } @@ -460,6 +619,127 @@ SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to) cpswaps(from->geometry.height, to->geometry.height); } +#ifdef PANORAMIX + +static void +PanoramiXDamageReport(DamagePtr pDamage, RegionPtr pRegion, void *closure) +{ + PanoramiXDamageRes *res = closure; + DamageExtPtr pDamageExt = res->ext; + WindowPtr pWin = (WindowPtr)pDamage->pDrawable; + ScreenPtr pScreen = pDamage->pScreen; + + /* happens on unmap? sigh xinerama */ + if (RegionNil(pRegion)) + return; + + /* translate root windows if necessary */ + if (!pWin->parent) + RegionTranslate(pRegion, pScreen->x, pScreen->y); + + /* add our damage to the protocol view */ + DamageReportDamage(pDamageExt->pDamage, pRegion); + + /* empty our view */ + DamageEmpty(pDamage); +} + +static void +PanoramiXDamageExtDestroy(DamagePtr pDamage, void *closure) +{ + PanoramiXDamageRes *damage = closure; + damage->damage[pDamage->pScreen->myNum] = NULL; +} + +static int +PanoramiXDamageCreate(ClientPtr client) +{ + PanoramiXDamageRes *damage; + PanoramiXRes *draw; + int i, rc; + + REQUEST(xDamageCreateReq); + + REQUEST_SIZE_MATCH(xDamageCreateReq); + LEGAL_NEW_RESOURCE(stuff->damage, client); + rc = dixLookupResourceByClass((void **)&draw, stuff->drawable, XRC_DRAWABLE, + client, DixGetAttrAccess | DixReadAccess); + if (rc != Success) + return rc; + + if (!(damage = calloc(1, sizeof(PanoramiXDamageRes)))) + return BadAlloc; + + if (!AddResource(stuff->damage, XRT_DAMAGE, damage)) + return BadAlloc; + + damage->ext = doDamageCreate(client, &rc); + if (rc == Success && draw->type == XRT_WINDOW) { + FOR_NSCREENS_FORWARD(i) { + DrawablePtr pDrawable; + DamagePtr pDamage = DamageCreate(PanoramiXDamageReport, + PanoramiXDamageExtDestroy, + DamageReportRawRegion, + FALSE, + screenInfo.screens[i], + damage); + if (!pDamage) { + rc = BadAlloc; + } else { + damage->damage[i] = pDamage; + rc = dixLookupDrawable(&pDrawable, draw->info[i].id, client, + M_WINDOW, + DixGetAttrAccess | DixReadAccess); + } + if (rc != Success) + break; + + DamageExtRegister(pDrawable, pDamage, i != 0); + } + } + + if (rc != Success) + FreeResource(stuff->damage, RT_NONE); + + return rc; +} + +static int +PanoramiXDamageDelete(void *res, XID id) +{ + int i; + PanoramiXDamageRes *damage = res; + + FOR_NSCREENS_BACKWARD(i) { + if (damage->damage[i]) { + DamageDestroy(damage->damage[i]); + damage->damage[i] = NULL; + } + } + + free(damage); + return 1; +} + +void +PanoramiXDamageInit(void) +{ + XRT_DAMAGE = CreateNewResourceType(PanoramiXDamageDelete, "XineramaDamage"); + if (!XRT_DAMAGE) + FatalError("Couldn't Xineramify Damage extension\n"); + + PanoramiXSaveDamageCreate = ProcDamageVector[X_DamageCreate]; + ProcDamageVector[X_DamageCreate] = PanoramiXDamageCreate; +} + +void +PanoramiXDamageReset(void) +{ + ProcDamageVector[X_DamageCreate] = PanoramiXSaveDamageCreate; +} + +#endif /* PANORAMIX */ + void DamageExtensionInit(void) { @@ -490,5 +770,10 @@ DamageExtensionInit(void) (EventSwapPtr) SDamageNotifyEvent; SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage); +#ifdef PANORAMIX + if (XRT_DAMAGE) + SetResourceTypeErrorValue(XRT_DAMAGE, + extEntry->errorBase + BadDamage); +#endif } } diff --git a/xorg-server/damageext/damageextint.h b/xorg-server/damageext/damageextint.h index 272337922..e50149501 100644 --- a/xorg-server/damageext/damageextint.h +++ b/xorg-server/damageext/damageextint.h @@ -67,4 +67,7 @@ typedef struct _DamageExt { void DamageExtSetCritical(ClientPtr pClient, Bool critical); +void PanoramiXDamageInit(void); +void PanoramiXDamageReset(void); + #endif /* _DAMAGEEXTINT_H_ */ diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c index 4fecfea7b..8dcd9cbcf 100644 --- a/xorg-server/dix/dispatch.c +++ b/xorg-server/dix/dispatch.c @@ -220,8 +220,9 @@ UpdateCurrentTimeIf(void) #undef SMART_DEBUG -#define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ -#define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ +/* in milliseconds */ +#define SMART_SCHEDULE_DEFAULT_INTERVAL 5 +#define SMART_SCHEDULE_MAX_SLICE 15 #if defined(WIN32) && !defined(__CYGWIN__) Bool SmartScheduleDisable = TRUE; diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index 4632bb7db..4aaa54c85 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -4696,7 +4696,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, filter = GetEventFilter(mouse, (xEvent *) event); - if (grab && grab->type == XI2) { + if (grab && grab->grabtype == XI2) { Mask mask; mask = xi2mask_isset(grab->xi2mask, mouse, type); diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 92df1eb4c..0e9109e89 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -530,7 +530,11 @@ CreateRootWindow(ScreenPtr pScreen) if (disableBackingStore) pScreen->backingStoreSupport = NotUseful; if (enableBackingStore) - pScreen->backingStoreSupport = Always; + pScreen->backingStoreSupport = WhenMapped; +#ifdef COMPOSITE + if (noCompositeExtension) + pScreen->backingStoreSupport = NotUseful; +#endif pScreen->saveUnderSupport = NotUseful; diff --git a/xorg-server/dri3/dri3.c b/xorg-server/dri3/dri3.c index 2bca7ae9b..76e07b40e 100644 --- a/xorg-server/dri3/dri3.c +++ b/xorg-server/dri3/dri3.c @@ -68,6 +68,11 @@ dri3_extension_init(void) ExtensionEntry *extension; int i; +#ifdef PANORAMIX + if (!noPanoramiXExtension) + return; +#endif + extension = AddExtension(DRI3_NAME, DRI3NumberEvents, DRI3NumberErrors, proc_dri3_dispatch, sproc_dri3_dispatch, NULL, StandardMinorOpcode); diff --git a/xorg-server/dri3/dri3_request.c b/xorg-server/dri3/dri3_request.c index 3ebb9d509..4e1408fb5 100644 --- a/xorg-server/dri3/dri3_request.c +++ b/xorg-server/dri3/dri3_request.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <xace.h> #include "../Xext/syncsdk.h" +#include <protocol-versions.h> static int proc_dri3_query_version(ClientPtr client) @@ -38,8 +39,8 @@ proc_dri3_query_version(ClientPtr client) .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .majorVersion = DRI3_MAJOR, - .minorVersion = DRI3_MINOR + .majorVersion = SERVER_DRI3_MAJOR_VERSION, + .minorVersion = SERVER_DRI3_MINOR_VERSION }; REQUEST_SIZE_MATCH(xDRI3QueryVersionReq); diff --git a/xorg-server/dri3/dri3_screen.c b/xorg-server/dri3/dri3_screen.c index cf2735b8d..c88029612 100644 --- a/xorg-server/dri3/dri3_screen.c +++ b/xorg-server/dri3/dri3_screen.c @@ -55,6 +55,9 @@ dri3_pixmap_from_fd(PixmapPtr *ppixmap, ScreenPtr screen, int fd, dri3_screen_info_ptr info = ds->info; PixmapPtr pixmap; + if (!info || !info->pixmap_from_fd) + return BadImplementation; + pixmap = (*info->pixmap_from_fd) (screen, fd, width, height, stride, depth, bpp); if (!pixmap) return BadAlloc; @@ -71,6 +74,9 @@ dri3_fd_from_pixmap(int *pfd, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) dri3_screen_info_ptr info = ds->info; int fd; + if (!info || !info->fd_from_pixmap) + return BadImplementation; + fd = (*info->fd_from_pixmap)(screen, pixmap, stride, size); if (fd < 0) return BadAlloc; diff --git a/xorg-server/glx/Makefile.am b/xorg-server/glx/Makefile.am index 5f28e87da..54e81406d 100644 --- a/xorg-server/glx/Makefile.am +++ b/xorg-server/glx/Makefile.am @@ -20,7 +20,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/hw/xfree86/os-support/bus \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/dri \ - -I$(top_srcdir)/mi + -I$(top_srcdir)/mi \ + -I$(top_srcdir)/present if DRI2_AIGLX AM_CPPFLAGS += -I$(top_srcdir)/hw/xfree86/dri2 @@ -69,7 +70,6 @@ libglx_la_SOURCES = \ glxscreens.c \ glxscreens.h \ glxserver.h \ - glxstubs.c \ glxutil.h \ render2.c \ render2swap.c \ diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index efa4aecb2..b8da04882 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -2468,3 +2468,64 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc) return Success; } + +#include <GL/glxtokens.h> + +void +__glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, + CARD64 msc, CARD32 sbc) +{ + ClientPtr client = clients[CLIENT_ID(drawable->drawId)]; + + xGLXBufferSwapComplete2 wire = { + .type = __glXEventBase + GLX_BufferSwapComplete + }; + + if (!client) + return; + + if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) + return; + + wire.event_type = type; + wire.drawable = drawable->drawId; + wire.ust_hi = ust >> 32; + wire.ust_lo = ust & 0xffffffff; + wire.msc_hi = msc >> 32; + wire.msc_lo = msc & 0xffffffff; + wire.sbc = sbc; + + WriteEventsToClient(client, 1, (xEvent *) &wire); +} + +#if PRESENT +static void +__glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, + uint64_t ust, uint64_t msc) +{ + __GLXdrawable *drawable; + int glx_type; + int rc; + + rc = dixLookupResourceByType((pointer *) &drawable, window->drawable.id, + __glXDrawableRes, serverClient, DixGetAttrAccess); + + if (rc != Success) + return; + + if (present_mode == PresentCompleteModeFlip) + glx_type = GLX_FLIP_COMPLETE_INTEL; + else + glx_type = GLX_BLIT_COMPLETE_INTEL; + + __glXsendSwapEvent(drawable, glx_type, ust, msc, serial); +} + +#include <present.h> + +void +__glXregisterPresentCompleteNotify(void) +{ + present_register_complete_notify(__glXpresentCompleteNotify); +} +#endif diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c index fbbd1fd95..b2f3d6ee8 100644 --- a/xorg-server/glx/glxdri2.c +++ b/xorg-server/glx/glxdri2.c @@ -55,7 +55,6 @@ typedef struct __GLXDRIscreen __GLXDRIscreen; typedef struct __GLXDRIcontext __GLXDRIcontext; typedef struct __GLXDRIdrawable __GLXDRIdrawable; - #ifdef __DRI2_ROBUSTNESS #define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \ | __DRI_CTX_FLAG_FORWARD_COMPATIBLE \ @@ -177,36 +176,25 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { __GLXdrawable *drawable = data; - xGLXBufferSwapComplete2 wire = { - .type = __glXEventBase + GLX_BufferSwapComplete - }; - - if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) - return; - + int glx_type; switch (type) { case DRI2_EXCHANGE_COMPLETE: - wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL; + glx_type = GLX_EXCHANGE_COMPLETE_INTEL; break; + default: + /* unknown swap completion type, + * BLIT is a reasonable default, so + * fall through ... + */ case DRI2_BLIT_COMPLETE: - wire.event_type = GLX_BLIT_COMPLETE_INTEL; + glx_type = GLX_BLIT_COMPLETE_INTEL; break; case DRI2_FLIP_COMPLETE: - wire.event_type = GLX_FLIP_COMPLETE_INTEL; - break; - default: - /* unknown swap completion type */ - wire.event_type = 0; + glx_type = GLX_FLIP_COMPLETE_INTEL; break; } - wire.drawable = drawable->drawId; - wire.ust_hi = ust >> 32; - wire.ust_lo = ust & 0xffffffff; - wire.msc_hi = msc >> 32; - wire.msc_lo = msc & 0xffffffff; - wire.sbc = sbc; - - WriteEventsToClient(client, 1, (xEvent *) &wire); + + __glXsendSwapEvent(drawable, glx_type, ust, msc, sbc); } /* @@ -784,7 +772,7 @@ dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate) } static const __DRIdri2LoaderExtension loaderExtension = { - {__DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION}, + {__DRI_DRI2_LOADER, 3}, dri2GetBuffers, dri2FlushFrontBuffer, dri2GetBuffersWithFormat, @@ -792,7 +780,7 @@ static const __DRIdri2LoaderExtension loaderExtension = { #ifdef __DRI_USE_INVALIDATE static const __DRIuseInvalidateExtension dri2UseInvalidate = { - {__DRI_USE_INVALIDATE, __DRI_USE_INVALIDATE_VERSION} + {__DRI_USE_INVALIDATE, 1} }; #endif @@ -940,6 +928,9 @@ initializeExtensions(__GLXDRIscreen * screen) } } +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { @@ -1024,6 +1015,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->leaveVT = pScrn->LeaveVT; pScrn->LeaveVT = glxDRILeaveVT; + __glXsetGetProcAddress(glXGetProcAddressARB); + LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c index 1022c0075..fc902729d 100644 --- a/xorg-server/glx/glxdricommon.c +++ b/xorg-server/glx/glxdricommon.c @@ -59,7 +59,7 @@ getUST(int64_t * ust) } const __DRIsystemTimeExtension systemTimeExtension = { - {__DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION}, + {__DRI_SYSTEM_TIME, 1}, getUST, NULL, }; diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c index c9962dc81..cbc109a6d 100644 --- a/xorg-server/glx/glxdriswrast.c +++ b/xorg-server/glx/glxdriswrast.c @@ -386,7 +386,7 @@ swrastGetImage(__DRIdrawable * draw, } static const __DRIswrastLoaderExtension swrastLoaderExtension = { - {__DRI_SWRAST_LOADER, __DRI_SWRAST_LOADER_VERSION}, + {__DRI_SWRAST_LOADER, 1}, swrastGetDrawableInfo, swrastPutImage, swrastGetImage @@ -425,6 +425,9 @@ initializeExtensions(__GLXDRIscreen * screen) } } +/* white lie */ +extern glx_func_ptr glXGetProcAddressARB(const char *); + static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { @@ -443,9 +446,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->driver = glxProbeDriver(driverName, (void **) &screen->core, - __DRI_CORE, __DRI_CORE_VERSION, + __DRI_CORE, 1, (void **) &screen->swrast, - __DRI_SWRAST, __DRI_SWRAST_VERSION); + __DRI_SWRAST, 1); if (screen->driver == NULL) { goto handle_error; } @@ -472,6 +475,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.GLXmajor = 1; screen->base.GLXminor = 4; + __glXsetGetProcAddress(glXGetProcAddressARB); + LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); return &screen->base; diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index 3a7de28fb..316b4f6e8 100644 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -399,6 +399,9 @@ GlxExtensionInit(void) __glXErrorBase = extEntry->errorBase; __glXEventBase = extEntry->eventBase; +#if PRESENT + __glXregisterPresentCompleteNotify(); +#endif } /************************************************************************/ @@ -541,17 +544,19 @@ __glXleaveServer(GLboolean rendering) glxServerLeaveCount++; } -static void (*(*_get_proc_address)(const char *))(void); +static glx_gpa_proc _get_proc_address; void -__glXsetGetProcAddress(void (*(*get_proc_address) (const char *))(void)) +__glXsetGetProcAddress(glx_gpa_proc get_proc_address) { _get_proc_address = get_proc_address; } void *__glGetProcAddress(const char *proc) { - return _get_proc_address(proc); + void *ret = _get_proc_address(proc); + + return ret ? ret : NoopDDA; } /* diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h index 5e29abb28..7f36e5f5e 100644 --- a/xorg-server/glx/glxserver.h +++ b/xorg-server/glx/glxserver.h @@ -117,9 +117,20 @@ void __glXleaveServer(GLboolean rendering); void glxSuspendClients(void); void glxResumeClients(void); -void __glXsetGetProcAddress(void (*(*get_proc_address) (const char *)) (void)); +typedef void (*glx_func_ptr)(void); +typedef glx_func_ptr (*glx_gpa_proc)(const char *); +void __glXsetGetProcAddress(glx_gpa_proc get_proc_address); void *__glGetProcAddress(const char *); +void +__glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, + CARD64 msc, CARD32 sbc); + +#if PRESENT +void +__glXregisterPresentCompleteNotify(void); +#endif + /* ** State kept per client. */ diff --git a/xorg-server/glx/indirect_dispatch.c b/xorg-server/glx/indirect_dispatch.c index 1eee79a52..329b2e61e 100644 --- a/xorg-server/glx/indirect_dispatch.c +++ b/xorg-server/glx/indirect_dispatch.c @@ -3460,7 +3460,7 @@ __glXDisp_CopyTexSubImage3D(GLbyte * pc) void __glXDisp_ActiveTexture(GLbyte * pc) { - glActiveTexture(*(GLenum *) (pc + 0)); + glActiveTextureARB(*(GLenum *) (pc + 0)); } void @@ -3473,7 +3473,7 @@ __glXDisp_MultiTexCoord1dv(GLbyte * pc) } #endif - glMultiTexCoord1dv(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0)); + glMultiTexCoord1dvARB(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0)); } void @@ -3485,13 +3485,13 @@ __glXDisp_MultiTexCoord1fvARB(GLbyte * pc) void __glXDisp_MultiTexCoord1iv(GLbyte * pc) { - glMultiTexCoord1iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); + glMultiTexCoord1ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord1sv(GLbyte * pc) { - glMultiTexCoord1sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); + glMultiTexCoord1svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void @@ -3504,7 +3504,7 @@ __glXDisp_MultiTexCoord2dv(GLbyte * pc) } #endif - glMultiTexCoord2dv(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0)); + glMultiTexCoord2dvARB(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0)); } void @@ -3516,13 +3516,13 @@ __glXDisp_MultiTexCoord2fvARB(GLbyte * pc) void __glXDisp_MultiTexCoord2iv(GLbyte * pc) { - glMultiTexCoord2iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); + glMultiTexCoord2ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord2sv(GLbyte * pc) { - glMultiTexCoord2sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); + glMultiTexCoord2svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void @@ -3535,7 +3535,7 @@ __glXDisp_MultiTexCoord3dv(GLbyte * pc) } #endif - glMultiTexCoord3dv(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0)); + glMultiTexCoord3dvARB(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0)); } void @@ -3547,13 +3547,13 @@ __glXDisp_MultiTexCoord3fvARB(GLbyte * pc) void __glXDisp_MultiTexCoord3iv(GLbyte * pc) { - glMultiTexCoord3iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); + glMultiTexCoord3ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord3sv(GLbyte * pc) { - glMultiTexCoord3sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); + glMultiTexCoord3svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void @@ -3566,7 +3566,7 @@ __glXDisp_MultiTexCoord4dv(GLbyte * pc) } #endif - glMultiTexCoord4dv(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); + glMultiTexCoord4dvARB(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0)); } void @@ -3578,119 +3578,136 @@ __glXDisp_MultiTexCoord4fvARB(GLbyte * pc) void __glXDisp_MultiTexCoord4iv(GLbyte * pc) { - glMultiTexCoord4iv(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); + glMultiTexCoord4ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_MultiTexCoord4sv(GLbyte * pc) { - glMultiTexCoord4sv(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); + glMultiTexCoord4svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_CompressedTexImage1D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = + __glGetProcAddress("glCompressedTexImage1D"); const GLsizei imageSize = *(GLsizei *) (pc + 20); - glCompressedTexImage1D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLsizei *) (pc + 12), - *(GLint *) (pc + 16), - imageSize, (const GLvoid *) (pc + 24)); + CompressedTexImage1D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLenum *) (pc + 8), + *(GLsizei *) (pc + 12), + *(GLint *) (pc + 16), + imageSize, (const GLvoid *) (pc + 24)); } void __glXDisp_CompressedTexImage2D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = + __glGetProcAddress("glCompressedTexImage2D"); const GLsizei imageSize = *(GLsizei *) (pc + 24); - glCompressedTexImage2D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLsizei *) (pc + 12), - *(GLsizei *) (pc + 16), - *(GLint *) (pc + 20), - imageSize, (const GLvoid *) (pc + 28)); + CompressedTexImage2D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLenum *) (pc + 8), + *(GLsizei *) (pc + 12), + *(GLsizei *) (pc + 16), + *(GLint *) (pc + 20), + imageSize, (const GLvoid *) (pc + 28)); } void __glXDisp_CompressedTexImage3D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = + __glGetProcAddress("glCompressedTexImage3D"); const GLsizei imageSize = *(GLsizei *) (pc + 28); - glCompressedTexImage3D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLsizei *) (pc + 12), - *(GLsizei *) (pc + 16), - *(GLsizei *) (pc + 20), - *(GLint *) (pc + 24), - imageSize, (const GLvoid *) (pc + 32)); + CompressedTexImage3D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLenum *) (pc + 8), + *(GLsizei *) (pc + 12), + *(GLsizei *) (pc + 16), + *(GLsizei *) (pc + 20), + *(GLint *) (pc + 24), + imageSize, (const GLvoid *) (pc + 32)); } void __glXDisp_CompressedTexSubImage1D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = + __glGetProcAddress("glCompressedTexSubImage1D"); const GLsizei imageSize = *(GLsizei *) (pc + 20); - glCompressedTexSubImage1D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLint *) (pc + 8), - *(GLsizei *) (pc + 12), - *(GLenum *) (pc + 16), - imageSize, (const GLvoid *) (pc + 24)); + CompressedTexSubImage1D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLint *) (pc + 8), + *(GLsizei *) (pc + 12), + *(GLenum *) (pc + 16), + imageSize, (const GLvoid *) (pc + 24)); } void __glXDisp_CompressedTexSubImage2D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = + __glGetProcAddress("glCompressedTexSubImage2D"); const GLsizei imageSize = *(GLsizei *) (pc + 28); - glCompressedTexSubImage2D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLint *) (pc + 8), - *(GLint *) (pc + 12), - *(GLsizei *) (pc + 16), - *(GLsizei *) (pc + 20), - *(GLenum *) (pc + 24), - imageSize, (const GLvoid *) (pc + 32)); + CompressedTexSubImage2D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLint *) (pc + 8), + *(GLint *) (pc + 12), + *(GLsizei *) (pc + 16), + *(GLsizei *) (pc + 20), + *(GLenum *) (pc + 24), + imageSize, (const GLvoid *) (pc + 32)); } void __glXDisp_CompressedTexSubImage3D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = + __glGetProcAddress("glCompressedTexSubImage3D"); const GLsizei imageSize = *(GLsizei *) (pc + 36); - glCompressedTexSubImage3D(*(GLenum *) (pc + 0), - *(GLint *) (pc + 4), - *(GLint *) (pc + 8), - *(GLint *) (pc + 12), - *(GLint *) (pc + 16), - *(GLsizei *) (pc + 20), - *(GLsizei *) (pc + 24), - *(GLsizei *) (pc + 28), - *(GLenum *) (pc + 32), - imageSize, (const GLvoid *) (pc + 40)); + CompressedTexSubImage3D(*(GLenum *) (pc + 0), + *(GLint *) (pc + 4), + *(GLint *) (pc + 8), + *(GLint *) (pc + 12), + *(GLint *) (pc + 16), + *(GLsizei *) (pc + 20), + *(GLsizei *) (pc + 24), + *(GLsizei *) (pc + 28), + *(GLenum *) (pc + 32), + imageSize, (const GLvoid *) (pc + 40)); } void __glXDisp_SampleCoverage(GLbyte * pc) { - glSampleCoverage(*(GLclampf *) (pc + 0), *(GLboolean *) (pc + 4)); + PFNGLSAMPLECOVERAGEPROC SampleCoverage = + __glGetProcAddress("glSampleCoverage"); + SampleCoverage(*(GLclampf *) (pc + 0), *(GLboolean *) (pc + 4)); } void __glXDisp_BlendFuncSeparate(GLbyte * pc) { - glBlendFuncSeparate(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), *(GLenum *) (pc + 12)); + PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = + __glGetProcAddress("glBlendFuncSeparate"); + BlendFuncSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), *(GLenum *) (pc + 12)); } void __glXDisp_FogCoorddv(GLbyte * pc) { + PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); + #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); @@ -3698,52 +3715,64 @@ __glXDisp_FogCoorddv(GLbyte * pc) } #endif - glFogCoorddv((const GLdouble *) (pc + 0)); + FogCoorddv((const GLdouble *) (pc + 0)); } void __glXDisp_PointParameterf(GLbyte * pc) { - glPointParameterf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); + PFNGLPOINTPARAMETERFPROC PointParameterf = + __glGetProcAddress("glPointParameterf"); + PointParameterf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4)); } void __glXDisp_PointParameterfv(GLbyte * pc) { + PFNGLPOINTPARAMETERFVPROC PointParameterfv = + __glGetProcAddress("glPointParameterfv"); const GLenum pname = *(GLenum *) (pc + 0); const GLfloat *params; params = (const GLfloat *) (pc + 4); - glPointParameterfv(pname, params); + PointParameterfv(pname, params); } void __glXDisp_PointParameteri(GLbyte * pc) { - glPointParameteri(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); + PFNGLPOINTPARAMETERIPROC PointParameteri = + __glGetProcAddress("glPointParameteri"); + PointParameteri(*(GLenum *) (pc + 0), *(GLint *) (pc + 4)); } void __glXDisp_PointParameteriv(GLbyte * pc) { + PFNGLPOINTPARAMETERIVPROC PointParameteriv = + __glGetProcAddress("glPointParameteriv"); const GLenum pname = *(GLenum *) (pc + 0); const GLint *params; params = (const GLint *) (pc + 4); - glPointParameteriv(pname, params); + PointParameteriv(pname, params); } void __glXDisp_SecondaryColor3bv(GLbyte * pc) { - glSecondaryColor3bv((const GLbyte *) (pc + 0)); + PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = + __glGetProcAddress("glSecondaryColor3bv"); + SecondaryColor3bv((const GLbyte *) (pc + 0)); } void __glXDisp_SecondaryColor3dv(GLbyte * pc) { + PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = + __glGetProcAddress("glSecondaryColor3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); @@ -3751,54 +3780,70 @@ __glXDisp_SecondaryColor3dv(GLbyte * pc) } #endif - glSecondaryColor3dv((const GLdouble *) (pc + 0)); + SecondaryColor3dv((const GLdouble *) (pc + 0)); } void __glXDisp_SecondaryColor3iv(GLbyte * pc) { - glSecondaryColor3iv((const GLint *) (pc + 0)); + PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = + __glGetProcAddress("glSecondaryColor3iv"); + SecondaryColor3iv((const GLint *) (pc + 0)); } void __glXDisp_SecondaryColor3sv(GLbyte * pc) { - glSecondaryColor3sv((const GLshort *) (pc + 0)); + PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = + __glGetProcAddress("glSecondaryColor3sv"); + SecondaryColor3sv((const GLshort *) (pc + 0)); } void __glXDisp_SecondaryColor3ubv(GLbyte * pc) { - glSecondaryColor3ubv((const GLubyte *) (pc + 0)); + PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = + __glGetProcAddress("glSecondaryColor3ubv"); + SecondaryColor3ubv((const GLubyte *) (pc + 0)); } void __glXDisp_SecondaryColor3uiv(GLbyte * pc) { - glSecondaryColor3uiv((const GLuint *) (pc + 0)); + PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = + __glGetProcAddress("glSecondaryColor3uiv"); + SecondaryColor3uiv((const GLuint *) (pc + 0)); } void __glXDisp_SecondaryColor3usv(GLbyte * pc) { - glSecondaryColor3usv((const GLushort *) (pc + 0)); + PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = + __glGetProcAddress("glSecondaryColor3usv"); + SecondaryColor3usv((const GLushort *) (pc + 0)); } void __glXDisp_WindowPos3fv(GLbyte * pc) { - glWindowPos3fv((const GLfloat *) (pc + 0)); + PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); + + WindowPos3fv((const GLfloat *) (pc + 0)); } void __glXDisp_BeginQuery(GLbyte * pc) { - glBeginQuery(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); + PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); + + BeginQuery(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } int __glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc) { + PFNGLDELETEQUERIESPROC DeleteQueries = + __glGetProcAddress("glDeleteQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3807,7 +3852,7 @@ __glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); - glDeleteQueries(n, (const GLuint *) (pc + 4)); + DeleteQueries(n, (const GLuint *) (pc + 4)); error = Success; } @@ -3817,12 +3862,15 @@ __glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc) void __glXDisp_EndQuery(GLbyte * pc) { - glEndQuery(*(GLenum *) (pc + 0)); + PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); + + EndQuery(*(GLenum *) (pc + 0)); } int __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3835,7 +3883,7 @@ __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc) GLuint *ids = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenQueries(n, ids); + GenQueries(n, ids); __glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0); error = Success; } @@ -3846,6 +3894,8 @@ __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = + __glGetProcAddress("glGetQueryObjectiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3864,7 +3914,7 @@ __glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryObjectiv(*(GLuint *) (pc + 0), pname, params); + GetQueryObjectiv(*(GLuint *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } @@ -3875,6 +3925,8 @@ __glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = + __glGetProcAddress("glGetQueryObjectuiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3893,7 +3945,7 @@ __glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryObjectuiv(*(GLuint *) (pc + 0), pname, params); + GetQueryObjectuiv(*(GLuint *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } @@ -3904,6 +3956,7 @@ __glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3922,7 +3975,7 @@ __glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryiv(*(GLenum *) (pc + 0), pname, params); + GetQueryiv(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } @@ -3933,6 +3986,7 @@ __glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc) int __glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc) { + PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -3941,7 +3995,7 @@ __glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsQuery(*(GLuint *) (pc + 0)); + retval = IsQuery(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -3952,20 +4006,25 @@ __glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc) void __glXDisp_BlendEquationSeparate(GLbyte * pc) { - glBlendEquationSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); + PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = + __glGetProcAddress("glBlendEquationSeparate"); + BlendEquationSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_DrawBuffers(GLbyte * pc) { + PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); const GLsizei n = *(GLsizei *) (pc + 0); - glDrawBuffers(n, (const GLenum *) (pc + 4)); + DrawBuffers(n, (const GLenum *) (pc + 4)); } void __glXDisp_VertexAttrib1dv(GLbyte * pc) { + PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = + __glGetProcAddress("glVertexAttrib1dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); @@ -3973,18 +4032,22 @@ __glXDisp_VertexAttrib1dv(GLbyte * pc) } #endif - glVertexAttrib1dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib1dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib1sv(GLbyte * pc) { - glVertexAttrib1sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = + __glGetProcAddress("glVertexAttrib1sv"); + VertexAttrib1sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib2dv(GLbyte * pc) { + PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = + __glGetProcAddress("glVertexAttrib2dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); @@ -3992,18 +4055,22 @@ __glXDisp_VertexAttrib2dv(GLbyte * pc) } #endif - glVertexAttrib2dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib2dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib2sv(GLbyte * pc) { - glVertexAttrib2sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = + __glGetProcAddress("glVertexAttrib2sv"); + VertexAttrib2sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib3dv(GLbyte * pc) { + PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = + __glGetProcAddress("glVertexAttrib3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); @@ -4011,60 +4078,78 @@ __glXDisp_VertexAttrib3dv(GLbyte * pc) } #endif - glVertexAttrib3dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib3dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib3sv(GLbyte * pc) { - glVertexAttrib3sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = + __glGetProcAddress("glVertexAttrib3sv"); + VertexAttrib3sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4Nbv(GLbyte * pc) { - glVertexAttrib4Nbv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); + PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = + __glGetProcAddress("glVertexAttrib4Nbv"); + VertexAttrib4Nbv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); } void __glXDisp_VertexAttrib4Niv(GLbyte * pc) { - glVertexAttrib4Niv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); + PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = + __glGetProcAddress("glVertexAttrib4Niv"); + VertexAttrib4Niv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_VertexAttrib4Nsv(GLbyte * pc) { - glVertexAttrib4Nsv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = + __glGetProcAddress("glVertexAttrib4Nsv"); + VertexAttrib4Nsv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4Nubv(GLbyte * pc) { - glVertexAttrib4Nubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = + __glGetProcAddress("glVertexAttrib4Nubv"); + VertexAttrib4Nubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttrib4Nuiv(GLbyte * pc) { - glVertexAttrib4Nuiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); + PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = + __glGetProcAddress("glVertexAttrib4Nuiv"); + VertexAttrib4Nuiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); } void __glXDisp_VertexAttrib4Nusv(GLbyte * pc) { - glVertexAttrib4Nusv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); + PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = + __glGetProcAddress("glVertexAttrib4Nusv"); + VertexAttrib4Nusv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); } void __glXDisp_VertexAttrib4bv(GLbyte * pc) { - glVertexAttrib4bv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); + PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = + __glGetProcAddress("glVertexAttrib4bv"); + VertexAttrib4bv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4)); } void __glXDisp_VertexAttrib4dv(GLbyte * pc) { + PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = + __glGetProcAddress("glVertexAttrib4dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); @@ -4072,54 +4157,70 @@ __glXDisp_VertexAttrib4dv(GLbyte * pc) } #endif - glVertexAttrib4dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib4dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib4iv(GLbyte * pc) { - glVertexAttrib4iv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); + PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = + __glGetProcAddress("glVertexAttrib4iv"); + VertexAttrib4iv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4)); } void __glXDisp_VertexAttrib4sv(GLbyte * pc) { - glVertexAttrib4sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = + __glGetProcAddress("glVertexAttrib4sv"); + VertexAttrib4sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4ubv(GLbyte * pc) { - glVertexAttrib4ubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = + __glGetProcAddress("glVertexAttrib4ubv"); + VertexAttrib4ubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttrib4uiv(GLbyte * pc) { - glVertexAttrib4uiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); + PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = + __glGetProcAddress("glVertexAttrib4uiv"); + VertexAttrib4uiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4)); } void __glXDisp_VertexAttrib4usv(GLbyte * pc) { - glVertexAttrib4usv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); + PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = + __glGetProcAddress("glVertexAttrib4usv"); + VertexAttrib4usv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4)); } void __glXDisp_ClampColor(GLbyte * pc) { - glClampColor(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); + PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); + + ClampColor(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4)); } void __glXDisp_BindProgramARB(GLbyte * pc) { - glBindProgramARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); + PFNGLBINDPROGRAMARBPROC BindProgramARB = + __glGetProcAddress("glBindProgramARB"); + BindProgramARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } int __glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = + __glGetProcAddress("glDeleteProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4128,7 +4229,7 @@ __glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { const GLsizei n = *(GLsizei *) (pc + 0); - glDeleteProgramsARB(n, (const GLuint *) (pc + 4)); + DeleteProgramsARB(n, (const GLuint *) (pc + 4)); error = Success; } @@ -4138,6 +4239,8 @@ __glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENPROGRAMSARBPROC GenProgramsARB = + __glGetProcAddress("glGenProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4150,7 +4253,7 @@ __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) GLuint *programs = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenProgramsARB(n, programs); + GenProgramsARB(n, programs); __glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0); error = Success; } @@ -4161,6 +4264,8 @@ __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = + __glGetProcAddress("glGetProgramEnvParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4169,8 +4274,8 @@ __glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLdouble params[4]; - glGetProgramEnvParameterdvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), params); + GetProgramEnvParameterdvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } @@ -4181,6 +4286,8 @@ __glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = + __glGetProcAddress("glGetProgramEnvParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4189,8 +4296,8 @@ __glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLfloat params[4]; - glGetProgramEnvParameterfvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), params); + GetProgramEnvParameterfvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } @@ -4201,6 +4308,8 @@ __glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = + __glGetProcAddress("glGetProgramLocalParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4209,8 +4318,8 @@ __glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLdouble params[4]; - glGetProgramLocalParameterdvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), params); + GetProgramLocalParameterdvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; } @@ -4221,6 +4330,8 @@ __glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = + __glGetProcAddress("glGetProgramLocalParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4229,8 +4340,8 @@ __glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLfloat params[4]; - glGetProgramLocalParameterfvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), params); + GetProgramLocalParameterfvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), params); __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; } @@ -4241,6 +4352,8 @@ __glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMIVARBPROC GetProgramivARB = + __glGetProcAddress("glGetProgramivARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4259,7 +4372,7 @@ __glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetProgramivARB(*(GLenum *) (pc + 0), pname, params); + GetProgramivARB(*(GLenum *) (pc + 0), pname, params); __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; } @@ -4270,6 +4383,7 @@ __glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) int __glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4278,7 +4392,7 @@ __glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsProgramARB(*(GLuint *) (pc + 0)); + retval = IsProgramARB(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4289,6 +4403,8 @@ __glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc) void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc) { + PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = + __glGetProcAddress("glProgramEnvParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); @@ -4296,22 +4412,25 @@ __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc) } #endif - glProgramEnvParameter4dvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), - (const GLdouble *) (pc + 8)); + ProgramEnvParameter4dvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), + (const GLdouble *) (pc + 8)); } void __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc) { - glProgramEnvParameter4fvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), - (const GLfloat *) (pc + 8)); + PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = + __glGetProcAddress("glProgramEnvParameter4fvARB"); + ProgramEnvParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), + (const GLfloat *) (pc + 8)); } void __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc) { + PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = + __glGetProcAddress("glProgramLocalParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); @@ -4319,81 +4438,96 @@ __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc) } #endif - glProgramLocalParameter4dvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), - (const GLdouble *) (pc + 8)); + ProgramLocalParameter4dvARB(*(GLenum *) (pc + 0), + *(GLuint *) (pc + 4), + (const GLdouble *) (pc + 8)); } void __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc) { - glProgramLocalParameter4fvARB(*(GLenum *) (pc + 0), - *(GLuint *) (pc + 4), - (const GLfloat *) (pc + 8)); + PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = + __glGetProcAddress("glProgramLocalParameter4fvARB"); + ProgramLocalParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4), + (const GLfloat *) (pc + 8)); } void __glXDisp_ProgramStringARB(GLbyte * pc) { + PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = + __glGetProcAddress("glProgramStringARB"); const GLsizei len = *(GLsizei *) (pc + 8); - glProgramStringARB(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), len, (const GLvoid *) (pc + 12)); + ProgramStringARB(*(GLenum *) (pc + 0), + *(GLenum *) (pc + 4), len, (const GLvoid *) (pc + 12)); } void __glXDisp_VertexAttrib1fvARB(GLbyte * pc) { - glVertexAttrib1fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = + __glGetProcAddress("glVertexAttrib1fvARB"); + VertexAttrib1fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib2fvARB(GLbyte * pc) { - glVertexAttrib2fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = + __glGetProcAddress("glVertexAttrib2fvARB"); + VertexAttrib2fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib3fvARB(GLbyte * pc) { - glVertexAttrib3fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = + __glGetProcAddress("glVertexAttrib3fvARB"); + VertexAttrib3fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib4fvARB(GLbyte * pc) { - glVertexAttrib4fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = + __glGetProcAddress("glVertexAttrib4fvARB"); + VertexAttrib4fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_BindFramebuffer(GLbyte * pc) { - glBindFramebuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); + PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = + __glGetProcAddress("glBindFramebuffer"); + BindFramebuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } void __glXDisp_BindRenderbuffer(GLbyte * pc) { - glBindRenderbuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); + PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = + __glGetProcAddress("glBindRenderbuffer"); + BindRenderbuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4)); } void __glXDisp_BlitFramebuffer(GLbyte * pc) { - glBlitFramebuffer(*(GLint *) (pc + 0), - *(GLint *) (pc + 4), - *(GLint *) (pc + 8), - *(GLint *) (pc + 12), - *(GLint *) (pc + 16), - *(GLint *) (pc + 20), - *(GLint *) (pc + 24), - *(GLint *) (pc + 28), - *(GLbitfield *) (pc + 32), *(GLenum *) (pc + 36)); + PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = + __glGetProcAddress("glBlitFramebuffer"); + BlitFramebuffer(*(GLint *) (pc + 0), *(GLint *) (pc + 4), + *(GLint *) (pc + 8), *(GLint *) (pc + 12), + *(GLint *) (pc + 16), *(GLint *) (pc + 20), + *(GLint *) (pc + 24), *(GLint *) (pc + 28), + *(GLbitfield *) (pc + 32), *(GLenum *) (pc + 36)); } int __glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) { + PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = + __glGetProcAddress("glCheckFramebufferStatus"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4402,7 +4536,7 @@ __glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLenum retval; - retval = glCheckFramebufferStatus(*(GLenum *) (pc + 0)); + retval = CheckFramebufferStatus(*(GLenum *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4413,67 +4547,77 @@ __glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) void __glXDisp_DeleteFramebuffers(GLbyte * pc) { + PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = + __glGetProcAddress("glDeleteFramebuffers"); const GLsizei n = *(GLsizei *) (pc + 0); - glDeleteFramebuffers(n, (const GLuint *) (pc + 4)); + DeleteFramebuffers(n, (const GLuint *) (pc + 4)); } void __glXDisp_DeleteRenderbuffers(GLbyte * pc) { + PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = + __glGetProcAddress("glDeleteRenderbuffers"); const GLsizei n = *(GLsizei *) (pc + 0); - glDeleteRenderbuffers(n, (const GLuint *) (pc + 4)); + DeleteRenderbuffers(n, (const GLuint *) (pc + 4)); } void __glXDisp_FramebufferRenderbuffer(GLbyte * pc) { - glFramebufferRenderbuffer(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), *(GLuint *) (pc + 12)); + PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = + __glGetProcAddress("glFramebufferRenderbuffer"); + FramebufferRenderbuffer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), *(GLuint *) (pc + 12)); } void __glXDisp_FramebufferTexture1D(GLbyte * pc) { - glFramebufferTexture1D(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLuint *) (pc + 12), *(GLint *) (pc + 16)); + PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = + __glGetProcAddress("glFramebufferTexture1D"); + FramebufferTexture1D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), + *(GLint *) (pc + 16)); } void __glXDisp_FramebufferTexture2D(GLbyte * pc) { - glFramebufferTexture2D(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLuint *) (pc + 12), *(GLint *) (pc + 16)); + PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = + __glGetProcAddress("glFramebufferTexture2D"); + FramebufferTexture2D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), + *(GLint *) (pc + 16)); } void __glXDisp_FramebufferTexture3D(GLbyte * pc) { - glFramebufferTexture3D(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLuint *) (pc + 12), - *(GLint *) (pc + 16), *(GLint *) (pc + 20)); + PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = + __glGetProcAddress("glFramebufferTexture3D"); + FramebufferTexture3D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), *(GLuint *) (pc + 12), + *(GLint *) (pc + 16), *(GLint *) (pc + 20)); } void __glXDisp_FramebufferTextureLayer(GLbyte * pc) { - glFramebufferTextureLayer(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLuint *) (pc + 8), - *(GLint *) (pc + 12), *(GLint *) (pc + 16)); + PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = + __glGetProcAddress("glFramebufferTextureLayer"); + FramebufferTextureLayer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLuint *) (pc + 8), *(GLint *) (pc + 12), + *(GLint *) (pc + 16)); } int __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = + __glGetProcAddress("glGenFramebuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4486,7 +4630,7 @@ __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) GLuint *framebuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenFramebuffers(n, framebuffers); + GenFramebuffers(n, framebuffers); __glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0); error = Success; } @@ -4497,6 +4641,8 @@ __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) int __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = + __glGetProcAddress("glGenRenderbuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4509,7 +4655,7 @@ __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) GLuint *renderbuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenRenderbuffers(n, renderbuffers); + GenRenderbuffers(n, renderbuffers); __glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0); error = Success; } @@ -4520,13 +4666,18 @@ __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) void __glXDisp_GenerateMipmap(GLbyte * pc) { - glGenerateMipmap(*(GLenum *) (pc + 0)); + PFNGLGENERATEMIPMAPPROC GenerateMipmap = + __glGetProcAddress("glGenerateMipmap"); + GenerateMipmap(*(GLenum *) (pc + 0)); } int __glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC + GetFramebufferAttachmentParameteriv = + __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4535,9 +4686,9 @@ __glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, if (cx != NULL) { GLint params[1]; - glGetFramebufferAttachmentParameteriv(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLenum *) (pc + 8), params); + GetFramebufferAttachmentParameteriv(*(GLenum *) (pc + 0), + *(GLenum *) (pc + 4), + *(GLenum *) (pc + 8), params); __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } @@ -4548,6 +4699,8 @@ __glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, int __glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = + __glGetProcAddress("glGetRenderbufferParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4556,8 +4709,8 @@ __glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLint params[1]; - glGetRenderbufferParameteriv(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), params); + GetRenderbufferParameteriv(*(GLenum *) (pc + 0), + *(GLenum *) (pc + 4), params); __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; } @@ -4568,6 +4721,8 @@ __glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) int __glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) { + PFNGLISFRAMEBUFFERPROC IsFramebuffer = + __glGetProcAddress("glIsFramebuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4576,7 +4731,7 @@ __glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsFramebuffer(*(GLuint *) (pc + 0)); + retval = IsFramebuffer(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4587,6 +4742,8 @@ __glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) int __glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) { + PFNGLISRENDERBUFFERPROC IsRenderbuffer = + __glGetProcAddress("glIsRenderbuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error); @@ -4595,7 +4752,7 @@ __glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsRenderbuffer(*(GLuint *) (pc + 0)); + retval = IsRenderbuffer(*(GLuint *) (pc + 0)); __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4606,36 +4763,43 @@ __glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) void __glXDisp_RenderbufferStorage(GLbyte * pc) { - glRenderbufferStorage(*(GLenum *) (pc + 0), - *(GLenum *) (pc + 4), - *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); + PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = + __glGetProcAddress("glRenderbufferStorage"); + RenderbufferStorage(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), + *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12)); } void __glXDisp_RenderbufferStorageMultisample(GLbyte * pc) { - glRenderbufferStorageMultisample(*(GLenum *) (pc + 0), - *(GLsizei *) (pc + 4), - *(GLenum *) (pc + 8), - *(GLsizei *) (pc + 12), - *(GLsizei *) (pc + 16)); + PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = + __glGetProcAddress("glRenderbufferStorageMultisample"); + RenderbufferStorageMultisample(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4), + *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12), + *(GLsizei *) (pc + 16)); } void __glXDisp_SecondaryColor3fvEXT(GLbyte * pc) { - glSecondaryColor3fvEXT((const GLfloat *) (pc + 0)); + PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = + __glGetProcAddress("glSecondaryColor3fvEXT"); + SecondaryColor3fvEXT((const GLfloat *) (pc + 0)); } void __glXDisp_FogCoordfvEXT(GLbyte * pc) { - glFogCoordfvEXT((const GLfloat *) (pc + 0)); + PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = + __glGetProcAddress("glFogCoordfvEXT"); + FogCoordfvEXT((const GLfloat *) (pc + 0)); } void __glXDisp_VertexAttrib1dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = + __glGetProcAddress("glVertexAttrib1dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); @@ -4643,24 +4807,30 @@ __glXDisp_VertexAttrib1dvNV(GLbyte * pc) } #endif - glVertexAttrib1dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib1dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib1fvNV(GLbyte * pc) { - glVertexAttrib1fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = + __glGetProcAddress("glVertexAttrib1fvNV"); + VertexAttrib1fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib1svNV(GLbyte * pc) { - glVertexAttrib1svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = + __glGetProcAddress("glVertexAttrib1svNV"); + VertexAttrib1svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib2dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = + __glGetProcAddress("glVertexAttrib2dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); @@ -4668,24 +4838,30 @@ __glXDisp_VertexAttrib2dvNV(GLbyte * pc) } #endif - glVertexAttrib2dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib2dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib2fvNV(GLbyte * pc) { - glVertexAttrib2fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = + __glGetProcAddress("glVertexAttrib2fvNV"); + VertexAttrib2fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib2svNV(GLbyte * pc) { - glVertexAttrib2svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = + __glGetProcAddress("glVertexAttrib2svNV"); + VertexAttrib2svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib3dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = + __glGetProcAddress("glVertexAttrib3dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); @@ -4693,24 +4869,30 @@ __glXDisp_VertexAttrib3dvNV(GLbyte * pc) } #endif - glVertexAttrib3dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib3dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib3fvNV(GLbyte * pc) { - glVertexAttrib3fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = + __glGetProcAddress("glVertexAttrib3fvNV"); + VertexAttrib3fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib3svNV(GLbyte * pc) { - glVertexAttrib3svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = + __glGetProcAddress("glVertexAttrib3svNV"); + VertexAttrib3svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = + __glGetProcAddress("glVertexAttrib4dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); @@ -4718,30 +4900,38 @@ __glXDisp_VertexAttrib4dvNV(GLbyte * pc) } #endif - glVertexAttrib4dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); + VertexAttrib4dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4)); } void __glXDisp_VertexAttrib4fvNV(GLbyte * pc) { - glVertexAttrib4fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); + PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = + __glGetProcAddress("glVertexAttrib4fvNV"); + VertexAttrib4fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4)); } void __glXDisp_VertexAttrib4svNV(GLbyte * pc) { - glVertexAttrib4svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); + PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = + __glGetProcAddress("glVertexAttrib4svNV"); + VertexAttrib4svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4)); } void __glXDisp_VertexAttrib4ubvNV(GLbyte * pc) { - glVertexAttrib4ubvNV(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = + __glGetProcAddress("glVertexAttrib4ubvNV"); + VertexAttrib4ubvNV(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4)); } void __glXDisp_VertexAttribs1dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = + __glGetProcAddress("glVertexAttribs1dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 @@ -4753,28 +4943,34 @@ __glXDisp_VertexAttribs1dvNV(GLbyte * pc) } #endif - glVertexAttribs1dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); + VertexAttribs1dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs1fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = + __glGetProcAddress("glVertexAttribs1fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs1fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); + VertexAttribs1fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs1svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = + __glGetProcAddress("glVertexAttribs1svNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs1svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); + VertexAttribs1svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs2dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = + __glGetProcAddress("glVertexAttribs2dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 @@ -4786,28 +4982,34 @@ __glXDisp_VertexAttribs2dvNV(GLbyte * pc) } #endif - glVertexAttribs2dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); + VertexAttribs2dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs2fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = + __glGetProcAddress("glVertexAttribs2fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs2fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); + VertexAttribs2fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs2svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = + __glGetProcAddress("glVertexAttribs2svNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs2svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); + VertexAttribs2svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs3dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = + __glGetProcAddress("glVertexAttribs3dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 @@ -4819,28 +5021,34 @@ __glXDisp_VertexAttribs3dvNV(GLbyte * pc) } #endif - glVertexAttribs3dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); + VertexAttribs3dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs3fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = + __glGetProcAddress("glVertexAttribs3fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs3fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); + VertexAttribs3fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs3svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = + __glGetProcAddress("glVertexAttribs3svNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs3svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); + VertexAttribs3svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs4dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = + __glGetProcAddress("glVertexAttribs4dvNV"); const GLsizei n = *(GLsizei *) (pc + 4); #ifdef __GLX_ALIGN64 @@ -4852,35 +5060,43 @@ __glXDisp_VertexAttribs4dvNV(GLbyte * pc) } #endif - glVertexAttribs4dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); + VertexAttribs4dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8)); } void __glXDisp_VertexAttribs4fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = + __glGetProcAddress("glVertexAttribs4fvNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs4fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); + VertexAttribs4fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8)); } void __glXDisp_VertexAttribs4svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = + __glGetProcAddress("glVertexAttribs4svNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs4svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); + VertexAttribs4svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8)); } void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = + __glGetProcAddress("glVertexAttribs4ubvNV"); const GLsizei n = *(GLsizei *) (pc + 4); - glVertexAttribs4ubvNV(*(GLuint *) (pc + 0), n, (const GLubyte *) (pc + 8)); + VertexAttribs4ubvNV(*(GLuint *) (pc + 0), n, (const GLubyte *) (pc + 8)); } void __glXDisp_ActiveStencilFaceEXT(GLbyte * pc) { - glActiveStencilFaceEXT(*(GLenum *) (pc + 0)); + PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = + __glGetProcAddress("glActiveStencilFaceEXT"); + ActiveStencilFaceEXT(*(GLenum *) (pc + 0)); } diff --git a/xorg-server/glx/indirect_dispatch_swap.c b/xorg-server/glx/indirect_dispatch_swap.c index 974751461..647d0c985 100644 --- a/xorg-server/glx/indirect_dispatch_swap.c +++ b/xorg-server/glx/indirect_dispatch_swap.c @@ -3821,7 +3821,7 @@ __glXDispSwap_CopyTexSubImage3D(GLbyte * pc) void __glXDispSwap_ActiveTexture(GLbyte * pc) { - glActiveTexture((GLenum) bswap_ENUM(pc + 0)); + glActiveTextureARB((GLenum) bswap_ENUM(pc + 0)); } void @@ -3834,8 +3834,8 @@ __glXDispSwap_MultiTexCoord1dv(GLbyte * pc) } #endif - glMultiTexCoord1dv((GLenum) bswap_ENUM(pc + 8), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), + glMultiTexCoord1dvARB((GLenum) bswap_ENUM(pc + 8), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } @@ -3850,17 +3850,17 @@ __glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc) void __glXDispSwap_MultiTexCoord1iv(GLbyte * pc) { - glMultiTexCoord1iv((GLenum) bswap_ENUM(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), - 1)); + glMultiTexCoord1ivARB((GLenum) bswap_ENUM(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), + 1)); } void __glXDispSwap_MultiTexCoord1sv(GLbyte * pc) { - glMultiTexCoord1sv((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 1)); + glMultiTexCoord1svARB((GLenum) bswap_ENUM(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 1)); } void @@ -3873,9 +3873,9 @@ __glXDispSwap_MultiTexCoord2dv(GLbyte * pc) } #endif - glMultiTexCoord2dv((GLenum) bswap_ENUM(pc + 16), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 2)); + glMultiTexCoord2dvARB((GLenum) bswap_ENUM(pc + 16), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), + 2)); } void @@ -3889,17 +3889,17 @@ __glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc) void __glXDispSwap_MultiTexCoord2iv(GLbyte * pc) { - glMultiTexCoord2iv((GLenum) bswap_ENUM(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), - 2)); + glMultiTexCoord2ivARB((GLenum) bswap_ENUM(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), + 2)); } void __glXDispSwap_MultiTexCoord2sv(GLbyte * pc) { - glMultiTexCoord2sv((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 2)); + glMultiTexCoord2svARB((GLenum) bswap_ENUM(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 2)); } void @@ -3912,9 +3912,9 @@ __glXDispSwap_MultiTexCoord3dv(GLbyte * pc) } #endif - glMultiTexCoord3dv((GLenum) bswap_ENUM(pc + 24), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 3)); + glMultiTexCoord3dvARB((GLenum) bswap_ENUM(pc + 24), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), + 3)); } void @@ -3928,17 +3928,17 @@ __glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc) void __glXDispSwap_MultiTexCoord3iv(GLbyte * pc) { - glMultiTexCoord3iv((GLenum) bswap_ENUM(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), - 3)); + glMultiTexCoord3ivARB((GLenum) bswap_ENUM(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), + 3)); } void __glXDispSwap_MultiTexCoord3sv(GLbyte * pc) { - glMultiTexCoord3sv((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 3)); + glMultiTexCoord3svARB((GLenum) bswap_ENUM(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 3)); } void @@ -3951,9 +3951,9 @@ __glXDispSwap_MultiTexCoord4dv(GLbyte * pc) } #endif - glMultiTexCoord4dv((GLenum) bswap_ENUM(pc + 32), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), - 4)); + glMultiTexCoord4dvARB((GLenum) bswap_ENUM(pc + 32), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), + 4)); } void @@ -3967,124 +3967,141 @@ __glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc) void __glXDispSwap_MultiTexCoord4iv(GLbyte * pc) { - glMultiTexCoord4iv((GLenum) bswap_ENUM(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + glMultiTexCoord4ivARB((GLenum) bswap_ENUM(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), + 4)); } void __glXDispSwap_MultiTexCoord4sv(GLbyte * pc) { - glMultiTexCoord4sv((GLenum) bswap_ENUM(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + glMultiTexCoord4svARB((GLenum) bswap_ENUM(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 4)); } void __glXDispSwap_CompressedTexImage1D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D = + __glGetProcAddress("glCompressedTexImage1D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); - glCompressedTexImage1D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLsizei) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16), - imageSize, (const GLvoid *) (pc + 24)); + CompressedTexImage1D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLsizei) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16), + imageSize, (const GLvoid *) (pc + 24)); } void __glXDispSwap_CompressedTexImage2D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D = + __glGetProcAddress("glCompressedTexImage2D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 24); - glCompressedTexImage2D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLsizei) bswap_CARD32(pc + 12), - (GLsizei) bswap_CARD32(pc + 16), - (GLint) bswap_CARD32(pc + 20), - imageSize, (const GLvoid *) (pc + 28)); + CompressedTexImage2D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLsizei) bswap_CARD32(pc + 12), + (GLsizei) bswap_CARD32(pc + 16), + (GLint) bswap_CARD32(pc + 20), + imageSize, (const GLvoid *) (pc + 28)); } void __glXDispSwap_CompressedTexImage3D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D = + __glGetProcAddress("glCompressedTexImage3D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); - glCompressedTexImage3D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLsizei) bswap_CARD32(pc + 12), - (GLsizei) bswap_CARD32(pc + 16), - (GLsizei) bswap_CARD32(pc + 20), - (GLint) bswap_CARD32(pc + 24), - imageSize, (const GLvoid *) (pc + 32)); + CompressedTexImage3D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLsizei) bswap_CARD32(pc + 12), + (GLsizei) bswap_CARD32(pc + 16), + (GLsizei) bswap_CARD32(pc + 20), + (GLint) bswap_CARD32(pc + 24), + imageSize, (const GLvoid *) (pc + 32)); } void __glXDispSwap_CompressedTexSubImage1D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D = + __glGetProcAddress("glCompressedTexSubImage1D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 20); - glCompressedTexSubImage1D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLint) bswap_CARD32(pc + 8), - (GLsizei) bswap_CARD32(pc + 12), - (GLenum) bswap_ENUM(pc + 16), - imageSize, (const GLvoid *) (pc + 24)); + CompressedTexSubImage1D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLint) bswap_CARD32(pc + 8), + (GLsizei) bswap_CARD32(pc + 12), + (GLenum) bswap_ENUM(pc + 16), + imageSize, (const GLvoid *) (pc + 24)); } void __glXDispSwap_CompressedTexSubImage2D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D = + __glGetProcAddress("glCompressedTexSubImage2D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 28); - glCompressedTexSubImage2D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLint) bswap_CARD32(pc + 8), - (GLint) bswap_CARD32(pc + 12), - (GLsizei) bswap_CARD32(pc + 16), - (GLsizei) bswap_CARD32(pc + 20), - (GLenum) bswap_ENUM(pc + 24), - imageSize, (const GLvoid *) (pc + 32)); + CompressedTexSubImage2D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLint) bswap_CARD32(pc + 8), + (GLint) bswap_CARD32(pc + 12), + (GLsizei) bswap_CARD32(pc + 16), + (GLsizei) bswap_CARD32(pc + 20), + (GLenum) bswap_ENUM(pc + 24), + imageSize, (const GLvoid *) (pc + 32)); } void __glXDispSwap_CompressedTexSubImage3D(GLbyte * pc) { + PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D = + __glGetProcAddress("glCompressedTexSubImage3D"); const GLsizei imageSize = (GLsizei) bswap_CARD32(pc + 36); - glCompressedTexSubImage3D((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLint) bswap_CARD32(pc + 8), - (GLint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16), - (GLsizei) bswap_CARD32(pc + 20), - (GLsizei) bswap_CARD32(pc + 24), - (GLsizei) bswap_CARD32(pc + 28), - (GLenum) bswap_ENUM(pc + 32), - imageSize, (const GLvoid *) (pc + 40)); + CompressedTexSubImage3D((GLenum) bswap_ENUM(pc + 0), + (GLint) bswap_CARD32(pc + 4), + (GLint) bswap_CARD32(pc + 8), + (GLint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16), + (GLsizei) bswap_CARD32(pc + 20), + (GLsizei) bswap_CARD32(pc + 24), + (GLsizei) bswap_CARD32(pc + 28), + (GLenum) bswap_ENUM(pc + 32), + imageSize, (const GLvoid *) (pc + 40)); } void __glXDispSwap_SampleCoverage(GLbyte * pc) { - glSampleCoverage((GLclampf) bswap_FLOAT32(pc + 0), *(GLboolean *) (pc + 4)); + PFNGLSAMPLECOVERAGEPROC SampleCoverage = + __glGetProcAddress("glSampleCoverage"); + SampleCoverage((GLclampf) bswap_FLOAT32(pc + 0), *(GLboolean *) (pc + 4)); } void __glXDispSwap_BlendFuncSeparate(GLbyte * pc) { - glBlendFuncSeparate((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLenum) bswap_ENUM(pc + 12)); + PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate = + __glGetProcAddress("glBlendFuncSeparate"); + BlendFuncSeparate((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLenum) bswap_ENUM(pc + 12)); } void __glXDispSwap_FogCoorddv(GLbyte * pc) { + PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv"); + #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 8); @@ -4092,19 +4109,23 @@ __glXDispSwap_FogCoorddv(GLbyte * pc) } #endif - glFogCoorddv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); + FogCoorddv((const GLdouble *) bswap_64_array((uint64_t *) (pc + 0), 1)); } void __glXDispSwap_PointParameterf(GLbyte * pc) { - glPointParameterf((GLenum) bswap_ENUM(pc + 0), - (GLfloat) bswap_FLOAT32(pc + 4)); + PFNGLPOINTPARAMETERFPROC PointParameterf = + __glGetProcAddress("glPointParameterf"); + PointParameterf((GLenum) bswap_ENUM(pc + 0), + (GLfloat) bswap_FLOAT32(pc + 4)); } void __glXDispSwap_PointParameterfv(GLbyte * pc) { + PFNGLPOINTPARAMETERFVPROC PointParameterfv = + __glGetProcAddress("glPointParameterfv"); const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLfloat *params; @@ -4112,19 +4133,22 @@ __glXDispSwap_PointParameterfv(GLbyte * pc) (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), __glPointParameterfv_size(pname)); - glPointParameterfv(pname, params); + PointParameterfv(pname, params); } void __glXDispSwap_PointParameteri(GLbyte * pc) { - glPointParameteri((GLenum) bswap_ENUM(pc + 0), - (GLint) bswap_CARD32(pc + 4)); + PFNGLPOINTPARAMETERIPROC PointParameteri = + __glGetProcAddress("glPointParameteri"); + PointParameteri((GLenum) bswap_ENUM(pc + 0), (GLint) bswap_CARD32(pc + 4)); } void __glXDispSwap_PointParameteriv(GLbyte * pc) { + PFNGLPOINTPARAMETERIVPROC PointParameteriv = + __glGetProcAddress("glPointParameteriv"); const GLenum pname = (GLenum) bswap_ENUM(pc + 0); const GLint *params; @@ -4132,18 +4156,22 @@ __glXDispSwap_PointParameteriv(GLbyte * pc) (const GLint *) bswap_32_array((uint32_t *) (pc + 4), __glPointParameteriv_size(pname)); - glPointParameteriv(pname, params); + PointParameteriv(pname, params); } void __glXDispSwap_SecondaryColor3bv(GLbyte * pc) { - glSecondaryColor3bv((const GLbyte *) (pc + 0)); + PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv = + __glGetProcAddress("glSecondaryColor3bv"); + SecondaryColor3bv((const GLbyte *) (pc + 0)); } void __glXDispSwap_SecondaryColor3dv(GLbyte * pc) { + PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv = + __glGetProcAddress("glSecondaryColor3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 24); @@ -4151,59 +4179,74 @@ __glXDispSwap_SecondaryColor3dv(GLbyte * pc) } #endif - glSecondaryColor3dv((const GLdouble *) - bswap_64_array((uint64_t *) (pc + 0), 3)); + SecondaryColor3dv((const GLdouble *) + bswap_64_array((uint64_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3iv(GLbyte * pc) { - glSecondaryColor3iv((const GLint *) - bswap_32_array((uint32_t *) (pc + 0), 3)); + PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv = + __glGetProcAddress("glSecondaryColor3iv"); + SecondaryColor3iv((const GLint *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3sv(GLbyte * pc) { - glSecondaryColor3sv((const GLshort *) - bswap_16_array((uint16_t *) (pc + 0), 3)); + PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv = + __glGetProcAddress("glSecondaryColor3sv"); + SecondaryColor3sv((const GLshort *) + bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3ubv(GLbyte * pc) { - glSecondaryColor3ubv((const GLubyte *) (pc + 0)); + PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv = + __glGetProcAddress("glSecondaryColor3ubv"); + SecondaryColor3ubv((const GLubyte *) (pc + 0)); } void __glXDispSwap_SecondaryColor3uiv(GLbyte * pc) { - glSecondaryColor3uiv((const GLuint *) - bswap_32_array((uint32_t *) (pc + 0), 3)); + PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv = + __glGetProcAddress("glSecondaryColor3uiv"); + SecondaryColor3uiv((const GLuint *) + bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_SecondaryColor3usv(GLbyte * pc) { - glSecondaryColor3usv((const GLushort *) - bswap_16_array((uint16_t *) (pc + 0), 3)); + PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv = + __glGetProcAddress("glSecondaryColor3usv"); + SecondaryColor3usv((const GLushort *) + bswap_16_array((uint16_t *) (pc + 0), 3)); } void __glXDispSwap_WindowPos3fv(GLbyte * pc) { - glWindowPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); + PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv"); + + WindowPos3fv((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_BeginQuery(GLbyte * pc) { - glBeginQuery((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); + PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery"); + + BeginQuery((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } int __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc) { + PFNGLDELETEQUERIESPROC DeleteQueries = + __glGetProcAddress("glDeleteQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4213,9 +4256,9 @@ __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); - glDeleteQueries(n, - (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), - 0)); + DeleteQueries(n, + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), + 0)); error = Success; } @@ -4225,12 +4268,15 @@ __glXDispSwap_DeleteQueries(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_EndQuery(GLbyte * pc) { - glEndQuery((GLenum) bswap_ENUM(pc + 0)); + PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery"); + + EndQuery((GLenum) bswap_ENUM(pc + 0)); } int __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4244,7 +4290,7 @@ __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc) GLuint *ids = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenQueries(n, ids); + GenQueries(n, ids); (void) bswap_32_array((uint32_t *) ids, n); __glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0); error = Success; @@ -4256,6 +4302,8 @@ __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv = + __glGetProcAddress("glGetQueryObjectiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4275,7 +4323,7 @@ __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryObjectiv((GLuint) bswap_CARD32(pc + 0), pname, params); + GetQueryObjectiv((GLuint) bswap_CARD32(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; @@ -4287,6 +4335,8 @@ __glXDispSwap_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv = + __glGetProcAddress("glGetQueryObjectuiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4306,7 +4356,7 @@ __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryObjectuiv((GLuint) bswap_CARD32(pc + 0), pname, params); + GetQueryObjectuiv((GLuint) bswap_CARD32(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; @@ -4318,6 +4368,7 @@ __glXDispSwap_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4337,7 +4388,7 @@ __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetQueryiv((GLenum) bswap_ENUM(pc + 0), pname, params); + GetQueryiv((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; @@ -4349,6 +4400,7 @@ __glXDispSwap_GetQueryiv(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc) { + PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery"); xGLXSingleReq *const req = (xGLXSingleReq *) pc; int error; __GLXcontext *const cx = @@ -4358,7 +4410,7 @@ __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsQuery((GLuint) bswap_CARD32(pc + 0)); + retval = IsQuery((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4369,21 +4421,26 @@ __glXDispSwap_IsQuery(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_BlendEquationSeparate(GLbyte * pc) { - glBlendEquationSeparate((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4)); + PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate = + __glGetProcAddress("glBlendEquationSeparate"); + BlendEquationSeparate((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_DrawBuffers(GLbyte * pc) { + PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); - glDrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0)); + DrawBuffers(n, (const GLenum *) bswap_32_array((uint32_t *) (pc + 4), 0)); } void __glXDispSwap_VertexAttrib1dv(GLbyte * pc) { + PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv = + __glGetProcAddress("glVertexAttrib1dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); @@ -4391,22 +4448,25 @@ __glXDispSwap_VertexAttrib1dv(GLbyte * pc) } #endif - glVertexAttrib1dv((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 1)); + VertexAttrib1dv((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 1)); } void __glXDispSwap_VertexAttrib1sv(GLbyte * pc) { - glVertexAttrib1sv((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 1)); + PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv = + __glGetProcAddress("glVertexAttrib1sv"); + VertexAttrib1sv((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 1)); } void __glXDispSwap_VertexAttrib2dv(GLbyte * pc) { + PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv = + __glGetProcAddress("glVertexAttrib2dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); @@ -4414,22 +4474,25 @@ __glXDispSwap_VertexAttrib2dv(GLbyte * pc) } #endif - glVertexAttrib2dv((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 2)); + VertexAttrib2dv((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 2)); } void __glXDispSwap_VertexAttrib2sv(GLbyte * pc) { - glVertexAttrib2sv((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 2)); + PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv = + __glGetProcAddress("glVertexAttrib2sv"); + VertexAttrib2sv((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 2)); } void __glXDispSwap_VertexAttrib3dv(GLbyte * pc) { + PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv = + __glGetProcAddress("glVertexAttrib3dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); @@ -4437,74 +4500,89 @@ __glXDispSwap_VertexAttrib3dv(GLbyte * pc) } #endif - glVertexAttrib3dv((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 3)); + VertexAttrib3dv((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 3)); } void __glXDispSwap_VertexAttrib3sv(GLbyte * pc) { - glVertexAttrib3sv((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 3)); + PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv = + __glGetProcAddress("glVertexAttrib3sv"); + VertexAttrib3sv((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 3)); } void __glXDispSwap_VertexAttrib4Nbv(GLbyte * pc) { - glVertexAttrib4Nbv((GLuint) bswap_CARD32(pc + 0), - (const GLbyte *) (pc + 4)); + PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv = + __glGetProcAddress("glVertexAttrib4Nbv"); + VertexAttrib4Nbv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4Niv(GLbyte * pc) { - glVertexAttrib4Niv((GLuint) bswap_CARD32(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv = + __glGetProcAddress("glVertexAttrib4Niv"); + VertexAttrib4Niv((GLuint) bswap_CARD32(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4Nsv(GLbyte * pc) { - glVertexAttrib4Nsv((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv = + __glGetProcAddress("glVertexAttrib4Nsv"); + VertexAttrib4Nsv((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4Nubv(GLbyte * pc) { - glVertexAttrib4Nubv((GLuint) bswap_CARD32(pc + 0), - (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv = + __glGetProcAddress("glVertexAttrib4Nubv"); + VertexAttrib4Nubv((GLuint) bswap_CARD32(pc + 0), + (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4Nuiv(GLbyte * pc) { - glVertexAttrib4Nuiv((GLuint) bswap_CARD32(pc + 0), - (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv = + __glGetProcAddress("glVertexAttrib4Nuiv"); + VertexAttrib4Nuiv((GLuint) bswap_CARD32(pc + 0), + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4Nusv(GLbyte * pc) { - glVertexAttrib4Nusv((GLuint) bswap_CARD32(pc + 0), - (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv = + __glGetProcAddress("glVertexAttrib4Nusv"); + VertexAttrib4Nusv((GLuint) bswap_CARD32(pc + 0), + (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4bv(GLbyte * pc) { - glVertexAttrib4bv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); + PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv = + __glGetProcAddress("glVertexAttrib4bv"); + VertexAttrib4bv((GLuint) bswap_CARD32(pc + 0), (const GLbyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4dv(GLbyte * pc) { + PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv = + __glGetProcAddress("glVertexAttrib4dv"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); @@ -4512,65 +4590,77 @@ __glXDispSwap_VertexAttrib4dv(GLbyte * pc) } #endif - glVertexAttrib4dv((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 4)); + VertexAttrib4dv((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4iv(GLbyte * pc) { - glVertexAttrib4iv((GLuint) bswap_CARD32(pc + 0), - (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); + PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv = + __glGetProcAddress("glVertexAttrib4iv"); + VertexAttrib4iv((GLuint) bswap_CARD32(pc + 0), + (const GLint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4sv(GLbyte * pc) { - glVertexAttrib4sv((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv = + __glGetProcAddress("glVertexAttrib4sv"); + VertexAttrib4sv((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4ubv(GLbyte * pc) { - glVertexAttrib4ubv((GLuint) bswap_CARD32(pc + 0), - (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv = + __glGetProcAddress("glVertexAttrib4ubv"); + VertexAttrib4ubv((GLuint) bswap_CARD32(pc + 0), (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttrib4uiv(GLbyte * pc) { - glVertexAttrib4uiv((GLuint) bswap_CARD32(pc + 0), - (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv = + __glGetProcAddress("glVertexAttrib4uiv"); + VertexAttrib4uiv((GLuint) bswap_CARD32(pc + 0), + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), 4)); } void __glXDispSwap_VertexAttrib4usv(GLbyte * pc) { - glVertexAttrib4usv((GLuint) bswap_CARD32(pc + 0), - (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv = + __glGetProcAddress("glVertexAttrib4usv"); + VertexAttrib4usv((GLuint) bswap_CARD32(pc + 0), + (const GLushort *) bswap_16_array((uint16_t *) (pc + 4), + 4)); } void __glXDispSwap_ClampColor(GLbyte * pc) { - glClampColor((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); + PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor"); + + ClampColor((GLenum) bswap_ENUM(pc + 0), (GLenum) bswap_ENUM(pc + 4)); } void __glXDispSwap_BindProgramARB(GLbyte * pc) { - glBindProgramARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4)); + PFNGLBINDPROGRAMARBPROC BindProgramARB = + __glGetProcAddress("glBindProgramARB"); + BindProgramARB((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } int __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB = + __glGetProcAddress("glDeleteProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4580,9 +4670,9 @@ __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); - glDeleteProgramsARB(n, - (const GLuint *) - bswap_32_array((uint32_t *) (pc + 4), 0)); + DeleteProgramsARB(n, + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), + 0)); error = Success; } @@ -4592,6 +4682,8 @@ __glXDispSwap_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENPROGRAMSARBPROC GenProgramsARB = + __glGetProcAddress("glGenProgramsARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4605,7 +4697,7 @@ __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) GLuint *programs = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenProgramsARB(n, programs); + GenProgramsARB(n, programs); (void) bswap_32_array((uint32_t *) programs, n); __glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0); error = Success; @@ -4617,6 +4709,8 @@ __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB = + __glGetProcAddress("glGetProgramEnvParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4626,8 +4720,8 @@ __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLdouble params[4]; - glGetProgramEnvParameterdvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), params); + GetProgramEnvParameterdvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_64_array((uint64_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; @@ -4639,6 +4733,8 @@ __glXDispSwap_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB = + __glGetProcAddress("glGetProgramEnvParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4648,8 +4744,8 @@ __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLfloat params[4]; - glGetProgramEnvParameterfvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), params); + GetProgramEnvParameterfvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; @@ -4661,6 +4757,8 @@ __glXDispSwap_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB = + __glGetProcAddress("glGetProgramLocalParameterdvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4670,8 +4768,8 @@ __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLdouble params[4]; - glGetProgramLocalParameterdvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), params); + GetProgramLocalParameterdvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_64_array((uint64_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 8, GL_FALSE, 0); error = Success; @@ -4683,6 +4781,8 @@ __glXDispSwap_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB = + __glGetProcAddress("glGetProgramLocalParameterfvARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4692,8 +4792,8 @@ __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLfloat params[4]; - glGetProgramLocalParameterfvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), params); + GetProgramLocalParameterfvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 4); __glXSendReplySwap(cl->client, params, 4, 4, GL_FALSE, 0); error = Success; @@ -4705,6 +4805,8 @@ __glXDispSwap_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETPROGRAMIVARBPROC GetProgramivARB = + __glGetProcAddress("glGetProgramivARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4724,7 +4826,7 @@ __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) return BadAlloc; __glXClearErrorOccured(); - glGetProgramivARB((GLenum) bswap_ENUM(pc + 0), pname, params); + GetProgramivARB((GLenum) bswap_ENUM(pc + 0), pname, params); (void) bswap_32_array((uint32_t *) params, compsize); __glXSendReplySwap(cl->client, params, compsize, 4, GL_FALSE, 0); error = Success; @@ -4736,6 +4838,7 @@ __glXDispSwap_GetProgramivARB(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc) { + PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4745,7 +4848,7 @@ __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsProgramARB((GLuint) bswap_CARD32(pc + 0)); + retval = IsProgramARB((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4756,6 +4859,8 @@ __glXDispSwap_IsProgramARB(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc) { + PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB = + __glGetProcAddress("glProgramEnvParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); @@ -4763,24 +4868,28 @@ __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc) } #endif - glProgramEnvParameter4dvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 4)); + ProgramEnvParameter4dvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramEnvParameter4fvARB(GLbyte * pc) { - glProgramEnvParameter4fvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), - (const GLfloat *) - bswap_32_array((uint32_t *) (pc + 8), 4)); + PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB = + __glGetProcAddress("glProgramEnvParameter4fvARB"); + ProgramEnvParameter4fvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), + (const GLfloat *) + bswap_32_array((uint32_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc) { + PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB = + __glGetProcAddress("glProgramLocalParameter4dvARB"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 40); @@ -4788,95 +4897,112 @@ __glXDispSwap_ProgramLocalParameter4dvARB(GLbyte * pc) } #endif - glProgramLocalParameter4dvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 4)); + ProgramLocalParameter4dvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), + (const GLdouble *) + bswap_64_array((uint64_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramLocalParameter4fvARB(GLbyte * pc) { - glProgramLocalParameter4fvARB((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4), - (const GLfloat *) - bswap_32_array((uint32_t *) (pc + 8), 4)); + PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB = + __glGetProcAddress("glProgramLocalParameter4fvARB"); + ProgramLocalParameter4fvARB((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4), + (const GLfloat *) + bswap_32_array((uint32_t *) (pc + 8), 4)); } void __glXDispSwap_ProgramStringARB(GLbyte * pc) { + PFNGLPROGRAMSTRINGARBPROC ProgramStringARB = + __glGetProcAddress("glProgramStringARB"); const GLsizei len = (GLsizei) bswap_CARD32(pc + 8); - glProgramStringARB((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - len, (const GLvoid *) (pc + 12)); + ProgramStringARB((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + len, (const GLvoid *) (pc + 12)); } void __glXDispSwap_VertexAttrib1fvARB(GLbyte * pc) { - glVertexAttrib1fvARB((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 1)); + PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB = + __glGetProcAddress("glVertexAttrib1fvARB"); + VertexAttrib1fvARB((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 1)); } void __glXDispSwap_VertexAttrib2fvARB(GLbyte * pc) { - glVertexAttrib2fvARB((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 2)); + PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB = + __glGetProcAddress("glVertexAttrib2fvARB"); + VertexAttrib2fvARB((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 2)); } void __glXDispSwap_VertexAttrib3fvARB(GLbyte * pc) { - glVertexAttrib3fvARB((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 3)); + PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB = + __glGetProcAddress("glVertexAttrib3fvARB"); + VertexAttrib3fvARB((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 3)); } void __glXDispSwap_VertexAttrib4fvARB(GLbyte * pc) { - glVertexAttrib4fvARB((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB = + __glGetProcAddress("glVertexAttrib4fvARB"); + VertexAttrib4fvARB((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 4)); } void __glXDispSwap_BindFramebuffer(GLbyte * pc) { - glBindFramebuffer((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4)); + PFNGLBINDFRAMEBUFFERPROC BindFramebuffer = + __glGetProcAddress("glBindFramebuffer"); + BindFramebuffer((GLenum) bswap_ENUM(pc + 0), (GLuint) bswap_CARD32(pc + 4)); } void __glXDispSwap_BindRenderbuffer(GLbyte * pc) { - glBindRenderbuffer((GLenum) bswap_ENUM(pc + 0), - (GLuint) bswap_CARD32(pc + 4)); + PFNGLBINDRENDERBUFFERPROC BindRenderbuffer = + __glGetProcAddress("glBindRenderbuffer"); + BindRenderbuffer((GLenum) bswap_ENUM(pc + 0), + (GLuint) bswap_CARD32(pc + 4)); } void __glXDispSwap_BlitFramebuffer(GLbyte * pc) { - glBlitFramebuffer((GLint) bswap_CARD32(pc + 0), - (GLint) bswap_CARD32(pc + 4), - (GLint) bswap_CARD32(pc + 8), - (GLint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16), - (GLint) bswap_CARD32(pc + 20), - (GLint) bswap_CARD32(pc + 24), - (GLint) bswap_CARD32(pc + 28), - (GLbitfield) bswap_CARD32(pc + 32), - (GLenum) bswap_ENUM(pc + 36)); + PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer = + __glGetProcAddress("glBlitFramebuffer"); + BlitFramebuffer((GLint) bswap_CARD32(pc + 0), (GLint) bswap_CARD32(pc + 4), + (GLint) bswap_CARD32(pc + 8), (GLint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16), + (GLint) bswap_CARD32(pc + 20), + (GLint) bswap_CARD32(pc + 24), + (GLint) bswap_CARD32(pc + 28), + (GLbitfield) bswap_CARD32(pc + 32), + (GLenum) bswap_ENUM(pc + 36)); } int __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) { + PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus = + __glGetProcAddress("glCheckFramebufferStatus"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4886,7 +5012,7 @@ __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLenum retval; - retval = glCheckFramebufferStatus((GLenum) bswap_ENUM(pc + 0)); + retval = CheckFramebufferStatus((GLenum) bswap_ENUM(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -4897,76 +5023,92 @@ __glXDispSwap_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_DeleteFramebuffers(GLbyte * pc) { + PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers = + __glGetProcAddress("glDeleteFramebuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); - glDeleteFramebuffers(n, - (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), - 0)); + DeleteFramebuffers(n, + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), + 0)); } void __glXDispSwap_DeleteRenderbuffers(GLbyte * pc) { + PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers = + __glGetProcAddress("glDeleteRenderbuffers"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 0); - glDeleteRenderbuffers(n, - (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), - 0)); + DeleteRenderbuffers(n, + (const GLuint *) bswap_32_array((uint32_t *) (pc + 4), + 0)); } void __glXDispSwap_FramebufferRenderbuffer(GLbyte * pc) { - glFramebufferRenderbuffer((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLuint) bswap_CARD32(pc + 12)); + PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer = + __glGetProcAddress("glFramebufferRenderbuffer"); + FramebufferRenderbuffer((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLuint) bswap_CARD32(pc + 12)); } void __glXDispSwap_FramebufferTexture1D(GLbyte * pc) { - glFramebufferTexture1D((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLuint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16)); + PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D = + __glGetProcAddress("glFramebufferTexture1D"); + FramebufferTexture1D((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLuint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16)); } void __glXDispSwap_FramebufferTexture2D(GLbyte * pc) { - glFramebufferTexture2D((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLuint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16)); + PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D = + __glGetProcAddress("glFramebufferTexture2D"); + FramebufferTexture2D((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLuint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16)); } void __glXDispSwap_FramebufferTexture3D(GLbyte * pc) { - glFramebufferTexture3D((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLuint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16), - (GLint) bswap_CARD32(pc + 20)); + PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D = + __glGetProcAddress("glFramebufferTexture3D"); + FramebufferTexture3D((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLuint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16), + (GLint) bswap_CARD32(pc + 20)); } void __glXDispSwap_FramebufferTextureLayer(GLbyte * pc) { - glFramebufferTextureLayer((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLuint) bswap_CARD32(pc + 8), - (GLint) bswap_CARD32(pc + 12), - (GLint) bswap_CARD32(pc + 16)); + PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer = + __glGetProcAddress("glFramebufferTextureLayer"); + FramebufferTextureLayer((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLuint) bswap_CARD32(pc + 8), + (GLint) bswap_CARD32(pc + 12), + (GLint) bswap_CARD32(pc + 16)); } int __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENFRAMEBUFFERSPROC GenFramebuffers = + __glGetProcAddress("glGenFramebuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -4980,7 +5122,7 @@ __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) GLuint *framebuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenFramebuffers(n, framebuffers); + GenFramebuffers(n, framebuffers); (void) bswap_32_array((uint32_t *) framebuffers, n); __glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0); error = Success; @@ -4992,6 +5134,8 @@ __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) { + PFNGLGENRENDERBUFFERSPROC GenRenderbuffers = + __glGetProcAddress("glGenRenderbuffers"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -5005,7 +5149,7 @@ __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) GLuint *renderbuffers = __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer), 4); - glGenRenderbuffers(n, renderbuffers); + GenRenderbuffers(n, renderbuffers); (void) bswap_32_array((uint32_t *) renderbuffers, n); __glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0); error = Success; @@ -5017,13 +5161,18 @@ __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_GenerateMipmap(GLbyte * pc) { - glGenerateMipmap((GLenum) bswap_ENUM(pc + 0)); + PFNGLGENERATEMIPMAPPROC GenerateMipmap = + __glGetProcAddress("glGenerateMipmap"); + GenerateMipmap((GLenum) bswap_ENUM(pc + 0)); } int __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC + GetFramebufferAttachmentParameteriv = + __glGetProcAddress("glGetFramebufferAttachmentParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -5033,10 +5182,10 @@ __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, if (cx != NULL) { GLint params[1]; - glGetFramebufferAttachmentParameteriv((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - params); + GetFramebufferAttachmentParameteriv((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + params); (void) bswap_32_array((uint32_t *) params, 1); __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; @@ -5048,6 +5197,8 @@ __glXDispSwap_GetFramebufferAttachmentParameteriv(__GLXclientState * cl, int __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) { + PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv = + __glGetProcAddress("glGetRenderbufferParameteriv"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -5057,8 +5208,8 @@ __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLint params[1]; - glGetRenderbufferParameteriv((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), params); + GetRenderbufferParameteriv((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), params); (void) bswap_32_array((uint32_t *) params, 1); __glXSendReplySwap(cl->client, params, 1, 4, GL_FALSE, 0); error = Success; @@ -5070,6 +5221,8 @@ __glXDispSwap_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) { + PFNGLISFRAMEBUFFERPROC IsFramebuffer = + __glGetProcAddress("glIsFramebuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -5079,7 +5232,7 @@ __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsFramebuffer((GLuint) bswap_CARD32(pc + 0)); + retval = IsFramebuffer((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -5090,6 +5243,8 @@ __glXDispSwap_IsFramebuffer(__GLXclientState * cl, GLbyte * pc) int __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) { + PFNGLISRENDERBUFFERPROC IsRenderbuffer = + __glGetProcAddress("glIsRenderbuffer"); xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc; int error; __GLXcontext *const cx = @@ -5099,7 +5254,7 @@ __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) if (cx != NULL) { GLboolean retval; - retval = glIsRenderbuffer((GLuint) bswap_CARD32(pc + 0)); + retval = IsRenderbuffer((GLuint) bswap_CARD32(pc + 0)); __glXSendReplySwap(cl->client, dummy_answer, 0, 0, GL_FALSE, retval); error = Success; } @@ -5110,38 +5265,48 @@ __glXDispSwap_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc) void __glXDispSwap_RenderbufferStorage(GLbyte * pc) { - glRenderbufferStorage((GLenum) bswap_ENUM(pc + 0), - (GLenum) bswap_ENUM(pc + 4), - (GLsizei) bswap_CARD32(pc + 8), - (GLsizei) bswap_CARD32(pc + 12)); + PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage = + __glGetProcAddress("glRenderbufferStorage"); + RenderbufferStorage((GLenum) bswap_ENUM(pc + 0), + (GLenum) bswap_ENUM(pc + 4), + (GLsizei) bswap_CARD32(pc + 8), + (GLsizei) bswap_CARD32(pc + 12)); } void __glXDispSwap_RenderbufferStorageMultisample(GLbyte * pc) { - glRenderbufferStorageMultisample((GLenum) bswap_ENUM(pc + 0), - (GLsizei) bswap_CARD32(pc + 4), - (GLenum) bswap_ENUM(pc + 8), - (GLsizei) bswap_CARD32(pc + 12), - (GLsizei) bswap_CARD32(pc + 16)); + PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample = + __glGetProcAddress("glRenderbufferStorageMultisample"); + RenderbufferStorageMultisample((GLenum) bswap_ENUM(pc + 0), + (GLsizei) bswap_CARD32(pc + 4), + (GLenum) bswap_ENUM(pc + 8), + (GLsizei) bswap_CARD32(pc + 12), + (GLsizei) bswap_CARD32(pc + 16)); } void __glXDispSwap_SecondaryColor3fvEXT(GLbyte * pc) { - glSecondaryColor3fvEXT((const GLfloat *) - bswap_32_array((uint32_t *) (pc + 0), 3)); + PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT = + __glGetProcAddress("glSecondaryColor3fvEXT"); + SecondaryColor3fvEXT((const GLfloat *) + bswap_32_array((uint32_t *) (pc + 0), 3)); } void __glXDispSwap_FogCoordfvEXT(GLbyte * pc) { - glFogCoordfvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); + PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT = + __glGetProcAddress("glFogCoordfvEXT"); + FogCoordfvEXT((const GLfloat *) bswap_32_array((uint32_t *) (pc + 0), 1)); } void __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV = + __glGetProcAddress("glVertexAttrib1dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 12); @@ -5149,30 +5314,36 @@ __glXDispSwap_VertexAttrib1dvNV(GLbyte * pc) } #endif - glVertexAttrib1dvNV((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 1)); + VertexAttrib1dvNV((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 1)); } void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc) { - glVertexAttrib1fvNV((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 1)); + PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV = + __glGetProcAddress("glVertexAttrib1fvNV"); + VertexAttrib1fvNV((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 1)); } void __glXDispSwap_VertexAttrib1svNV(GLbyte * pc) { - glVertexAttrib1svNV((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 1)); + PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV = + __glGetProcAddress("glVertexAttrib1svNV"); + VertexAttrib1svNV((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 1)); } void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV = + __glGetProcAddress("glVertexAttrib2dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 20); @@ -5180,30 +5351,36 @@ __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc) } #endif - glVertexAttrib2dvNV((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 2)); + VertexAttrib2dvNV((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 2)); } void __glXDispSwap_VertexAttrib2fvNV(GLbyte * pc) { - glVertexAttrib2fvNV((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 2)); + PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV = + __glGetProcAddress("glVertexAttrib2fvNV"); + VertexAttrib2fvNV((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 2)); } void __glXDispSwap_VertexAttrib2svNV(GLbyte * pc) { - glVertexAttrib2svNV((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 2)); + PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV = + __glGetProcAddress("glVertexAttrib2svNV"); + VertexAttrib2svNV((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 2)); } void __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV = + __glGetProcAddress("glVertexAttrib3dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 28); @@ -5211,30 +5388,36 @@ __glXDispSwap_VertexAttrib3dvNV(GLbyte * pc) } #endif - glVertexAttrib3dvNV((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 3)); + VertexAttrib3dvNV((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 3)); } void __glXDispSwap_VertexAttrib3fvNV(GLbyte * pc) { - glVertexAttrib3fvNV((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 3)); + PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV = + __glGetProcAddress("glVertexAttrib3fvNV"); + VertexAttrib3fvNV((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 3)); } void __glXDispSwap_VertexAttrib3svNV(GLbyte * pc) { - glVertexAttrib3svNV((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 3)); + PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV = + __glGetProcAddress("glVertexAttrib3svNV"); + VertexAttrib3svNV((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 3)); } void __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV = + __glGetProcAddress("glVertexAttrib4dvNV"); #ifdef __GLX_ALIGN64 if ((unsigned long) (pc) & 7) { (void) memmove(pc - 4, pc, 36); @@ -5242,37 +5425,45 @@ __glXDispSwap_VertexAttrib4dvNV(GLbyte * pc) } #endif - glVertexAttrib4dvNV((GLuint) bswap_CARD32(pc + 0), - (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), - 4)); + VertexAttrib4dvNV((GLuint) bswap_CARD32(pc + 0), + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4fvNV(GLbyte * pc) { - glVertexAttrib4fvNV((GLuint) bswap_CARD32(pc + 0), - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV = + __glGetProcAddress("glVertexAttrib4fvNV"); + VertexAttrib4fvNV((GLuint) bswap_CARD32(pc + 0), + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4svNV(GLbyte * pc) { - glVertexAttrib4svNV((GLuint) bswap_CARD32(pc + 0), - (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), - 4)); + PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV = + __glGetProcAddress("glVertexAttrib4svNV"); + VertexAttrib4svNV((GLuint) bswap_CARD32(pc + 0), + (const GLshort *) bswap_16_array((uint16_t *) (pc + 4), + 4)); } void __glXDispSwap_VertexAttrib4ubvNV(GLbyte * pc) { - glVertexAttrib4ubvNV((GLuint) bswap_CARD32(pc + 0), - (const GLubyte *) (pc + 4)); + PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV = + __glGetProcAddress("glVertexAttrib4ubvNV"); + VertexAttrib4ubvNV((GLuint) bswap_CARD32(pc + 0), + (const GLubyte *) (pc + 4)); } void __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV = + __glGetProcAddress("glVertexAttribs1dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 @@ -5284,37 +5475,43 @@ __glXDispSwap_VertexAttribs1dvNV(GLbyte * pc) } #endif - glVertexAttribs1dvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 0)); + VertexAttribs1dvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs1fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV = + __glGetProcAddress("glVertexAttribs1fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs1fvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), - 0)); + VertexAttribs1fvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs1svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV = + __glGetProcAddress("glVertexAttribs1svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs1svNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), - 0)); + VertexAttribs1svNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV = + __glGetProcAddress("glVertexAttribs2dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 @@ -5326,37 +5523,43 @@ __glXDispSwap_VertexAttribs2dvNV(GLbyte * pc) } #endif - glVertexAttribs2dvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 0)); + VertexAttribs2dvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV = + __glGetProcAddress("glVertexAttribs2fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs2fvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), - 0)); + VertexAttribs2fvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs2svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV = + __glGetProcAddress("glVertexAttribs2svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs2svNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), - 0)); + VertexAttribs2svNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV = + __glGetProcAddress("glVertexAttribs3dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 @@ -5368,37 +5571,43 @@ __glXDispSwap_VertexAttribs3dvNV(GLbyte * pc) } #endif - glVertexAttribs3dvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 0)); + VertexAttribs3dvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs3fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV = + __glGetProcAddress("glVertexAttribs3fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs3fvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), - 0)); + VertexAttribs3fvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs3svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV = + __glGetProcAddress("glVertexAttribs3svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs3svNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), - 0)); + VertexAttribs3svNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV = + __glGetProcAddress("glVertexAttribs4dvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); #ifdef __GLX_ALIGN64 @@ -5410,45 +5619,53 @@ __glXDispSwap_VertexAttribs4dvNV(GLbyte * pc) } #endif - glVertexAttribs4dvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLdouble *) - bswap_64_array((uint64_t *) (pc + 8), 0)); + VertexAttribs4dvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLdouble *) bswap_64_array((uint64_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs4fvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV = + __glGetProcAddress("glVertexAttribs4fvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs4fvNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), - 0)); + VertexAttribs4fvNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLfloat *) bswap_32_array((uint32_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs4svNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV = + __glGetProcAddress("glVertexAttribs4svNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs4svNV((GLuint) bswap_CARD32(pc + 0), - n, - (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), - 0)); + VertexAttribs4svNV((GLuint) bswap_CARD32(pc + 0), + n, + (const GLshort *) bswap_16_array((uint16_t *) (pc + 8), + 0)); } void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc) { + PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV = + __glGetProcAddress("glVertexAttribs4ubvNV"); const GLsizei n = (GLsizei) bswap_CARD32(pc + 4); - glVertexAttribs4ubvNV((GLuint) bswap_CARD32(pc + 0), - n, (const GLubyte *) (pc + 8)); + VertexAttribs4ubvNV((GLuint) bswap_CARD32(pc + 0), + n, (const GLubyte *) (pc + 8)); } void __glXDispSwap_ActiveStencilFaceEXT(GLbyte * pc) { - glActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0)); + PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT = + __glGetProcAddress("glActiveStencilFaceEXT"); + ActiveStencilFaceEXT((GLenum) bswap_ENUM(pc + 0)); } diff --git a/xorg-server/glx/indirect_program.c b/xorg-server/glx/indirect_program.c index db22d845d..fa4a2408b 100644 --- a/xorg-server/glx/indirect_program.c +++ b/xorg-server/glx/indirect_program.c @@ -104,29 +104,43 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc, int __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) { - return DoGetProgramString(cl, pc, glGetProgramivARB, - glGetProgramStringARB, False); + PFNGLGETPROGRAMIVARBPROC get_program = + __glGetProcAddress("glGetProgramivARB"); + PFNGLGETPROGRAMSTRINGARBPROC get_program_string = + __glGetProcAddress("glGetProgramStringARB"); + + return DoGetProgramString(cl, pc, get_program, get_program_string, False); } int __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc) { - return DoGetProgramString(cl, pc, glGetProgramivARB, - glGetProgramStringARB, True); + PFNGLGETPROGRAMIVARBPROC get_program = + __glGetProcAddress("glGetProgramivARB"); + PFNGLGETPROGRAMSTRINGARBPROC get_program_string = + __glGetProcAddress("glGetProgramStringARB"); + + return DoGetProgramString(cl, pc, get_program, get_program_string, True); } int __glXDisp_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte * pc) { - return DoGetProgramString(cl, pc, (PFNGLGETPROGRAMIVARBPROC)glGetProgramivNV, - (PFNGLGETPROGRAMSTRINGARBPROC)glGetProgramStringNV, - False); + PFNGLGETPROGRAMIVARBPROC get_program = + __glGetProcAddress("glGetProgramivARB"); + PFNGLGETPROGRAMSTRINGARBPROC get_program_string = + __glGetProcAddress("glGetProgramStringARB"); + + return DoGetProgramString(cl, pc, get_program, get_program_string, False); } int __glXDispSwap_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte * pc) { - return DoGetProgramString(cl, pc, (PFNGLGETPROGRAMIVARBPROC)glGetProgramivNV, - (PFNGLGETPROGRAMSTRINGARBPROC)glGetProgramStringNV, - True); + PFNGLGETPROGRAMIVARBPROC get_program = + __glGetProcAddress("glGetProgramivARB"); + PFNGLGETPROGRAMSTRINGARBPROC get_program_string = + __glGetProcAddress("glGetProgramStringARB"); + + return DoGetProgramString(cl, pc, get_program, get_program_string, True); } diff --git a/xorg-server/glx/render2.c b/xorg-server/glx/render2.c index 5a2f4827e..8d9b5f4d2 100644 --- a/xorg-server/glx/render2.c +++ b/xorg-server/glx/render2.c @@ -231,13 +231,21 @@ __glXDisp_DrawArrays(GLbyte * pc) glEdgeFlagPointer(stride, (const GLboolean *) pc); break; case GL_SECONDARY_COLOR_ARRAY: + { + PFNGLSECONDARYCOLORPOINTERPROC SecondaryColorPointerEXT = + __glGetProcAddress("glSecondaryColorPointerEXT"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - glSecondaryColorPointerEXT(numVals, datatype, stride, pc); + SecondaryColorPointerEXT(numVals, datatype, stride, pc); break; + } case GL_FOG_COORD_ARRAY: + { + PFNGLFOGCOORDPOINTERPROC FogCoordPointerEXT = + __glGetProcAddress("glFogCoordPointerEXT"); glEnableClientState(GL_FOG_COORD_ARRAY); - glFogCoordPointerEXT(datatype, stride, pc); + FogCoordPointerEXT(datatype, stride, pc); break; + } default: break; } diff --git a/xorg-server/glx/render2swap.c b/xorg-server/glx/render2swap.c index e6f73b896..6ed364f75 100644 --- a/xorg-server/glx/render2swap.c +++ b/xorg-server/glx/render2swap.c @@ -353,13 +353,21 @@ __glXDispSwap_DrawArrays(GLbyte * pc) glEdgeFlagPointer(stride, (const GLboolean *) pc); break; case GL_SECONDARY_COLOR_ARRAY: + { + PFNGLSECONDARYCOLORPOINTERPROC SecondaryColorPointerEXT = + __glGetProcAddress("glSecondaryColorPointerEXT"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY); - glSecondaryColorPointerEXT(numVals, datatype, stride, pc); + SecondaryColorPointerEXT(numVals, datatype, stride, pc); break; + } case GL_FOG_COORD_ARRAY: + { + PFNGLFOGCOORDPOINTERPROC FogCoordPointerEXT = + __glGetProcAddress("glFogCoordPointerEXT"); glEnableClientState(GL_FOG_COORD_ARRAY); - glFogCoordPointerEXT(datatype, stride, pc); + FogCoordPointerEXT(datatype, stride, pc); break; + } default: break; } diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c index ef4b3210c..b2a79855c 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyr.c +++ b/xorg-server/hw/kdrive/ephyr/ephyr.c @@ -943,7 +943,7 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev) #ifdef XF86DRI EphyrWindowPair *pair = NULL; #endif - EPHYR_LOG("enqueuing mouse motion:%d\n", ephyrCurScreen); + EPHYR_LOG("enqueuing mouse motion:%d\n", screen->pScreen->myNum); x = motion->event_x; y = motion->event_y; EPHYR_LOG("initial (x,y):(%d,%d)\n", x, y); @@ -977,7 +977,7 @@ ephyrProcessButtonPress(xcb_generic_event_t *xev) if (!ephyrMouse || !((EphyrPointerPrivate *) ephyrMouse->driverPrivate)->enabled) { - EPHYR_LOG("skipping mouse press:%d\n", ephyrCurScreen); + EPHYR_LOG("skipping mouse press:%d\n", screen_from_window(button->event)->pScreen->myNum); return; } @@ -987,7 +987,7 @@ ephyrProcessButtonPress(xcb_generic_event_t *xev) */ mouseState |= 1 << (button->detail - 1); - EPHYR_LOG("enqueuing mouse press:%d\n", ephyrCurScreen); + EPHYR_LOG("enqueuing mouse press:%d\n", screen_from_window(button->event)->pScreen->myNum); KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_MOUSE_DELTA, 0, 0, 0); } @@ -1004,7 +1004,7 @@ ephyrProcessButtonRelease(xcb_generic_event_t *xev) ephyrUpdateModifierState(button->state); mouseState &= ~(1 << (button->detail - 1)); - EPHYR_LOG("enqueuing mouse release:%d\n", ephyrCurScreen); + EPHYR_LOG("enqueuing mouse release:%d\n", screen_from_window(button->event)->pScreen->myNum); KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_MOUSE_DELTA, 0, 0, 0); } diff --git a/xorg-server/hw/xfree86/common/xf86AutoConfig.c b/xorg-server/hw/xfree86/common/xf86AutoConfig.c index 95d58fe43..af2b7f8f2 100644 --- a/xorg-server/hw/xfree86/common/xf86AutoConfig.c +++ b/xorg-server/hw/xfree86/common/xf86AutoConfig.c @@ -267,14 +267,6 @@ listPossibleVideoDrivers(char *matches[], int nmatches) if (i < (nmatches - 1)) i = xf86PciMatchDriver(matches, nmatches); #endif - /* Fallback to platform default hardware */ - if (i < (nmatches - 1)) { -#if defined(__i386__) || defined(__amd64__) || defined(__hurd__) - matches[i++] = xnfstrdup("vesa"); -#elif defined(__sparc__) && !defined(sun) - matches[i++] = xnfstrdup("sunffb"); -#endif - } #if defined(__linux__) matches[i++] = xnfstrdup("modesetting"); @@ -290,6 +282,15 @@ listPossibleVideoDrivers(char *matches[], int nmatches) #endif } #endif /* !sun */ + + /* Fallback to platform default hardware */ + if (i < (nmatches - 1)) { +#if defined(__i386__) || defined(__amd64__) || defined(__hurd__) + matches[i++] = xnfstrdup("vesa"); +#elif defined(__sparc__) && !defined(sun) + matches[i++] = xnfstrdup("sunffb"); +#endif + } } /* copy a screen section and enter the desired driver diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c index 74d5ed3b7..b5efc02af 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.c +++ b/xorg-server/hw/xfree86/common/xf86Config.c @@ -507,7 +507,7 @@ xf86InputDriverlistFromConfig(void) static void fixup_video_driver_list(char **drivers) { - static const char *fallback[4] = { "vesa", "fbdev", "wsfb", NULL }; + static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL }; char **end, **drv; char *x; int i; diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index 721159d0b..f1e6783a7 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -1638,9 +1638,14 @@ xf86SetBackingStore(ScreenPtr pScreen) else { if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS)) from = X_CONFIG; +#ifdef COMPOSITE + if (from != X_CONFIG) + useBS = xf86ReturnOptValBool(options, OPTION_BACKING_STORE, + !noCompositeExtension); +#endif } free(options); - pScreen->backingStoreSupport = useBS ? Always : NotUseful; + pScreen->backingStoreSupport = useBS ? WhenMapped : NotUseful; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n", useBS ? "enabled" : "disabled"); diff --git a/xorg-server/hw/xfree86/dri2/dri2ext.c b/xorg-server/hw/xfree86/dri2/dri2ext.c index e1decec9e..ffd66fad6 100644 --- a/xorg-server/hw/xfree86/dri2/dri2ext.c +++ b/xorg-server/hw/xfree86/dri2/dri2ext.c @@ -672,6 +672,11 @@ DRI2ExtensionInit(void) { ExtensionEntry *dri2Extension; +#ifdef PANORAMIX + if (!noPanoramiXExtension) + return; +#endif + dri2Extension = AddExtension(DRI2_NAME, DRI2NumberEvents, DRI2NumberErrors, diff --git a/xorg-server/hw/xquartz/GL/indirect.c b/xorg-server/hw/xquartz/GL/indirect.c index c4999b5ff..8dabda14d 100644 --- a/xorg-server/hw/xquartz/GL/indirect.c +++ b/xorg-server/hw/xquartz/GL/indirect.c @@ -48,8 +48,6 @@ #include <glxserver.h> #include <glxutil.h> -#include <glapi.h> - #include "x-hash.h" #include "visualConfigs.h" @@ -643,15 +641,20 @@ __glFloorLog2(GLuint val) "/System/Library/Frameworks/OpenGL.framework/OpenGL" #endif +static void *opengl_framework_handle; + +static glx_gpa_proc +get_proc_address(const char *sym) +{ + return (glx_gpa_proc) dlsym(opengl_framework_handle, sym); +} + static void setup_dispatch_table(void) { - static struct _glapi_table *disp = NULL; - static void *handle; const char *opengl_framework_path; - if (disp) { - _glapi_set_dispatch(disp); + if (opengl_framework_handle) { return; } @@ -661,16 +664,13 @@ setup_dispatch_table(void) } (void)dlerror(); /*drain dlerror */ - handle = dlopen(opengl_framework_path, RTLD_LOCAL); + opengl_framework_handle = dlopen(opengl_framework_path, RTLD_LOCAL); - if (!handle) { + if (!opengl_framework_handle) { ErrorF("unable to dlopen %s : %s, using RTLD_DEFAULT\n", opengl_framework_path, dlerror()); - handle = RTLD_DEFAULT; + opengl_framework_handle = RTLD_DEFAULT; } - disp = _glapi_create_table_from_handle(handle, "gl"); - assert(disp); - - _glapi_set_dispatch(disp); + __glXsetGetProcAddress(get_proc_address); } diff --git a/xorg-server/hw/xquartz/X11Controller.m b/xorg-server/hw/xquartz/X11Controller.m index 3d094bfc7..752bda35c 100644 --- a/xorg-server/hw/xquartz/X11Controller.m +++ b/xorg-server/hw/xquartz/X11Controller.m @@ -347,7 +347,7 @@ extern char *bundle_id_prefix; const char *newargv[4]; char buf[128]; char *s; -#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 int stdout_pipe[2]; int stderr_pipe[2]; #endif @@ -363,7 +363,7 @@ extern char *bundle_id_prefix; setenv("DISPLAY", buf, TRUE); } -#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 if (asl_log_descriptor) { char *asl_sender; aslmsg amsg = asl_new(ASL_TYPE_MSG); @@ -413,7 +413,7 @@ extern char *bundle_id_prefix; _exit(1); case 0: /* child2 */ -#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 if (asl_log_descriptor) { /* Replace our stdout/stderr */ dup2(stdout_pipe[1], STDOUT_FILENO); @@ -442,7 +442,7 @@ extern char *bundle_id_prefix; waitpid(child1, &status, 0); } -#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 if (asl_log_descriptor) { /* Close the write ends of the pipe */ close(stdout_pipe[1]); diff --git a/xorg-server/hw/xwin/Makefile.am b/xorg-server/hw/xwin/Makefile.am index c7006959c..7f0eaf097 100644 --- a/xorg-server/hw/xwin/Makefile.am +++ b/xorg-server/hw/xwin/Makefile.am @@ -157,7 +157,7 @@ XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) -XWin_LDFLAGS = -mwindows -static +XWin_LDFLAGS = -mwindows -static -Wl,--disable-stdcall-fixup .rc.o: $(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include diff --git a/xorg-server/hw/xwin/glx/Makefile.am b/xorg-server/hw/xwin/glx/Makefile.am index 067ee5b3c..f2dffbffb 100644 --- a/xorg-server/hw/xwin/glx/Makefile.am +++ b/xorg-server/hw/xwin/glx/Makefile.am @@ -1,14 +1,18 @@ noinst_LTLIBRARIES = libXwinGLX.la +lib_LTLIBRARIES = libnativeGLthunk.la libXwinGLX_la_SOURCES = \ winpriv.c \ winpriv.h \ glwindows.h \ - glwrap.c \ + glshim.c \ indirect.c \ wgl_ext_api.c \ wgl_ext_api.h +libnativeGLthunk_la_SOURCES = \ + glthunk.c + if XWIN_MULTIWINDOW DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW endif @@ -30,16 +34,32 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/hw/xwin/ +libnativeGLthunk_la_CFLAGS = $(AM_CFLAGS) -Wno-unused-function -Wno-missing-prototypes -Wno-missing-declarations +libnativeGLthunk_la_LDFLAGS = -shared -no-undefined -avoid-version -lopengl32 -export-symbols generated_gl_thunks.def +EXTRA_libnativeGLthunk_la_DEPENDENCIES = generated_gl_thunks.def + if XWIN_GLX_WINDOWS -generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c +if DEBUG +GENGLWRAPPERSOPTS="" +else +GENGLWRAPPERSOPTS="-nodebug" +endif + +generated_wgl_wrappers.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wgl.xml $(KHRONOS_SPEC_DIR)/reg.py + $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/wgl.xml -prefix wgl -wrapper -preresolve $(GENGLWRAPPERSOPTS) -outfile $@ + +generated_gl_shim.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py + $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -shim $(GENGLWRAPPERSOPTS) -outfile $@ + +generated_gl_thunks.c: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py + $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunk $(GENGLWRAPPERSOPTS) -outfile $@ -generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm - $(AM_V_GEN)$(PYTHON) $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c +generated_gl_thunks.def: $(srcdir)/gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.xml $(KHRONOS_SPEC_DIR)/reg.py + $(AM_V_GEN)PYTHONPATH=$(KHRONOS_SPEC_DIR) $(PYTHON3) $(srcdir)/gen_gl_wrappers.py -registry $(KHRONOS_SPEC_DIR)/gl.xml -thunkdefs $(GENGLWRAPPERSOPTS) -outfile $@ endif -BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c +BUILT_SOURCES = generated_gl_shim.c generated_gl_thunks.c generated_gl_thunks.def generated_wgl_wrappers.c CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = gen_gl_wrappers.py diff --git a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py index 2273589c9..683b9d903 100644 --- a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py +++ b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py @@ -1,325 +1,485 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -# Comedy python script to generate cdecl to stdcall wrappers for GL functions +# python script to generate cdecl to stdcall wrappers for GL functions +# adapted from genheaders.py # -# This is designed to operate on OpenGL spec files from -# http://www.opengl.org/registry/api/ -# -# -# Copyright (c) Jon TURNEY 2009 +# Copyright (c) 2013 The Khronos Group Inc. # # 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written authorization. -# - -import sys -import re -import getopt - -dispatchheader = '' -prefix = 'gl' -preresolve = False -staticwrappers = False - -opts, args = getopt.getopt(sys.argv[1:], "", ['spec=', 'typemap=', 'dispatch-header=', 'prefix=', 'preresolve', 'staticwrappers' ]) - -for o,a in opts: - if o == '--typemap' : - typemapfile = a - elif o == '--dispatch-header' : - dispatchheader = a - elif o == '--spec' : - specfile = a - elif o == '--prefix' : - prefix = a - elif o == '--preresolve' : - preresolve = True - elif o == '--staticwrappers' : - staticwrappers = True - +# copy of this software and/or associated documentation files (the +# "Materials"), to deal in the Materials without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Materials, and to +# permit persons to whom the Materials are furnished to do so, subject to +# the following conditions: # -# look for all the SET_ macros in dispatch.h, this is the set of functions -# we need to generate -# - -dispatch = {} - -if dispatchheader : - fh = open(dispatchheader) - dispatchh = fh.readlines() - - dispatch_regex = re.compile(r'^SET_(\S*)\(') - - for line in dispatchh : - line = line.strip() - m1 = dispatch_regex.search(line) - - if m1 : - dispatch[m1.group(1)] = 1 - - del dispatch['by_offset'] - +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Materials. # -# read the typemap .tm file -# - -typemap = {} - -fh = open(typemapfile) -tm = fh.readlines() - -typemap_regex = re.compile(r'#define\sSET_(\S*)\(') - -for line in tm : - # ignore everything after a '#' as a comment - hash = line.find('#') - if hash != -1 : - line = line[:hash-1] - - # ignore blank lines - if line.startswith('#') or len(line) == 0 : - continue - - l = line.split(',') - typemap[l[0]] = l[3].strip() - -# interestingly, * is not a C type -if typemap['void'] == '*' : - typemap['void'] = 'void' - -# -# crudely parse the .spec file -# - -r1 = re.compile(r'\t(\S*)\s+(\S*.*)') -r2 = re.compile(r'(.*)\((.*)\)') -r3 = re.compile(r'glWindowPos.*MESA') -r4 = re.compile(r'gl.*Program(s|)NV') -r5 = re.compile(r'glGetVertexAttribfvNV') - -wrappers = {} - -fh = open(specfile) -glspec = fh.readlines() -param_count = 0 - -for line in glspec : - line = line.rstrip() - - # ignore everything after a '#' as a comment - hash = line.find('#') - if hash != -1 : - line = line[:hash-1] - - # ignore blank lines - if line.startswith('#') or len(line) == 0 : - continue - - # lines containing ':' aren't intersting to us - if line.count(':') != 0 : - continue - - # attributes of each function follow the name, indented by a tab - if not line.startswith('\t') : - m1 = r2.search(line) - if m1 : - function = m1.group(1) - arglist_use = m1.group(2) - wrappers[function] = {} - - # ensure formal parameter names don't collide with reserved names or shadow global declarations - arglist_use = ',' .join([i.rstrip() + '_' for i in arglist_use.split(",")]) - - wrappers[function]['arglist_use'] = arglist_use - param_count = 0 - else : - m1 = r1.search(line) - if m1 : - attribute = m1.group(1) - value = m1.group(2) - - # make param attributes unique and ordered - if attribute == 'param' : - attribute = 'param' + '%02d' % param_count - param_count += 1 - - wrappers[function][attribute] = value - -# -# now emit code -# - -print '/* Automatically generated by ' + sys.argv[0] + ' DO NOT EDIT */' -print '/* from ' + specfile + ' and typemap ' + typemapfile + ' */' -print '' - -# -# if required, emit code for non-lazy function resolving -# - -if preresolve : - for w in sorted(wrappers.keys()) : - funcname = prefix + w - print 'RESOLVE_DECL(PFN' + funcname.upper() + 'PROC);' - - print '' - print 'void ' + prefix + 'ResolveExtensionProcs(void)' - print '{' - - for w in sorted(wrappers.keys()) : - funcname = prefix + w - print ' PRERESOLVE(PFN' + funcname.upper() + 'PROC, "' + funcname + '");' - - print '}\n' +# THE MATERIALS ARE 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 +# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +import sys, time, pdb, string, cProfile +from reg import * + +# Default input / log files +errFilename = None +diagFilename = 'diag.txt' +regFilename = 'gl.xml' +outFilename = 'gen_gl_wrappers.c' + +protect=True +prefix="gl" +preresolve=False +wrapper=False +shim=False +thunk=False +thunkdefs=False +staticwrappers=False +nodebug=False + +#exclude base WGL API +WinGDI={key: 1 for key in [ + "wglCopyContext" + ,"wglCreateContext" + ,"wglCreateLayerContext" + ,"wglDeleteContext" + ,"wglGetCurrentContext" + ,"wglGetCurrentDC" + ,"wglGetProcAddress" + ,"wglMakeCurrent" + ,"wglShareLists" + ,"wglUseFontBitmapsA" + ,"wglUseFontBitmapsW" + ,"wglUseFontBitmaps" + ,"SwapBuffers" + ,"wglUseFontOutlinesA" + ,"wglUseFontOutlinesW" + ,"wglUseFontOutlines" + ,"wglDescribeLayerPlane" + ,"wglSetLayerPaletteEntries" + ,"wglGetLayerPaletteEntries" + ,"wglRealizeLayerPalette" + ,"wglSwapLayerBuffers" + ,"wglSwapMultipleBuffers" + ,"ChoosePixelFormat" + ,"DescribePixelFormat" + ,"GetEnhMetaFilePixelFormat" + ,"GetPixelFormat" + ,"SetPixelFormat" +]} + +if __name__ == '__main__': + i = 1 + while (i < len(sys.argv)): + arg = sys.argv[i] + i = i + 1 + if (arg == '-noprotect'): + print('Disabling inclusion protection in output headers', file=sys.stderr) + protect = False + elif (arg == '-registry'): + regFilename = sys.argv[i] + i = i+1 + print('Using registry', regFilename, file=sys.stderr) + elif (arg == '-outfile'): + outFilename = sys.argv[i] + i = i+1 + elif (arg == '-preresolve'): + preresolve=True + elif (arg == '-wrapper'): + wrapper=True + elif (arg == '-shim'): + shim=True + elif (arg == '-thunk'): + thunk=True + elif (arg == '-thunkdefs'): + thunkdefs=True + elif (arg == '-staticwrappers'): + staticwrappers=True + elif (arg == '-prefix'): + prefix = sys.argv[i] + i = i+1 + elif (arg == '-nodebug'): + nodebug = True + elif (arg[0:1] == '-'): + print('Unrecognized argument:', arg, file=sys.stderr) + exit(1) + +print('Generating', outFilename, file=sys.stderr) + +# Load & parse registry +reg = Registry() +tree = etree.parse(regFilename) +reg.loadElementTree(tree) + +allVersions = '.*' + +genOpts = CGeneratorOptions( + apiname = prefix, + profile = 'compatibility', + versions = allVersions, + emitversions = allVersions, + defaultExtensions = prefix, # Default extensions for GL + protectFile = protect, + protectFeature = protect, + protectProto = protect, + ) + +# create error/warning & diagnostic files +if (errFilename): + errWarn = open(errFilename,'w') +else: + errWarn = sys.stderr +diag = open(diagFilename, 'w') + +class PreResolveOutputGenerator(OutputGenerator): + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + self.wrappers={} + def beginFile(self, genOpts): + self.outFile.write('/* Automatically generated from %s - DO NOT EDIT */\n\n'%regFilename) + def endFile(self): + self.outFile.write('\nvoid ' + prefix + 'ResolveExtensionProcs(void)\n{\n') + for funcname in self.wrappers.keys(): + self.outFile.write( ' PRERESOLVE(PFN' + funcname.upper() + 'PROC, "' + funcname + '");\n') + self.outFile.write('}\n\n') + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + def endFeature(self): + OutputGenerator.endFeature(self) + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + def genCmd(self, cmd, name): + OutputGenerator.genCmd(self, cmd, name) + + if name in WinGDI: + return + + self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n') + self.wrappers[name]=1 + +class WrapperOutputGenerator(OutputGenerator): + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + def beginFile(self, genOpts): + self.outFile.write('/* Automatically generated from %s - DO NOT EDIT */\n\n'%regFilename) + def endFile(self): + pass + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') + def endFeature(self): + OutputGenerator.endFeature(self) + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + def genCmd(self, cmd, name): + OutputGenerator.genCmd(self, cmd, name) + + if name in WinGDI: + return + + proto=noneStr(cmd.elem.find('proto')) + rettype=noneStr(proto.text) + if rettype.lower()!="void ": + plist = ([t for t in proto.itertext()]) + rettype = ''.join(plist[:-1]) + rettype=rettype.strip() + if staticwrappers: self.outFile.write("static ") + self.outFile.write("%s %sWrapper("%(rettype, name)) + params = cmd.elem.findall('param') + plist=[] + for param in params: + paramlist = ([t for t in param.itertext()]) + paramtype = ''.join(paramlist[:-1]) + paramname = paramlist[-1] + plist.append((paramtype, paramname)) + Comma="" + if len(plist): + for ptype, pname in plist: + self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + Comma=", " + else: + self.outFile.write("void") -# -# now emit the wrappers -# for GL 1.0 and 1.1 functions, generate stdcall wrappers which call the function directly -# for GL 1.2+ functions, generate wrappers which use wglGetProcAddress() -# + self.outFile.write(")\n{\n") -for w in sorted(wrappers.keys()) : + # for GL 1.0 and 1.1 functions, generate stdcall wrappers which call the function directly + if self.OldVersion: + if not nodebug: + self.outFile.write(' if (glxWinDebugSettings.enable%scallTrace) ErrorF("%s\\n");\n'%(prefix.upper(), name)) + self.outFile.write(" glWinDirectProcCalls++;\n") + self.outFile.write("\n") - funcname = prefix + w - returntype = wrappers[w]['return'] - if returntype != 'void' : - returntype = typemap[returntype] + if rettype.lower()=="void": + self.outFile.write(" %s( "%(name)) + else: + self.outFile.write(" return %s( "%(name)) - # Avoid generating wrappers which aren't referenced by the dispatch table - if dispatchheader and not dispatch.has_key(w) : - print '/* No wrapper for ' + funcname + ', not in dispatch table */' - continue + Comma="" + for ptype, pname in plist: + self.outFile.write("%s%s_"%(Comma, pname)) + Comma=", " - # manufacture arglist - # if no param attributes were found, it should be 'void' - al = [] - for k in sorted(wrappers[w].keys()) : - if k.startswith('param') : - l = wrappers[w][k].split() + # for GL 1.2+ functions, generate stdcall wrappers which use wglGetProcAddress() + else: + if rettype.lower()=="void": + self.outFile.write(' RESOLVE(PFN%sPROC, "%s");\n'%(name.upper(), name)) + + if not nodebug: + self.outFile.write("\n") + self.outFile.write(' if (glxWinDebugSettings.enable%scallTrace) ErrorF("%s\\n");\n'%(prefix.upper(), name)) + self.outFile.write("\n") + + self.outFile.write(" RESOLVED_PROC(PFN%sPROC)( """%(name.upper())) + else: + self.outFile.write(' RESOLVE_RET(PFN%sPROC, "%s", FALSE);\n'%(name.upper(), name)) + + if not nodebug: + self.outFile.write("\n") + self.outFile.write(' if (glxWinDebugSettings.enable%scallTrace) ErrorF("%s\\n");\n'%(prefix.upper(), name)) + self.outFile.write("\n") + + self.outFile.write(" return RESOLVED_PROC(PFN%sPROC)("%(name.upper())) + + Comma="" + for ptype, pname in plist: + self.outFile.write("%s%s_"%(Comma, pname)) + Comma=", " + self.outFile.write(" );\n}\n\n") + +class ThunkOutputGenerator(OutputGenerator): + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + def beginFile(self, genOpts): + self.outFile.write('/* Automatically generated from %s - DO NOT EDIT */\n\n'%regFilename) + def endFile(self): + pass + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') + def endFeature(self): + OutputGenerator.endFeature(self) + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + def genCmd(self, cmd, name): + OutputGenerator.genCmd(self, cmd, name) + + proto=noneStr(cmd.elem.find('proto')) + rettype=noneStr(proto.text) + if rettype.lower()!="void ": + plist = ([t for t in proto.itertext()]) + rettype = ''.join(plist[:-1]) + rettype=rettype.strip() + self.outFile.write("%s %sWrapper("%(rettype, name)) + params = cmd.elem.findall('param') + plist=[] + for param in params: + paramlist = ([t for t in param.itertext()]) + paramtype = ''.join(paramlist[:-1]) + paramname = paramlist[-1] + plist.append((paramtype, paramname)) + Comma="" + if len(plist): + for ptype, pname in plist: + self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + Comma=", " + else: + self.outFile.write("void") - # ensure formal parameter names don't collide with reserved names or shadow global declarations - l[0] = l[0] + '_' + self.outFile.write(")\n{\n") - if l[2] == 'in' : - if l[3] == 'array' : - arg = 'const ' + typemap[l[1]] + ' *' + l[0] - else : - arg = typemap[l[1]] + ' ' + l[0] - elif l[2] == 'out' : - arg = typemap[l[1]] + ' *' + l[0] + # for GL 1.0 and 1.1 functions, generate stdcall thunk wrappers which call the function directly + if self.OldVersion: + if rettype.lower()=="void": + self.outFile.write(" %s( "%(name)) + else: + self.outFile.write(" return %s( "%(name)) - al.append(arg) + Comma="" + for ptype, pname in plist: + self.outFile.write("%s%s_"%(Comma, pname)) + Comma=", " - if len(al) == 0 : - arglist = 'void' + # for GL 1.2+ functions, generate wrappers which use wglGetProcAddress() else: - arglist = ', '.join(al) - - if wrappers[w]['category'].startswith('VERSION_1_0') or wrappers[w]['category'].startswith('VERSION_1_1') : - if staticwrappers : - print 'static', - print returntype + ' ' + funcname + 'Wrapper(' + arglist + ')' - print '{' - print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' - print ' glWinDirectProcCalls++;' - if returntype.lower() == 'void' : - print ' ' + funcname + '(', - else : - print ' /* returntype was ' + returntype.lower() + '*/' - print ' return ' + funcname + '(', - - if arglist != 'void' : - print wrappers[w]['arglist_use'], - - print ');' - print "}\n" + if rettype.lower()=="void": + self.outFile.write(' RESOLVE(PFN%sPROC, "%s");\n'%(name.upper(), name)) + self.outFile.write(" RESOLVED_PROC(PFN%sPROC)( """%(name.upper())) + else: + self.outFile.write(' RESOLVE_RET(PFN%sPROC, "%s", FALSE);\n'%(name.upper(), name)) + self.outFile.write(" return RESOLVED_PROC(PFN%sPROC)("%(name.upper())) + + Comma="" + for ptype, pname in plist: + self.outFile.write("%s%s_"%(Comma, pname)) + Comma=", " + self.outFile.write(" );\n}\n\n") + +class ThunkDefsOutputGenerator(OutputGenerator): + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + def beginFile(self, genOpts): + self.outFile.write("EXPORTS\n"); # this must be the first line for libtool to realize this is a .def file + self.outFile.write('; Automatically generated from %s - DO NOT EDIT\n\n'%regFilename) + def endFile(self): + pass + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + def endFeature(self): + OutputGenerator.endFeature(self) + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + def genCmd(self, cmd, name): + OutputGenerator.genCmd(self, cmd, name) + + # export the wrapper function with the name of the function it wraps + self.outFile.write("%s = %sWrapper\n"%(name, name)) + +class ShimOutputGenerator(OutputGenerator): + def __init__(self, + errFile = sys.stderr, + warnFile = sys.stderr, + diagFile = sys.stdout): + OutputGenerator.__init__(self, errFile, warnFile, diagFile) + def beginFile(self, genOpts): + self.outFile.write('/* Automatically generated from %s - DO NOT EDIT */\n\n'%regFilename) + def endFile(self): + pass + def beginFeature(self, interface, emit): + OutputGenerator.beginFeature(self, interface, emit) + self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') or self.featureName.startswith('GL_VERSION_1_2') or self.featureName.startswith('GL_ARB_imaging') or self.featureName.startswith('GL_ARB_multitexture') or self.featureName.startswith('GL_ARB_texture_compression') + def endFeature(self): + OutputGenerator.endFeature(self) + def genType(self, typeinfo, name): + OutputGenerator.genType(self, typeinfo, name) + def genEnum(self, enuminfo, name): + OutputGenerator.genEnum(self, enuminfo, name) + def genCmd(self, cmd, name): + OutputGenerator.genCmd(self, cmd, name) + + if not self.OldVersion: + return + + # for GL functions which are in the ABI, generate a shim which calls the function via GetProcAddress + proto=noneStr(cmd.elem.find('proto')) + rettype=noneStr(proto.text) + if rettype.lower()!="void ": + plist = ([t for t in proto.itertext()]) + rettype = ''.join(plist[:-1]) + rettype=rettype.strip() + self.outFile.write("%s %s("%(rettype, name)) + params = cmd.elem.findall('param') + plist=[] + for param in params: + paramlist = ([t for t in param.itertext()]) + paramtype = ''.join(paramlist[:-1]) + paramname = paramlist[-1] + plist.append((paramtype, paramname)) + Comma="" + if len(plist): + for ptype, pname in plist: + self.outFile.write("%s%s%s_"%(Comma, ptype, pname)) + Comma=", " else: - if staticwrappers : - print 'static', - print returntype + ' ' + funcname + 'Wrapper(' + arglist + ')' - print '{' + self.outFile.write("void") - stringname = funcname + self.outFile.write(")\n{\n") -# -# special case: Windows OpenGL implementations are far more likely to have GL_ARB_window_pos than GL_MESA_window_pos, -# so arrange for the wrapper to use the ARB strings to find functions... -# + self.outFile.write(' typedef %s (* PFN%sPROC)(' % (rettype, name.upper())) - m2 = r3.search(funcname) - if m2 : - stringname = stringname.replace('MESA','ARB') + if len(plist): + Comma="" + for ptype, pname in plist: + self.outFile.write("%s %s %s_"%(Comma, ptype, pname)) + Comma=", " + else: + self.outFile.write("void") -# -# special case: likewise, implementations are more likely to have GL_ARB_vertex_program than GL_NV_vertex_program, -# especially if they are not NV implementations, so arrange for the wrapper to use ARB strings to find functions -# + self.outFile.write(');\n') - m3 = r4.search(funcname) - if m3 : - stringname = stringname.replace('NV','ARB') - m4 = r5.search(funcname) - if m4 : - stringname = stringname.replace('NV','ARB') - - pfntypename = 'PFN' + funcname.upper() + 'PROC' - - if returntype.lower() == 'void' : - print ' RESOLVE(' + pfntypename + ', "' + stringname + '");' - print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' - print ' RESOLVED_PROC(' + pfntypename + ')(', - else : - print ' RESOLVE_RET(' + pfntypename + ', "' + stringname + '", FALSE);' - print ' if (glxWinDebugSettings.enable' + prefix.upper() + 'callTrace) ErrorF("'+ funcname + '\\n");' - print ' return RESOLVED_PROC(' + pfntypename + ')(', - - if arglist != 'void' : - print wrappers[w]['arglist_use'], - - print ');' - print "}\n" - - -# generate function to setup the dispatch table, which sets each -# dispatch table entry to point to it's wrapper function -# (assuming we were able to make one) - -if dispatchheader : - print 'void glWinSetupDispatchTable(void)' - print '{' - print ' static struct _glapi_table *disp = NULL;' - print '' - print ' if (!disp)' - print ' {' - print ' disp = calloc(sizeof(void *), _glapi_get_dispatch_table_size());' - print ' assert(disp);' - - for d in sorted(dispatch.keys()) : - if wrappers.has_key(d) : - print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' - else : - print '#warning No wrapper for ' + prefix + d + ' !' - - print ' }' - print '' - print ' _glapi_set_dispatch(disp);' - print '}' + if rettype.lower()=="void": + self.outFile.write(' RESOLVE(PFN%sPROC, "%s");\n'%(name.upper(), name)) + self.outFile.write(' RESOLVED_PROC(') + else: + self.outFile.write(' RESOLVE_RET(PFN%sPROC, "%s", 0);\n'%(name.upper(), name)) + self.outFile.write(' return RESOLVED_PROC(') + + Comma="" + for ptype, pname in plist: + self.outFile.write("%s%s_"%(Comma, pname)) + Comma=", " + + self.outFile.write(" );\n}\n\n") + +def genHeaders(): + outFile = open(outFilename,"w") + + if preresolve: + gen = PreResolveOutputGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + gen.outFile=outFile + reg.setGenerator(gen) + reg.apiGen(genOpts) + + if wrapper: + gen = WrapperOutputGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + gen.outFile=outFile + reg.setGenerator(gen) + reg.apiGen(genOpts) + + if shim: + gen = ShimOutputGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + gen.outFile=outFile + reg.setGenerator(gen) + reg.apiGen(genOpts) + + if thunk: + gen = ThunkOutputGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + gen.outFile=outFile + reg.setGenerator(gen) + reg.apiGen(genOpts) + + + if thunkdefs: + gen = ThunkDefsOutputGenerator(errFile=errWarn, + warnFile=errWarn, + diagFile=diag) + gen.outFile=outFile + reg.setGenerator(gen) + reg.apiGen(genOpts) + + outFile.close() + +genHeaders() diff --git a/xorg-server/hw/xwin/glx/glshim.c b/xorg-server/hw/xwin/glx/glshim.c new file mode 100644 index 000000000..7109196c0 --- /dev/null +++ b/xorg-server/hw/xwin/glx/glshim.c @@ -0,0 +1,124 @@ +/* + * File: glshim.c + * Purpose: GL shim which redirects to a specified DLL + * + * Copyright (c) Jon TURNEY 2013 + * + * 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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. + */ + +/* + A GL shim which redirects to a specified DLL + + XWin is statically linked with this, rather than the system libGL, so that + GL calls can be directed to mesa cygGL-1.dll, or cygnativeGLthunk.dll + (which contains cdecl-to-stdcall thunks to the native openGL32.dll) +*/ + +#ifdef HAVE_XWIN_CONFIG_H +#include <xwin-config.h> +#endif + +#define GL_GLEXT_LEGACY +#include <GL/gl.h> +#undef GL_ARB_imaging +#undef GL_VERSION_1_3 +#include <GL/glext.h> + +#include <X11/Xwindows.h> +#include <os.h> +#include "glwindows.h" +#include <glx/glxserver.h> + +static HMODULE hMod = NULL; + +/* + Implement the __glGetProcAddress function by just using GetProcAddress() on the selected DLL +*/ +void *glXGetProcAddressARB(const char *symbol) +{ + void *proc; + + /* Default to the mesa GL implementation if one hasn't been selected yet */ + if (!hMod) + glWinSelectImplementation(0); + + proc = GetProcAddress(hMod, symbol); + + if (glxWinDebugSettings.enableGLcallTrace) + ErrorF("glXGetProcAddressARB: Resolved '%s' in %p to %p\n", symbol, hMod, proc); + + return proc; +} + +/* + Select a GL implementation DLL +*/ +int glWinSelectImplementation(int native) +{ + const char *dllname; + + if (native) { + dllname = "cygnativeGLthunk.dll"; + } + else { + dllname = "cygGL-1.dll"; + } + + hMod = LoadLibraryEx(dllname, NULL, 0); + if (hMod == NULL) { + ErrorF("glWinSelectGLimplementation: Could not load '%s'\n", dllname); + return -1; + } + + ErrorF("glWinSelectGLimplementation: Loaded '%s'\n", dllname); + + /* Connect __glGetProcAddress() to our implementation of glXGetProcAddressARB() above */ + __glXsetGetProcAddress((glx_gpa_proc)glXGetProcAddressARB); + + return 0; +} + +#define RESOLVE_RET(proctype, symbol, retval) \ + proctype proc = (proctype)glXGetProcAddressARB(symbol); \ + if (proc == NULL) return retval; + +#define RESOLVE(proctype, symbol) RESOLVE_RET(proctype, symbol,) +#define RESOLVED_PROC proc + +/* Include generated shims for direct linkage to GL functions which are in the ABI */ +#include "generated_gl_shim.c" + +/* + Special wrapper for glAddSwapHintRectWIN for copySubBuffers + + Only used with native GL if the GL_WIN_swap_hint extension is present, so we enable + GLX_MESA_copy_sub_buffer +*/ +typedef void (__stdcall * PFNGLADDSWAPHINTRECTWIN) (GLint x, GLint y, + GLsizei width, + GLsizei height); + +void +glAddSwapHintRectWINWrapper(GLint x, GLint y, GLsizei width, + GLsizei height) +{ + RESOLVE(PFNGLADDSWAPHINTRECTWIN, "glAddSwapHintRectWIN"); + RESOLVED_PROC(x, y, width, height); +} diff --git a/xorg-server/hw/xwin/glx/glwrap.c b/xorg-server/hw/xwin/glx/glthunk.c index 73cff3cc1..d49fe487c 100644 --- a/xorg-server/hw/xwin/glx/glwrap.c +++ b/xorg-server/hw/xwin/glx/glthunk.c @@ -1,13 +1,8 @@ /* - * File: glwrap.c - * Purpose: Wrapper functions for Win32 OpenGL functions - * - * Authors: Alexander Gottwald - * Jon TURNEY - * - * Copyright (c) Jon TURNEY 2009 - * Copyright (c) Alexander Gottwald 2004 + * File: glthunk.c + * Purpose: cdecl thunk wrapper library for Win32 stdcall OpenGL library * + * Copyright (c) Jon TURNEY 2009,2013 * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -37,34 +32,12 @@ #endif #include <X11/Xwindows.h> + +#define GL_GLEXT_LEGACY #include <GL/gl.h> +#undef GL_ARB_imaging +#undef GL_VERSION_1_3 #include <GL/glext.h> -#include <glx/glxserver.h> -#include <glx/glxext.h> -#include <glx/glapi.h> -#include <glx/dispatch.h> -#include <glwindows.h> - -static unsigned int glWinIndirectProcCalls = 0; -static unsigned int glWinDirectProcCalls = 0; - -void -glWinCallDelta(void) -{ - static unsigned int glWinIndirectProcCallsLast = 0; - static unsigned int glWinDirectProcCallsLast = 0; - - if ((glWinIndirectProcCalls != glWinIndirectProcCallsLast) || - (glWinDirectProcCalls != glWinDirectProcCallsLast)) { - if (glxWinDebugSettings.enableTrace) { - ErrorF("after %d direct and %d indirect GL calls\n", - glWinDirectProcCalls - glWinDirectProcCallsLast, - glWinIndirectProcCalls - glWinIndirectProcCallsLast); - } - glWinDirectProcCallsLast = glWinDirectProcCalls; - glWinIndirectProcCallsLast = glWinIndirectProcCalls; - } -} static PROC glWinResolveHelper(PROC * cache, const char *symbol) @@ -75,11 +48,9 @@ glWinResolveHelper(PROC * cache, const char *symbol) if ((*cache) == NULL) { proc = wglGetProcAddress(symbol); if (proc == NULL) { - ErrorF("glwrap: Can't resolve \"%s\"\n", symbol); (*cache) = (PROC) - 1; } else { - ErrorF("glwrap: Resolved \"%s\"\n", symbol); (*cache) = proc; } } @@ -99,10 +70,8 @@ glWinResolveHelper(PROC * cache, const char *symbol) static PROC cache = NULL; \ __stdcall proctype proc = (proctype)glWinResolveHelper(&cache, symbol); \ if (proc == NULL) { \ - __glXErrorCallBack(0); \ return retval; \ - } \ - glWinIndirectProcCalls++; + } #define RESOLVE(proctype, symbol) RESOLVE_RET(proctype, symbol,) @@ -113,34 +82,6 @@ glWinResolveHelper(PROC * cache, const char *symbol) OpenGL 1.2 and upward is treated as extensions, function address must found using wglGetProcAddress(), but also stdcall so still need wrappers... - - Include generated dispatch table setup function */ -#include "generated_gl_wrappers.c" - -/* - Special non-static wrapper for glGetString for debug output -*/ - -const GLubyte * -glGetStringWrapperNonstatic(GLenum name) -{ - return glGetString(name); -} - -/* - Special non-static wrapper for glAddSwapHintRectWIN for copySubBuffers -*/ - -typedef void (__stdcall * PFNGLADDSWAPHINTRECTWIN) (GLint x, GLint y, - GLsizei width, - GLsizei height); - -void -glAddSwapHintRectWINWrapperNonstatic(GLint x, GLint y, GLsizei width, - GLsizei height) -{ - RESOLVE(PFNGLADDSWAPHINTRECTWIN, "glAddSwapHintRectWIN"); - proc(x, y, width, height); -} +#include "generated_gl_thunks.c" diff --git a/xorg-server/hw/xwin/glx/glwindows.h b/xorg-server/hw/xwin/glx/glwindows.h index ec1d1f51b..4f859b498 100644 --- a/xorg-server/hw/xwin/glx/glwindows.h +++ b/xorg-server/hw/xwin/glx/glwindows.h @@ -42,12 +42,9 @@ typedef struct { extern glxWinDebugSettingsRec glxWinDebugSettings; -void glWinCallDelta(void); void glxWinPushNativeProvider(void); -const GLubyte *glGetStringWrapperNonstatic(GLenum name); -void glAddSwapHintRectWINWrapperNonstatic(GLint x, GLint y, GLsizei width, - GLsizei height); -void glWinSetupDispatchTable(void); +void glAddSwapHintRectWINWrapper(GLint x, GLint y, GLsizei width, GLsizei height); +int glWinSelectImplementation(int native); #if 1 #define GLWIN_TRACE_MSG(msg, args...) if (glxWinDebugSettings.enableTrace) ErrorF(msg " [%s:%d]\n" , ##args , __FUNCTION__, __LINE__ ) diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 4f09652f0..3d01bed39 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -550,7 +550,9 @@ glxWinScreenProbe(ScreenPtr pScreen) if (NULL == screen) return NULL; - /* Dump out some useful information about the native renderer */ + // Select the native GL implementation (WGL) + if (glWinSelectImplementation(1)) + return NULL; // create window class #define WIN_GL_TEST_WINDOW_CLASS "XWinGLTest" @@ -597,11 +599,12 @@ glxWinScreenProbe(ScreenPtr pScreen) // (but we need to have a current context for them to be resolvable) wglResolveExtensionProcs(); - ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION)); - ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR)); - gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); + /* Dump out some useful information about the native renderer */ + ErrorF("GL_VERSION: %s\n", glGetString(GL_VERSION)); + ErrorF("GL_VENDOR: %s\n", glGetString(GL_VENDOR)); + gl_renderer = (const char *) glGetString(GL_RENDERER); ErrorF("GL_RENDERER: %s\n", gl_renderer); - gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS); + gl_extensions = (const char *) glGetString(GL_EXTENSIONS); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); if (!wgl_extensions) wgl_extensions = ""; @@ -615,7 +618,7 @@ glxWinScreenProbe(ScreenPtr pScreen) free(screen); LogMessage(X_ERROR, "AIGLX: Won't use generic native renderer as it is not accelerated\n"); - return NULL; + goto error; } // Can you see the problem here? The extensions string is DC specific @@ -726,7 +729,7 @@ glxWinScreenProbe(ScreenPtr pScreen) free(screen); LogMessage(X_ERROR, "AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n"); - return NULL; + goto error; } /* These will be set by __glXScreenInit */ @@ -789,6 +792,13 @@ glxWinScreenProbe(ScreenPtr pScreen) pScreen->CopyWindow = glxWinCopyWindow; return &screen->base; + + error: + // Something went wrong and we can't use the native GL implementation + // so make sure the mesa GL implementation is selected instead + glWinSelectImplementation(0); + + return NULL; } /* ---------------------------------------------------------------------- */ @@ -910,7 +920,7 @@ static void glxWinDrawableCopySubBuffer(__GLXdrawable * drawable, int x, int y, int w, int h) { - glAddSwapHintRectWINWrapperNonstatic(x, y, w, h); + glAddSwapHintRectWINWrapper(x, y, w, h); glxWinDrawableSwapBuffers(NULL, drawable); } @@ -1458,7 +1468,6 @@ glxWinContextMakeCurrent(__GLXcontext * base) GLWIN_TRACE_MSG("glxWinContextMakeCurrent context %p (native ctx %p)", gc, gc->ctx); - glWinCallDelta(); /* Keep a note of the last active context in the drawable */ drawPriv = gc->base.drawPriv; @@ -1528,7 +1537,6 @@ glxWinContextLoseCurrent(__GLXcontext * base) GLWIN_TRACE_MSG("glxWinContextLoseCurrent context %p (native ctx %p)", gc, gc->ctx); - glWinCallDelta(); /* An error seems to be reported if we try to make no context current @@ -1623,8 +1631,6 @@ glxWinCreateContext(__GLXscreen * screen, context->ctx = NULL; context->shareContext = shareContext; - glWinSetupDispatchTable(); - GLWIN_DEBUG_MSG("GLXcontext %p created", context); return &(context->base); diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in index d4fbe99fa..306610000 100644 --- a/xorg-server/include/dix-config.h.in +++ b/xorg-server/include/dix-config.h.in @@ -466,4 +466,7 @@ /* Wrap SIGBUS to catch MIT-SHM faults */ #undef BUSFAULT +/* Directory for shared memory temp files */ +#undef SHMDIR + #endif /* _DIX_CONFIG_H_ */ diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h index 450e1a8e8..9b6729421 100644 --- a/xorg-server/include/os.h +++ b/xorg-server/include/os.h @@ -686,4 +686,7 @@ LogPrintMarkers(void); extern _X_EXPORT void xorg_backtrace(void); +extern _X_EXPORT int +os_move_fd(int fd); + #endif /* OS_H */ diff --git a/xorg-server/include/protocol-versions.h b/xorg-server/include/protocol-versions.h index 95df8ce1a..fc428c8cf 100644 --- a/xorg-server/include/protocol-versions.h +++ b/xorg-server/include/protocol-versions.h @@ -46,6 +46,10 @@ #define SERVER_DAMAGE_MAJOR_VERSION 1 #define SERVER_DAMAGE_MINOR_VERSION 1 +/* DRI3 */ +#define SERVER_DRI3_MAJOR_VERSION 1 +#define SERVER_DRI3_MINOR_VERSION 0 + /* DMX */ #define SERVER_DMX_MAJOR_VERSION 2 #define SERVER_DMX_MINOR_VERSION 2 @@ -63,6 +67,10 @@ #define SERVER_PANORAMIX_MAJOR_VERSION 1 #define SERVER_PANORAMIX_MINOR_VERSION 1 +/* Present */ +#define SERVER_PRESENT_MAJOR_VERSION 1 +#define SERVER_PRESENT_MINOR_VERSION 0 + /* RandR */ #define SERVER_RANDR_MAJOR_VERSION 1 #define SERVER_RANDR_MINOR_VERSION 4 diff --git a/xorg-server/miext/sync/misyncshm.c b/xorg-server/miext/sync/misyncshm.c index 3f9350af5..01f82fc00 100644 --- a/xorg-server/miext/sync/misyncshm.c +++ b/xorg-server/miext/sync/misyncshm.c @@ -32,12 +32,13 @@ #include "pixmapstr.h" #include <sys/mman.h> #include <unistd.h> +#include <fcntl.h> #include <X11/xshmfence.h> static DevPrivateKeyRec syncShmFencePrivateKey; typedef struct _SyncShmFencePrivate { - int32_t *fence; + struct xshmfence *fence; int fd; } SyncShmFencePrivateRec, *SyncShmFencePrivatePtr; @@ -126,6 +127,7 @@ miSyncShmCreateFenceFromFd(ScreenPtr pScreen, SyncFence *pFence, int fd, Bool in miSyncInitFence(pScreen, pFence, initially_triggered); + fd = os_move_fd(fd); pPriv->fence = xshmfence_map_shm(fd); if (pPriv->fence) { pPriv->fd = fd; @@ -145,6 +147,7 @@ miSyncShmGetFenceFd(ScreenPtr pScreen, SyncFence *pFence) pPriv->fd = xshmfence_alloc_shm(); if (pPriv->fd < 0) return -1; + pPriv->fd = os_move_fd(pPriv->fd); pPriv->fence = xshmfence_map_shm(pPriv->fd); if (!pPriv->fence) { close (pPriv->fd); diff --git a/xorg-server/os/osinit.c b/xorg-server/os/osinit.c index 60d10694b..4d48ea94e 100644 --- a/xorg-server/os/osinit.c +++ b/xorg-server/os/osinit.c @@ -213,10 +213,18 @@ OsInit(void) dlinfo(RTLD_SELF, RTLD_DI_SETSIGNAL, &failure_signal); #endif -#if !defined(__CYGWIN__) +#if !defined(XQUARTZ) /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */ +# if defined(__APPLE__) + int devnullfd = open(devnull, O_RDWR, 0); + assert(devnullfd > 2); + + dup2(devnullfd, STDIN_FILENO); + dup2(devnullfd, STDOUT_FILENO); + close(devnullfd); +# elif !defined(__CYGWIN__) fclose(stdin); fclose(stdout); -#endif +# endif /* * If a write of zero bytes to stderr returns non-zero, i.e. -1, * then writing to stderr failed, and we'll write somewhere else @@ -250,6 +258,7 @@ OsInit(void) setlinebuf(stderr); #endif } +#endif /* !XQUARTZ */ #if !defined(WIN32) || defined(__CYGWIN__) if (getpgrp() == 0) diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index fb20da755..608ee6ab0 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -2071,3 +2071,27 @@ FormatUInt64Hex(uint64_t num, char *string) string[len] = '\0'; } + +/* Move a file descriptor out of the way of our select mask; this + * is useful for file descriptors which will never appear in the + * select mask to avoid reducing the number of clients that can + * connect to the server + */ +int +os_move_fd(int fd) +{ + int newfd; + +#ifdef F_DUPFD_CLOEXEC + newfd = fcntl(fd, F_DUPFD_CLOEXEC, MAXCLIENTS); +#else + newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); +#endif + if (newfd < 0) + return fd; +#ifndef F_DUPFD_CLOEXEC + fcntl(newfd, F_SETFD, FD_CLOEXEC); +#endif + close(fd); + return newfd; +} diff --git a/xorg-server/present/present.c b/xorg-server/present/present.c index f9eef6b26..50bd05539 100644 --- a/xorg-server/present/present.c +++ b/xorg-server/present/present.c @@ -115,7 +115,8 @@ present_check_flip(RRCrtcPtr crtc, } /* Make sure the window hasn't been redirected with Composite */ - if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen)) + if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen) && + screen->GetWindowPixmap(window) != screen_priv->flip_pixmap) return FALSE; /* Check for full-screen window */ @@ -311,6 +312,36 @@ present_flip_idle(ScreenPtr screen) } } +struct pixmap_visit { + PixmapPtr old; + PixmapPtr new; +}; + +static int +present_set_tree_pixmap_visit(WindowPtr window, pointer data) +{ + struct pixmap_visit *visit = data; + ScreenPtr screen = window->drawable.pScreen; + + if ((*screen->GetWindowPixmap)(window) != visit->old) + return WT_DONTWALKCHILDREN; + (*screen->SetWindowPixmap)(window, visit->new); + return WT_WALKCHILDREN; +} + +static void +present_set_tree_pixmap(WindowPtr window, PixmapPtr pixmap) +{ + struct pixmap_visit visit; + ScreenPtr screen = window->drawable.pScreen; + + visit.old = (*screen->GetWindowPixmap)(window); + visit.new = pixmap; + if (visit.old == visit.new) + return; + TraverseTree(window, present_set_tree_pixmap_visit, &visit); +} + static void present_unflip(ScreenPtr screen) { @@ -319,6 +350,12 @@ present_unflip(ScreenPtr screen) assert (!screen_priv->unflip_event_id); assert (!screen_priv->flip_pending); + if (screen_priv->flip_window) + present_set_tree_pixmap(screen_priv->flip_window, + (*screen->GetScreenPixmap)(screen)); + + present_set_tree_pixmap(screen->root, (*screen->GetScreenPixmap)(screen)); + /* Update the screen pixmap with the current flip pixmap contents */ if (screen_priv->flip_pixmap && screen_priv->flip_window) { @@ -348,6 +385,8 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) present_flip_idle(screen); + xorg_list_del(&vblank->event_queue); + /* Transfer reference for pixmap and fence from vblank to screen_priv */ screen_priv->flip_crtc = vblank->crtc; screen_priv->flip_window = vblank->window; @@ -378,14 +417,12 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc) DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc)); xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) { if (vblank->event_id == event_id) { - xorg_list_del(&vblank->event_queue); present_execute(vblank, ust, msc); return; } } xorg_list_for_each_entry_safe(vblank, tmp, &present_flip_queue, event_queue) { if (vblank->event_id == event_id) { - xorg_list_del(&vblank->event_queue); present_flip_notify(vblank, ust, msc); return; } @@ -447,7 +484,7 @@ present_check_flip_window (WindowPtr window) /* Now check any queued vblanks */ xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) { - if (vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, FALSE, NULL, 0, 0)) + if (vblank->queued && vblank->flip && !present_check_flip(vblank->crtc, window, vblank->pixmap, FALSE, NULL, 0, 0)) vblank->flip = FALSE; } } @@ -486,7 +523,8 @@ static void present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) { WindowPtr window = vblank->window; - present_screen_priv_ptr screen_priv = present_screen_priv(window->drawable.pScreen); + ScreenPtr screen = window->drawable.pScreen; + present_screen_priv_ptr screen_priv = present_screen_priv(screen); if (vblank->wait_fence) { if (!present_fence_check_triggered(vblank->wait_fence)) { @@ -496,22 +534,45 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) } xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; + if (vblank->pixmap && vblank->window) { if (vblank->flip && screen_priv->flip_pending == NULL && !screen_priv->unflip_event_id) { DebugPresent(("\tf %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id)); - /* Prepare to flip by removing from the window/screen lists + /* Prepare to flip by placing it in the flip queue and * and sticking it into the flip_pending field */ screen_priv->flip_pending = vblank; - xorg_list_del(&vblank->window_list); xorg_list_add(&vblank->event_queue, &present_flip_queue); /* Try to flip */ - if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) + if (present_flip(vblank->crtc, vblank->event_id, vblank->target_msc, vblank->pixmap, vblank->sync_flip)) { + RegionPtr damage; + + /* Fix window pixmaps: + * 1) Restore previous flip window pixmap + * 2) Set current flip window pixmap to the new pixmap + */ + if (screen_priv->flip_window && screen_priv->flip_window != window) + present_set_tree_pixmap(screen_priv->flip_window, + (*screen->GetScreenPixmap)(screen)); + present_set_tree_pixmap(vblank->window, vblank->pixmap); + present_set_tree_pixmap(screen->root, vblank->pixmap); + + /* Report update region as damaged + */ + if (vblank->update) { + damage = vblank->update; + RegionIntersect(damage, damage, &window->clipList); + } else + damage = &window->clipList; + + DamageDamageRegion(&vblank->window->drawable, damage); return; + } xorg_list_del(&vblank->event_queue); /* Oops, flip failed. Clear the flip_pending field @@ -531,7 +592,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc) /* Check current flip */ if (window == screen_priv->flip_window) - present_unflip(window->drawable.pScreen); + present_unflip(screen); } present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off); @@ -577,7 +638,9 @@ present_pixmap(WindowPtr window, if (!window_priv) return BadAlloc; - if (!target_crtc) { + if (!screen_priv || !screen_priv->info) + target_crtc = NULL; + else if (!target_crtc) { /* Update the CRTC if we have a pixmap or we don't have a CRTC */ if (!pixmap) @@ -621,6 +684,11 @@ present_pixmap(WindowPtr window, if (vblank->crtc != target_crtc || vblank->target_msc != target_msc) continue; + DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n", + vblank->event_id, vblank, target_msc, + vblank->pixmap->drawable.id, vblank->window->drawable.id, + vblank->crtc)); + present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, vblank->idle_fence); present_fence_destroy(vblank->idle_fence); dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); @@ -696,10 +764,12 @@ present_pixmap(WindowPtr window, target_crtc)); xorg_list_add(&vblank->event_queue, &present_exec_queue); + vblank->queued = TRUE; if (target_msc >= crtc_msc) { ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc); if (ret != Success) { xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; goto failure; } } else @@ -732,6 +802,7 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64 xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) { if (vblank->event_id == event_id) { xorg_list_del(&vblank->event_queue); + vblank->queued = FALSE; return; } } diff --git a/xorg-server/present/present.h b/xorg-server/present/present.h index 6a451fb23..0e3bdc08e 100644 --- a/xorg-server/present/present.h +++ b/xorg-server/present/present.h @@ -115,4 +115,13 @@ present_event_abandon(RRCrtcPtr crtc); extern _X_EXPORT Bool present_screen_init(ScreenPtr screen, present_screen_info_ptr info); +typedef void (*present_complete_notify_proc)(WindowPtr window, + CARD8 mode, + CARD32 serial, + uint64_t ust, + uint64_t msc); + +extern _X_EXPORT void +present_register_complete_notify(present_complete_notify_proc proc); + #endif /* _PRESENT_H_ */ diff --git a/xorg-server/present/present_event.c b/xorg-server/present/present_event.c index a8f7176eb..f0d509ed4 100644 --- a/xorg-server/present/present_event.c +++ b/xorg-server/present/present_event.c @@ -137,6 +137,14 @@ present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, } } +static present_complete_notify_proc complete_notify; + +void +present_register_complete_notify(present_complete_notify_proc proc) +{ + complete_notify = proc; +} + void present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc) { @@ -165,6 +173,8 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se } } } + if (complete_notify) + (*complete_notify)(window, mode, serial, ust, msc); } void diff --git a/xorg-server/present/present_priv.h b/xorg-server/present/present_priv.h index 500c7c265..8d3e0079c 100644 --- a/xorg-server/present/present_priv.h +++ b/xorg-server/present/present_priv.h @@ -69,9 +69,10 @@ struct present_vblank { present_fence_ptr wait_fence; present_notify_ptr notifies; int num_notifies; - Bool flip; - Bool sync_flip; - Bool abort_flip; + Bool queued; /* on present_exec_queue */ + Bool flip; /* planning on using flip */ + Bool sync_flip; /* do flip synchronous to vblank */ + Bool abort_flip; /* aborting this flip */ }; typedef struct present_screen_priv { diff --git a/xorg-server/present/present_request.c b/xorg-server/present/present_request.c index 095fa2daf..1064dcb3b 100644 --- a/xorg-server/present/present_request.c +++ b/xorg-server/present/present_request.c @@ -26,6 +26,7 @@ #include "present_priv.h" #include "randrstr.h" +#include <protocol-versions.h> static int proc_present_query_version(ClientPtr client) @@ -35,8 +36,8 @@ proc_present_query_version(ClientPtr client) .type = X_Reply, .sequenceNumber = client->sequence, .length = 0, - .majorVersion = PRESENT_MAJOR, - .minorVersion = PRESENT_MINOR + .majorVersion = SERVER_PRESENT_MAJOR_VERSION, + .minorVersion = SERVER_PRESENT_MINOR_VERSION }; REQUEST_SIZE_MATCH(xPresentQueryVersionReq); diff --git a/xorg-server/present/present_screen.c b/xorg-server/present/present_screen.c index 2702cd6ca..25ef6818d 100644 --- a/xorg-server/present/present_screen.c +++ b/xorg-server/present/present_screen.c @@ -206,6 +206,11 @@ present_extension_init(void) ExtensionEntry *extension; int i; +#ifdef PANORAMIX + if (!noPanoramiXExtension) + return; +#endif + extension = AddExtension(PRESENT_NAME, PresentNumberEvents, PresentNumberErrors, proc_present_dispatch, sproc_present_dispatch, NULL, StandardMinorOpcode); diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c index 0e9ca443f..14a02ba1d 100644 --- a/xorg-server/xfixes/region.c +++ b/xorg-server/xfixes/region.c @@ -857,6 +857,7 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client) { int result = Success, j; PanoramiXRes *win; + RegionPtr reg = NULL; REQUEST(xXFixesSetWindowShapeRegionReq); @@ -869,10 +870,22 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client) return result; } + if (win->u.win.root) + VERIFY_REGION_OR_NONE(reg, stuff->region, client, DixReadAccess); + FOR_NSCREENS_FORWARD(j) { + ScreenPtr screen = screenInfo.screens[j]; stuff->dest = win->info[j].id; + + if (reg) + RegionTranslate(reg, -screen->x, -screen->y); + result = (*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client); + + if (reg) + RegionTranslate(reg, screen->x, screen->y); + if (result != Success) break; } @@ -886,6 +899,7 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client) REQUEST(xXFixesSetPictureClipRegionReq); int result = Success, j; PanoramiXRes *pict; + RegionPtr reg = NULL; REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq); @@ -896,10 +910,22 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client) return result; } + if (pict->u.pict.root) + VERIFY_REGION_OR_NONE(reg, stuff->region, client, DixReadAccess); + FOR_NSCREENS_BACKWARD(j) { + ScreenPtr screen = screenInfo.screens[j]; stuff->picture = pict->info[j].id; + + if (reg) + RegionTranslate(reg, -screen->x, -screen->y); + result = (*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client); + + if (reg) + RegionTranslate(reg, screen->x, screen->y); + if (result != Success) break; } diff --git a/xorg-server/xkeyboard-config/rules/HDR b/xorg-server/xkeyboard-config/rules/HDR index 769b8fc7f..9ee3e39d8 100644 --- a/xorg-server/xkeyboard-config/rules/HDR +++ b/xorg-server/xkeyboard-config/rules/HDR @@ -15,6 +15,7 @@ ! model layout[3] variant[3] = symbols ! model layout[4] variant[4] = symbols ! model = symbols +! model layout = symbols ! layout variant = compat ! layout[1] variant[1] = compat ! layout[2] variant[2] = compat diff --git a/xorg-server/xkeyboard-config/rules/Makefile.am b/xorg-server/xkeyboard-config/rules/Makefile.am index f2d73ce80..9ab91dcf3 100644 --- a/xorg-server/xkeyboard-config/rules/Makefile.am +++ b/xorg-server/xkeyboard-config/rules/Makefile.am @@ -23,6 +23,7 @@ endif if USE_COMPAT_RULES base_parts = base.hdr.part base.lists.part \ +base.lists.base.part \ compat/base.lists.part \ HDR base.m_k.part \ HDR base.l1_k.part \ @@ -41,6 +42,7 @@ HDR compat/base.ml2v2_s.part \ HDR compat/base.ml3v3_s.part \ HDR compat/base.ml4v4_s.part \ HDR base.m_s.part \ +HDR base.ml_s1.part \ HDR compat/base.lv_c.part \ HDR compat/base.l1v1_c.part \ HDR compat/base.l2v2_c.part \ @@ -59,6 +61,7 @@ HDR base.o_c.part \ HDR base.o_t.part evdev_parts = base.hdr.part base.lists.part \ +evdev.lists.part \ compat/base.lists.part \ HDR evdev.m_k.part \ HDR base.l1_k.part \ @@ -77,6 +80,7 @@ HDR compat/base.ml2v2_s.part \ HDR compat/base.ml3v3_s.part \ HDR compat/base.ml4v4_s.part \ HDR evdev.m_s.part \ +HDR \ HDR compat/base.lv_c.part \ HDR compat/base.l1v1_c.part \ HDR compat/base.l2v2_c.part \ @@ -97,6 +101,7 @@ HDR base.o_t.part else base_parts = base.hdr.part base.lists.part \ +base.lists.base.part \ HDR base.m_k.part \ HDR base.l1_k.part \ HDR base.l_k.part \ @@ -114,6 +119,7 @@ HDR \ HDR \ HDR \ HDR base.m_s.part \ +HDR base.ml_s1.part \ HDR \ HDR \ HDR \ @@ -132,6 +138,7 @@ HDR base.o_c.part \ HDR base.o_t.part evdev_parts = base.hdr.part base.lists.part \ +evdev.lists.part \ HDR evdev.m_k.part \ HDR base.l1_k.part \ HDR base.l_k.part \ @@ -154,6 +161,7 @@ HDR \ HDR \ HDR \ HDR \ +HDR \ HDR base.ml_c.part \ HDR base.ml1_c.part \ HDR base.m_t.part \ @@ -170,6 +178,8 @@ endif all_parts_dist = HDR base.hdr.part \ base.lists.part \ +base.lists.base.part \ +evdev.lists.part \ base.m_k.part \ base.l1_k.part \ base.l_k.part \ @@ -183,6 +193,7 @@ base.ml2_s.part \ base.ml3_s.part \ base.ml4_s.part \ base.m_s.part \ +base.ml_s1.part \ base.ml_c.part \ base.ml1_c.part \ base.m_t.part \ diff --git a/xorg-server/xkeyboard-config/rules/base.extras.xml.in b/xorg-server/xkeyboard-config/rules/base.extras.xml.in index c05fe0a08..aa47e3da0 100644 --- a/xorg-server/xkeyboard-config/rules/base.extras.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.extras.xml.in @@ -685,8 +685,16 @@ <name>se</name> <_shortDescription>sv</_shortDescription> <_description>Swedish</_description> - </configItem> - <variantList> + </configItem> + <variantList> + <variant> + <configItem> + <name>dvorak_a5</name> + <_description>Swedish (Dvorak A5)</_description> + </configItem> + </variant> + </variantList> + <variantList> <variant> <configItem> <name>sun_type6</name> diff --git a/xorg-server/xkeyboard-config/rules/base.lists.base.part b/xorg-server/xkeyboard-config/rules/base.lists.base.part new file mode 100644 index 000000000..1b2094894 --- /dev/null +++ b/xorg-server/xkeyboard-config/rules/base.lists.base.part @@ -0,0 +1,54 @@ +! $inetkbds = acer_c300 acer_ferrari4k acer_laptop \ + airkey \ + apple armada azonaRF2300 \ + benqx brother \ + btc5113rf btc9000 btc9000a btc9001ah btc5090 btc9019u \ + cherryblue cherrybluea cherryblueb \ + cherrycyboard cherrycmexpert \ + chicony chicony0108 chicony0420 chicony9885 \ + compalfl90 \ + compaqeak8 compaqik7 compaqik13 compaqik18 \ + creativedw7000 \ + cymotionlinux \ + dell dellm65 inspiron dellusbmm \ + emachines ennyah_dkb1008 evdev \ + genius geniuscomfy2 \ + gyration honeywell_euroboard \ + hp250x hp5xx hp500fa hpdv5 \ + hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx htcdream \ + ibm_spacesaver ipaq inspiron intel \ + logiaccess logicda logicink \ + logiex110 logiclx300 \ + logiinkse logiinkseusb logiitc logiik \ + logitech_base itouch logiultrax \ + logitech_g15 \ + logidinovo logidinovoedge \ + microsoft4000 microsoft7000 microsoftinet microsoftprousb microsoftprooem microsoftprose \ + microsoftoffice microsoftmult \ + mx1998 mx2500 mx2750 \ + oretec \ + pc105 \ + presario propeller \ + qtronix \ + rapidaccess rapidaccess2 thinkpad60 \ + samsung4500 samsung4510 \ + silvercrest \ + sk1300 sk2500 sk6200 sk7100 \ + sven sven303 symplon \ + toshiba_s3000 trust trustda \ + unitekkb1925 yahoo + +! $inetmediakbds = acer_ferrari4k acer_laptop btc5090 btc9019u cherryblueb \ + cherrybluea herrycyboard chicony042 compaqik13 compaqik18 \ + armada presario dellm65 inspiron dellusbmm diamond \ + ennyah_dkb1008 genius geniuscomfy2 hpi6 hpxe3gc hpxe3gf \ + hpxt1000 hpzt11xx hpdv5 hpxe4xxx hp5xx thinkpad60 ogitech_base \ + logidinovo logidinovoedge logitech_g15 mx1998 mx2500 mx2750 \ + microsoft4000 microsoft7000 microsoftprooem microsoftmult \ + propeller samsung4500 samsung4510 sk1300 sk2500 sk7100 \ + toshiba_s3000 trust trustda cymotionlinux silvercrest \ + emachines benqx unitekkb1925 creativedw7000 compalfl90 \ + pc105 a4techKB21 a4techKBS8 a4_rfkb23 asus_laptop btc6301urf \ + dexxa dtk2000 fscaa1667g geniuskb19e geniuscomfy latitude \ + microsoftpro precision_m scorpius sp_inet targa_v811 thinkpad \ + tm2030USB-102 tm2030USB-106 trust_slimline diff --git a/xorg-server/xkeyboard-config/rules/base.lists.part b/xorg-server/xkeyboard-config/rules/base.lists.part index 97b3b907f..08c081821 100644 --- a/xorg-server/xkeyboard-config/rules/base.lists.part +++ b/xorg-server/xkeyboard-config/rules/base.lists.part @@ -33,45 +33,6 @@ ! $azerty = be fr ! $qwertz = al cz de hr hu ro si sk -! $inetkbds = acer_c300 acer_ferrari4k acer_laptop \ - airkey \ - apple armada azonaRF2300 \ - benqx brother \ - btc5113rf btc9000 btc9000a btc9001ah btc5090 btc9019u \ - cherryblue cherrybluea cherryblueb \ - cherrycyboard cherrycmexpert \ - chicony chicony0108 chicony0420 chicony9885 \ - compalfl90 \ - compaqeak8 compaqik7 compaqik13 compaqik18 \ - creativedw7000 \ - cymotionlinux \ - dell dellm65 inspiron dellusbmm \ - emachines ennyah_dkb1008 evdev \ - genius geniuscomfy2 \ - gyration honeywell_euroboard \ - hp250x hp5xx hp500fa hpdv5 \ - hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx htcdream \ - ibm_spacesaver ipaq inspiron intel \ - logiaccess logicda logicink \ - logiex110 logiclx300 \ - logiinkse logiinkseusb logiitc logiik \ - logitech_base itouch logiultrax \ - logitech_g15 \ - logidinovo logidinovoedge \ - microsoft4000 microsoft7000 microsoftinet microsoftprousb microsoftprooem microsoftprose \ - microsoftoffice microsoftmult \ - mx1998 mx2500 mx2750 \ - oretec \ - pc105 \ - presario propeller \ - qtronix \ - rapidaccess rapidaccess2 thinkpad60 \ - samsung4500 samsung4510 \ - silvercrest \ - sk1300 sk2500 sk6200 sk7100 \ - sven sven303 symplon \ - toshiba_s3000 trust trustda \ - unitekkb1925 yahoo // all layouts with 3rd and 4th groups ! $threelevellayouts = al az \ @@ -95,8 +56,6 @@ vn \ za -! $evdevkbds = ibm_spacesaver - ! $thinkpads = thinkpad thinkpad60 thinkpadz60 ! $sun = sun_type6_jp sun_type6_usb sun_type6_euro_usb \ @@ -117,3 +76,4 @@ ! $sun_compat = sun_type6 sun_type6_suncompat sun_type7_suncompat suncompat ! $htcdreamlayouts = us it de + diff --git a/xorg-server/xkeyboard-config/rules/base.ml_s1.part b/xorg-server/xkeyboard-config/rules/base.ml_s1.part new file mode 100644 index 000000000..1a35202da --- /dev/null +++ b/xorg-server/xkeyboard-config/rules/base.ml_s1.part @@ -0,0 +1 @@ + $inetmediakbds jp = +jp(henkan) diff --git a/xorg-server/xkeyboard-config/rules/base.o_s.part b/xorg-server/xkeyboard-config/rules/base.o_s.part index 35b6ef3b6..a31556b55 100644 --- a/xorg-server/xkeyboard-config/rules/base.o_s.part +++ b/xorg-server/xkeyboard-config/rules/base.o_s.part @@ -8,6 +8,7 @@ altwin:hyper_win = +altwin(hyper_win) altwin:alt_super_win = +altwin(alt_super_win) altwin:swap_alt_win = +altwin(swap_alt_win) + grab:debug = +srvr_ctrl(grab_debug) grp:switch = +group(switch) grp:lswitch = +group(lswitch) grp:win_switch = +group(win_switch) diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 1c75531d8..42fda3fb2 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -1762,9 +1762,9 @@ <layout> <configItem> <name>bd</name> - <!-- Keyboard indicator for Bengali layouts --> + <!-- Keyboard indicator for Bangla layouts --> <_shortDescription>bn</_shortDescription> - <_description>Bengali</_description> + <_description>Bangla</_description> <languageList> <iso639Id>ben</iso639Id> </languageList> @@ -1773,7 +1773,7 @@ <variant> <configItem> <name>probhat</name> - <_description>Bengali (Probhat)</_description> + <_description>Bangla (Probhat)</_description> </configItem> </variant> </variantList> @@ -1789,9 +1789,9 @@ <variant> <configItem> <name>ben</name> - <!-- Keyboard indicator for Bengali layouts --> + <!-- Keyboard indicator for Bangla layouts --> <_shortDescription>bn</_shortDescription> - <_description>Bengali (India)</_description> + <_description>Bangla (India)</_description> <languageList> <iso639Id>ben</iso639Id> </languageList> @@ -1800,9 +1800,9 @@ <variant> <configItem> <name>ben_probhat</name> - <!-- Keyboard indicator for Bengali layouts --> + <!-- Keyboard indicator for Bangla layouts --> <_shortDescription>bn</_shortDescription> - <_description>Bengali (India, Probhat)</_description> + <_description>Bangla (India, Probhat)</_description> <languageList> <iso639Id>ben</iso639Id> </languageList> @@ -1811,28 +1811,28 @@ <variant> <configItem> <name>ben_baishakhi</name> - <_description>Bengali (India, Baishakhi)</_description> + <_description>Bangla (India, Baishakhi)</_description> <languageList><iso639Id>ben</iso639Id></languageList> </configItem> </variant> <variant> <configItem> <name>ben_bornona</name> - <_description>Bengali (India, Bornona)</_description> + <_description>Bangla (India, Bornona)</_description> <languageList><iso639Id>ben</iso639Id></languageList> </configItem> </variant> <variant> <configItem> <name>ben_gitanjali</name> - <_description>Bengali (India, Uni Gitanjali)</_description> + <_description>Bangla (India, Uni Gitanjali)</_description> <languageList><iso639Id>ben</iso639Id></languageList> </configItem> </variant> <variant> <configItem> <name>ben_inscript</name> - <_description>Bengali (India, Baishakhi Inscript)</_description> + <_description>Bangla (India, Baishakhi Inscript)</_description> <languageList><iso639Id>ben</iso639Id></languageList> </configItem> </variant> @@ -6033,6 +6033,24 @@ <_description>Right Alt as Right Ctrl</_description> </configItem> </option> + <option> + <configItem> + <name>ctrl:swap_lalt_lctl</name> + <_description>Swap Left Alt key with Left Ctrl key</_description> + </configItem> + </option> + <option> + <configItem> + <name>ctrl:swap_lwin_lctl</name> + <_description>Swap Left Win key with Left Ctrl key</_description> + </configItem> + </option> + <option> + <configItem> + <name>ctrl:swap_lalt_lctl_lwin</name> + <_description>Left Alt as Ctrl, Left Ctrl as Win, Left Win as Alt</_description> + </configItem> + </option> </group> <group allowMultipleSelection="true"> <!-- Using startard LEDs to indicate the alternative (not first) group(s) --> @@ -6532,6 +6550,12 @@ <_description>Allow breaking grabs with keyboard actions (warning: security risk)</_description> </configItem> </option> + <option> + <configItem> + <name>grab:debug_actions</name> + <_description>Allow grab and window tree logging</_description> + </configItem> + </option> </group> <group allowMultipleSelection="true"> <!-- Special shortcuts for the Euro character --> diff --git a/xorg-server/xkeyboard-config/rules/evdev.lists.part b/xorg-server/xkeyboard-config/rules/evdev.lists.part new file mode 100644 index 000000000..7b5d0d46d --- /dev/null +++ b/xorg-server/xkeyboard-config/rules/evdev.lists.part @@ -0,0 +1 @@ +! $evdevkbds = ibm_spacesaver diff --git a/xorg-server/xkeyboard-config/symbols/af b/xorg-server/xkeyboard-config/symbols/af index 972769b36..b93019a95 100644 --- a/xorg-server/xkeyboard-config/symbols/af +++ b/xorg-server/xkeyboard-config/symbols/af @@ -81,7 +81,7 @@ xkb_symbols "basic" { // // 2006-02-15 file created by M. Emal Alekozai <memala@gmx.net> -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "ps" { name[Group1]= "Pashto"; @@ -152,7 +152,7 @@ xkb_symbols "ps" { // // 2006-02-15 file created by M. Emal Alekozai <memala@gmx.net> -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "uz" { name[Group1]= "Uzbek (Afghanistan)"; @@ -212,7 +212,7 @@ xkb_symbols "uz" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "olpc-ps" { name[Group1]= "Pashto (Afghanistan, OLPC)"; @@ -273,7 +273,7 @@ xkb_symbols "olpc-ps" { include "group(olpc)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "fa-olpc" { name[Group1]= "Persian (Afghanistan, Dari OLPC)"; @@ -334,7 +334,7 @@ xkb_symbols "fa-olpc" { include "group(olpc)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "uz-olpc" { name[Group1]= "Uzbek (Afghanistan, OLPC)"; diff --git a/xorg-server/xkeyboard-config/symbols/altwin b/xorg-server/xkeyboard-config/symbols/altwin index 333b7dacd..239d4878c 100644 --- a/xorg-server/xkeyboard-config/symbols/altwin +++ b/xorg-server/xkeyboard-config/symbols/altwin @@ -1,5 +1,5 @@ // Meta is mapped to second level of Alt keys. -partial modifier_keys +partial modifier_keys xkb_symbols "meta_alt" { key <LALT> { [ Alt_L, Meta_L ] }; key <RALT> { type[Group1] = "TWO_LEVEL", @@ -9,7 +9,7 @@ xkb_symbols "meta_alt" { }; // Alt is mapped to the Win keys (and the usual Alt keys). -partial modifier_keys +partial modifier_keys xkb_symbols "alt_win" { key <LWIN> { [ Alt_L ] }; key <RWIN> { [ Alt_R ] }; @@ -17,7 +17,7 @@ xkb_symbols "alt_win" { }; // Ctrl is mapped to the Win keys (and the usual Ctrl keys). -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_win" { key <LWIN> { [ Control_L ] }; key <RWIN> { [ Control_R ] }; @@ -25,19 +25,22 @@ xkb_symbols "ctrl_win" { }; // Ctrl is mapped to the Alt keys, Alt to the Win keys, and Win to the Ctrl keys. -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_alt_win" { key <LALT> { [ Control_L, Control_L ] }; key <RALT> { type[Group1] = "TWO_LEVEL", symbols[Group1] = [ Control_R, Control_R ] }; key <LWIN> { [ Alt_L, Meta_L ] }; key <RWIN> { [ Alt_R, Meta_R ] }; + key <LCTL> { [ Super_L ] }; + key <RCTL> { [ Super_R ] }; modifier_map Control { <RALT>, <LALT> }; modifier_map Mod1 { <LWIN>, <RWIN> }; + modifier_map Mod4 { <LCTL>, <RCTL> }; }; // Meta is mapped to the Win keys. -partial modifier_keys +partial modifier_keys xkb_symbols "meta_win" { key <LALT> { [ Alt_L, Alt_L ] }; key <RALT> { type[Group1] = "TWO_LEVEL", @@ -49,7 +52,7 @@ xkb_symbols "meta_win" { }; // Meta is mapped to the left Win key. -partial modifier_keys +partial modifier_keys xkb_symbols "left_meta_win" { key <LALT> { [ Alt_L, Alt_L ] }; key <LWIN> { [ Meta_L ] }; @@ -58,7 +61,7 @@ xkb_symbols "left_meta_win" { }; // Hyper is mapped to the Win keys. -partial modifier_keys +partial modifier_keys xkb_symbols "hyper_win" { key <LWIN> { [ Hyper_L ] }; key <RWIN> { [ Hyper_R ] }; @@ -66,13 +69,13 @@ xkb_symbols "hyper_win" { }; // Menu is mapped to the Menu key. -partial modifier_keys +partial modifier_keys xkb_symbols "menu" { key <MENU> { [ Menu ] }; }; // Layout for Tux key caps with additional right Alt key -partial modifier_keys +partial modifier_keys xkb_symbols "alt_super_win" { key <LALT> { [ Alt_L, Meta_L ] }; key <RWIN> { [ Alt_R, Meta_R ] }; @@ -83,14 +86,14 @@ xkb_symbols "alt_super_win" { }; // Swap the Alt and Win keys. -partial modifier_keys +partial modifier_keys xkb_symbols "swap_alt_win" { include "altwin(swap_lalt_lwin)" include "altwin(swap_ralt_rwin)" }; // Swap the left Alt and Win keys. -partial hidden modifier_keys +partial hidden modifier_keys xkb_symbols "swap_lalt_lwin" { key <LALT> { type[Group1] = "ONE_LEVEL", symbols[Group1] = [ Super_L ] }; @@ -98,7 +101,7 @@ xkb_symbols "swap_lalt_lwin" { }; // Swap the right Alt and Win keys. -partial hidden modifier_keys +partial hidden modifier_keys xkb_symbols "swap_ralt_rwin" { key <RALT> { type[Group1] = "ONE_LEVEL", symbols[Group1] = [ Super_R ] }; diff --git a/xorg-server/xkeyboard-config/symbols/am b/xorg-server/xkeyboard-config/symbols/am index b7cc6f69e..dbe6e96d8 100644 --- a/xorg-server/xkeyboard-config/symbols/am +++ b/xorg-server/xkeyboard-config/symbols/am @@ -71,9 +71,9 @@ xkb_symbols "olpc" { xkb_symbols "phonetic" { include "am(basic)" name[Group1]= "Armenian (phonetic)"; - + key <BKSL> { [ 0x1000577, 0x1000547 ] }; - + key <AE01> { [ 0x1000567, 0x1000537 ] }; key <AE02> { [ 0x1000569, 0x1000539 ] }; key <AE03> { [ 0x1000583, 0x1000553 ] }; diff --git a/xorg-server/xkeyboard-config/symbols/apl b/xorg-server/xkeyboard-config/symbols/apl index 4262d2480..0800b5bbd 100644 --- a/xorg-server/xkeyboard-config/symbols/apl +++ b/xorg-server/xkeyboard-config/symbols/apl @@ -5,7 +5,7 @@ // This file supports: // - The Sharp APL for Unix (SAX) layout // - The IBM APL2 layout -// - The Manugistics APL*PLUS II (Version 5.1, 1993) keyboard layout +// - The Manugistics APL*PLUS II layout (version 5.1, 1993) // - The Dyalog APL layout - with additions for box drawing and commands // Unicode APL table: http://aplwiki.com/UnicodeAplTable @@ -16,27 +16,27 @@ // This file doesn't deal with all the combining stuff -- I'm not an APL programmer, // and am not quite sure what's needed here. However, it may be possible to get this -// working with dead keys and the like. Patches gratefully accepted. +// working with dead keys and the like. Patches gratefully accepted. // Some of the shift-key assignments may differ from the APL tradition. If -// that's not considered acceptable, it should be possible to remap the +// that's not considered acceptable, it should be possible to remap the // shift keys. I have striven, however, to ensure that the use of shift keys -// in these maps is at least self-consistent. +// in these maps is at least self-consistent. -// I'm assuming that this will be used with another keyboard layout (ie. for -// your language), with a special shift key to use these maps. +// I'm assuming that this will be used with another keyboard layout (i.e. for +// your language), with a special shift key to use these maps. -// 2011-12-22 Geoff Streeter: geoff@dyalog.com -// Added the Dyalog support. -// Corrected (what he thinks) are some errors. -// Resolving the confusion between APL's and Unicode's concept of Left and Right tacks. -// Unsure about some of the inheritance from APL2 into APLPLUS. Patches welcome. -// Complied with freedesktop.org requirement that the keycodes be in sorted order. Which -// leads to the bottom to top (roughly) definitions. +// 2011-12-22 Geoff Streeter <geoff@dyalog.com>, +// added the Dyalog support; +// corrected (what he thinks) are some errors: +// resolving the confusion between APL's and Unicode's concept of Left and Right tacks; +// unsure about some of the inheritance from APL2 into APLPLUS -- patches welcome; +// complied with freedesktop.org requirement that the keycodes be in sorted order, +// which leads to the bottom to top (roughly) definitions. -// default layout seems to have to be the first one. Choosing the basic Dyalog layout is definitely -// better than using the "common" one. Choosing the complete Dyalog layout is not useful to non-Dyalog -// users. +// The default layout still has to be the first one. Choosing the basic Dyalog layout is +// definitely better than using the "common" one. Choosing the complete Dyalog layout is +// not useful to non-Dyalog users. default partial alphanumeric_keys xkb_symbols "basic" { @@ -235,7 +235,7 @@ xkb_symbols "apl2" { key <AB10> { [ slash, backslash, U233F ] }; // /: ⌿ -- AFS Slash Bar key <AC10> { [ bracketleft, parenleft, U234E ] }; // ;: ⍎ -- [See B key in SAX layout] - key <AC11> { [ bracketright, parenright, U2355 ] }; // ': ⍕ -- [See N key in SAX layout] + key <AC11> { [ bracketright, parenright, U2355 ] }; // ': ⍕ -- [See N key in SAX layout] key <AD11> { [ NoSymbol, U2192, U235E ] }; // [: (←) → ⍞ -- Rightwards Arrow / AFS Quote Quad key <AD12> { [ U2337, U2378, U2359 ] }; // ]: ⌷ ⍸ ⍙ -- AFS Squish Quad / AFS Iota Underbar / AFS Delta Underbar @@ -255,7 +255,7 @@ xkb_symbols "apl2" { key <BKSL> { [ U2261, U2377, U2364 ] }; // \: ≡ ⍷ ⍤ -- Identical To / AFS Epsilon Underbar / AFS Jot Diaeresis - key <TLDE> { [ NoSymbol, U233B, U2342 ] }; // `: ⌻ ⍂ -- + key <TLDE> { [ NoSymbol, U233B, U2342 ] }; // `: ⌻ ⍂ -- include "level3(ralt_switch)" }; @@ -289,7 +289,7 @@ xkb_symbols "aplplusII" { name[Group1]= "APL keyboard symbols (Manugistics APL*PLUS II)"; key <AC10> { [ bracketleft, parenleft, U234E ] }; // ;: ⍎ -- [See B key in SAX layout] - key <AC11> { [ bracketright, parenright, U2355 ] }; // ': ⍕ -- [See N key in SAX layout] + key <AC11> { [ bracketright, parenright, U2355 ] }; // ': ⍕ -- [See N key in SAX layout] key <AD11> { [ U2190, NoSymbol, U235E ] }; // [: ← ⍞ -- Leftwards Arrow / AFS Quote Quad key <AD12> { [ U2192, NoSymbol, U236C ] }; // ]: → ⍬ -- Rightwards Arrow / AFS Zilde key <AE01> { [ NoSymbol, NoSymbol, U2261 ] }; // 1: ≡ -- Identical To @@ -350,22 +350,20 @@ xkb_symbols "aplx" { }; // APL language support for the Dyalog keyboard. -// Dyalog Ltd sell this keyboard with APL engravings. The current model is -// engraved on a Cherry G80. Base languages for US, UK and DK are availible. +// Dyalog Ltd sells this keyboard with APL engravings. The current model is +// engraved on a Cherry G80. Base languages for US, UK and DK are available. -// Geoff Streeter, Dyalog Ltd. 2007-09-03 -// geoff@dyalog.com +// Geoff Streeter, Dyalog Ltd. 2007-09-03 <geoff@dyalog.com> // extended for APL special actions 2008-09-09 -// add variant 2010-11-26 +// added a variant 2010-11-26 -// The intention is that this keyboard layout overlays a base keyboard that provides +// The intention is that this keyboard layout overlays a base keyboard that provides // the alphabet and similar. If this keyboard is placed as the 2nd layout then it can // be reached with a latching shift to increase group by one. partial hidden alphanumeric_keys xkb_symbols "dyalog_base" { - // ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━━━┓ // │ │ ⌶ │ ⍫ │ ⍒ │ ⍋ │ ⌽ │ ⍉ │ ⊖ │ ⍟ │ ⍱ │ ⍲ │ ! │ ⌹ ┃ ┃ // │ ⋄ │ ¨ │ ¯ │ < │ ≤ │ = │ ≥ │ > │ ≠ │ ∨ │ ∧ │ × │ ÷ ┃ ┃ @@ -383,7 +381,6 @@ xkb_symbols "dyalog_base" { // ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ // ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹───────────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┛ - key <AB01> { [ U2282 ] }; // subset of key <AB02> { [ U2283 ] }; // superset of key <AB03> { [ U2229 ] }; // intersection @@ -460,14 +457,14 @@ xkb_symbols "dyalog_box" { key <KP9> { [ U2510 ] }; // box drawing light down and left key <KPDL> { [ U2502 ] }; // box drawing light vertical -}; +}; partial hidden xkb_symbols "dyalog_codes" { // Layout of private use area for this. In the style of the Unicode book // -// APL special actions F800-F88F +// APL special actions F800-F88F // // │F800 F810 F820 F830 F840 F850 F860 F870 F880 // ├────┬────┬────┬────┬────┬────┬────┬────┬────┐ @@ -504,7 +501,7 @@ xkb_symbols "dyalog_codes" { // F│RL │FD │HK │Lc │BH │PU │ │ │OS │ // └────┴────┴────┴────┴────┴────┴────┴────┴────┘ // -// APL Function Keys F700-F7FF +// APL Function Keys F700-F7FF // // │F700 ... ... F7F0 // ├────┬────┬────┬────┬....┬────┬────┬────┬────┐ @@ -514,9 +511,9 @@ xkb_symbols "dyalog_codes" { // . // F│F15 │F31 │F47 │F63 │ │F207│F223│F239│F255│ // └────┴────┴────┴────┴....┴────┴────┴────┴────┘ -// +// // whilst these locations are defined. Dyalog's "aplkeys/xterm" file copes with -// normal function keys from the base keyboard rather than this overlay +// normal function keys from the base keyboard rather than this overlay. // ┌─────┐ ┌───┐ // │ │ │ZM │ @@ -540,7 +537,6 @@ xkb_symbols "dyalog_codes" { // ┃ ┃ ┃ ┃ TO ┃ ┃ ┃ ┃ // ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹───────────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┛ - key <BKSP> { [ Uf850, Uf855 ] }; // BP CB key <ESC> { [ Uf800 ] }; // QT key <FK11> { [ Uf821, Uf821 ] }; // ZM, ZM put this on both, the unshifted one sometimes gets lost @@ -561,7 +557,6 @@ xkb_symbols "dyalog_codes" { key <RGHT> { [ Uf824, Uf854 ] }; // NX, RM key <UP> { [ Uf820 ] }; // BK - // ┌───┬───┬───┐ // │PT │LL │UL │ // │CP │LS │US │ @@ -589,7 +584,6 @@ xkb_symbols "dyalog_codes" { // │ │ │ │ // └───────┴───┴───┘ - key <KPAD> { [ Uf859 ] }; // TL key <KPDV> { [ Uf819 ] }; // RD key <KPMU> { [ Uf81a ] }; // TG @@ -602,4 +596,3 @@ xkb_symbols "dyalog" { include "apl(dyalog_codes)" name[Group1] = "APL keyboard symbols (Dyalog)"; }; - diff --git a/xorg-server/xkeyboard-config/symbols/ara b/xorg-server/xkeyboard-config/symbols/ara index 71b50daa5..e677aaab1 100644 --- a/xorg-server/xkeyboard-config/symbols/ara +++ b/xorg-server/xkeyboard-config/symbols/ara @@ -1,17 +1,14 @@ -// based on a keyboard map from an 'xkb/symbols/ar' file - default partial alphanumeric_keys xkb_symbols "basic" { name[Group1]= "Arabic"; // NOTES: // -// there is also combined shadda diacritis in AltGr position of simple -// diacritics fatha, fathatan, damma, dammatan, kasra and kasratan -// should a third state be added to Group2 ? -// +// There is also a combined shadda diacritic in the AltGr position of the +// simple diacritics fatha, fathatan, damma, dammatan, kasra and kasratan. (??) +// Should a third state be added to Group2? - key <TLDE> { [ Arabic_thal, Arabic_shadda ] }; + key <TLDE> { [ Arabic_thal, Arabic_shadda ] }; key <AE01> { [ 1, exclam ] }; key <AE02> { [ 2, at ] }; key <AE03> { [ 3, numbersign ] }; @@ -24,42 +21,42 @@ xkb_symbols "basic" { key <AE10> { [ 0, parenleft ] }; key <AE11> { [ minus, underscore ] }; key <AE12> { [ equal, plus ] }; - + key <AD01> { [ Arabic_dad, Arabic_fatha ] }; - key <AD02> { [ Arabic_sad, Arabic_fathatan ] }; + key <AD02> { [ Arabic_sad, Arabic_fathatan ] }; key <AD03> { [ Arabic_theh, Arabic_damma ] }; - key <AD04> { [ Arabic_qaf, Arabic_dammatan ] }; - key <AD05> { [ Arabic_feh, 0x100fef9, 0x10006a4 ] }; - key <AD06> { [ Arabic_ghain, Arabic_hamzaunderalef ] }; - key <AD07> { [ Arabic_ain, grave ] }; - key <AD08> { [ Arabic_ha, division ] }; - key <AD09> { [ Arabic_khah, multiply ] }; - key <AD10> { [ Arabic_hah, Arabic_semicolon ] }; - key <AD11> { [ Arabic_jeem, less, 0x1000686 ] }; - key <AD12> { [ Arabic_dal, greater ] }; - - key <AC01> { [ Arabic_sheen, Arabic_kasra ] }; - key <AC02> { [ Arabic_seen, Arabic_kasratan ] }; - key <AC03> { [ Arabic_yeh, bracketright ] }; - key <AC04> { [ Arabic_beh, bracketleft, 0x100067e ] }; - key <AC05> { [ Arabic_lam, 0x100fef7 ] }; - key <AC06> { [ Arabic_alef, Arabic_hamzaonalef ] }; - key <AC07> { [ Arabic_teh, Arabic_tatweel ] }; - key <AC08> { [ Arabic_noon, Arabic_comma ] }; - key <AC09> { [ Arabic_meem, slash ] }; - key <AC10> { [ Arabic_kaf, colon, 0x10006af ] }; - key <AC11> { [ Arabic_tah, quotedbl ] }; - - key <LSGT> { [ bar, brokenbar ] }; - key <AB01> { [Arabic_hamzaonyeh, asciitilde, guillemotright ] }; - key <AB02> { [ Arabic_hamza, Arabic_sukun, guillemotleft ] }; + key <AD04> { [ Arabic_qaf, Arabic_dammatan ] }; + key <AD05> { [ Arabic_feh, 0x100fef9, 0x10006a4 ] }; + key <AD06> { [ Arabic_ghain, Arabic_hamzaunderalef] }; + key <AD07> { [ Arabic_ain, grave ] }; + key <AD08> { [ Arabic_ha, division ] }; + key <AD09> { [ Arabic_khah, multiply ] }; + key <AD10> { [ Arabic_hah, Arabic_semicolon ] }; + key <AD11> { [ Arabic_jeem, less, 0x1000686 ] }; + key <AD12> { [ Arabic_dal, greater ] }; + + key <AC01> { [ Arabic_sheen, Arabic_kasra ] }; + key <AC02> { [ Arabic_seen, Arabic_kasratan ] }; + key <AC03> { [ Arabic_yeh, bracketright ] }; + key <AC04> { [ Arabic_beh, bracketleft, 0x100067e ] }; + key <AC05> { [ Arabic_lam, 0x100fef7 ] }; + key <AC06> { [ Arabic_alef, Arabic_hamzaonalef ] }; + key <AC07> { [ Arabic_teh, Arabic_tatweel ] }; + key <AC08> { [ Arabic_noon, Arabic_comma ] }; + key <AC09> { [ Arabic_meem, slash ] }; + key <AC10> { [ Arabic_kaf, colon, 0x10006af ] }; + key <AC11> { [ Arabic_tah, quotedbl ] }; + + key <LSGT> { [ bar, brokenbar ] }; + key <AB01> { [Arabic_hamzaonyeh, asciitilde, guillemotright ]}; + key <AB02> { [ Arabic_hamza, Arabic_sukun, guillemotleft ]}; key <AB03> { [Arabic_hamzaonwaw, braceright ] }; - key <AB04> { [ Arabic_ra, braceleft ] }; - key <AB05> { [ 0x100fefb, 0x100fef5 ] }; + key <AB04> { [ Arabic_ra, braceleft ] }; + key <AB05> { [ 0x100fefb, 0x100fef5 ] }; key <AB06> { [Arabic_alefmaksura, Arabic_maddaonalef ] }; - key <AB07> { [Arabic_tehmarbuta, apostrophe ] }; - key <AB08> { [ Arabic_waw, comma ] }; - key <AB09> { [ Arabic_zain, period ] }; + key <AB07> { [Arabic_tehmarbuta, apostrophe ] }; + key <AB08> { [ Arabic_waw, comma ] }; + key <AB09> { [ Arabic_zain, period ] }; key <AB10> { [ Arabic_zah, Arabic_question_mark ] }; }; @@ -74,15 +71,15 @@ xkb_symbols "azerty" { include "ara(basic)" name[Group1]= "Arabic (azerty)"; - // the north african arabic keyboard differs from the middle east one - // by the numeric row; it follows French keyboard style + // The North African Arabic keyboard differs from the Middle East one + // by the numeric row; it follows French keyboard style. // - // PROBLEM: some chars are inaccessible: ! @ # $ % ^ * - // should they go elsewhere? replace " ' that are now in double ? - // also, dead_circumflex and dead_diaeresis from French keyboard + // PROBLEM: some characters are inaccessible: ! @ # $ % ^ * + // Should they go elsewhere? Replacing " ' that are now doubled? + // Also, dead_circumflex and dead_diaeresis from French keyboard // as well as ugrave are missing, which questions the utility of the - // other accentuated latin letters. Maybe this is useful only with - // a French keyboard in Group1 ? Then, shouldn't Group1 be filled ? + // other accentuated Latin letters. Maybe this is useful only with + // a French keyboard in Group1? Then, shouldn't Group1 be filled? key <AE01> { [ ampersand, 1 ] }; key <AE02> { [ eacute, 2 ] }; @@ -101,21 +98,21 @@ partial alphanumeric_keys xkb_symbols "digits_KP" { name[Group1]= "Arabic (digits_KP)"; - // use arabic script digits on KP + // Use Arabic-script digits on the keypad. - key <KP7> { [ KP_Home, 0x1000667 ] }; // - key <KP8> { [ KP_Up, 0x1000668 ] }; // - key <KP9> { [ KP_Prior, 0x1000669 ] }; // + key <KP7> { [ KP_Home, 0x1000667 ] }; + key <KP8> { [ KP_Up, 0x1000668 ] }; + key <KP9> { [ KP_Prior, 0x1000669 ] }; - key <KP4> { [ KP_Left, 0x1000664 ] }; // - key <KP5> { [ KP_Begin, 0x1000665 ] }; // - key <KP6> { [ KP_Right, 0x1000666 ] }; // + key <KP4> { [ KP_Left, 0x1000664 ] }; + key <KP5> { [ KP_Begin, 0x1000665 ] }; + key <KP6> { [ KP_Right, 0x1000666 ] }; - key <KP1> { [ KP_End, 0x1000661 ] }; // - key <KP2> { [ KP_Down, 0x1000662 ] }; // - key <KP3> { [ KP_Next, 0x1000663 ] }; // + key <KP1> { [ KP_End, 0x1000661 ] }; + key <KP2> { [ KP_Down, 0x1000662 ] }; + key <KP3> { [ KP_Next, 0x1000663 ] }; - key <KP0> { [ KP_Insert, 0x1000660 ] }; // + key <KP0> { [ KP_Insert, 0x1000660 ] }; }; partial alphanumeric_keys @@ -123,7 +120,7 @@ xkb_symbols "digits" { include "ara(basic)" name[Group1]= "Arabic (digits)"; - // use arabic script digits + // Use Arabic-script digits on the numberic row. key <AE01> { [ 0x1000661, exclam ] }; key <AE02> { [ 0x1000662, at ] }; @@ -149,7 +146,7 @@ partial alphanumeric_keys xkb_symbols "azerty_digits" { include "ara(azerty)" name[Group1]= "Arabic (azerty/digits)"; - + key <AE01> { [ ampersand, 0x1000661 ] }; key <AE02> { [ eacute, 0x1000662 ] }; key <AE03> { [ quotedbl, 0x1000663 ] }; @@ -166,9 +163,7 @@ xkb_symbols "azerty_digits" { // http://www.qamus.org/transliteration.htm // Martin Vidner -// symbol names: see /usr/X11R6/include/X11/keysymdef.h (XFree86-devel.rpm) - -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "buckwalter" { name[Group1]= "Arabic (Buckwalter)"; @@ -191,7 +186,7 @@ xkb_symbols "buckwalter" { key <AE10> { [ 0x1000660, 0x100fd3f ] }; key <AE11> { [ minus, Arabic_tatweel ] }; key <AE12> { [ equal, plus ] }; - + key <AD01> { [ Arabic_qaf, VoidSymbol ] }; key <AD02> { [ Arabic_waw, Arabic_hamzaonwaw ] }; key <AD03> { [ VoidSymbol, Arabic_ain ] }; @@ -218,9 +213,7 @@ xkb_symbols "buckwalter" { key <AC10> { [ Arabic_semicolon, VoidSymbol ] }; key <AC11> { [ Arabic_hamza, VoidSymbol ] }; - key <BKSL> { [ VoidSymbol, Arabic_maddaonalef ] }; - -// key <LSGT> { [ bar, brokenbar ] }; + key <BKSL> { [ VoidSymbol, Arabic_maddaonalef ] }; key <AB01> { [ Arabic_zain, Arabic_zah ] }; key <AB02> { [ Arabic_khah, VoidSymbol ] }; @@ -285,7 +278,7 @@ xkb_symbols "olpc" { // REH isolated form? key <AB03> { [ Arabic_hamzaonwaw, Arabic_kasra ] }; - key <AB04> { [ Arabic_ra, Arabic_kasratan ] }; + key <AB04> { [ Arabic_ra, Arabic_kasratan ] }; key <AB05> { [ Arabic_thal, asciicircum ] }; include "group(olpc)" diff --git a/xorg-server/xkeyboard-config/symbols/at b/xorg-server/xkeyboard-config/symbols/at index bd4ba988d..c78140f05 100644 --- a/xorg-server/xkeyboard-config/symbols/at +++ b/xorg-server/xkeyboard-config/symbols/at @@ -16,7 +16,7 @@ xkb_symbols "nodeadkeys" { name[Group1]="German (Austria, eliminate dead keys)"; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { include "de(mac)" diff --git a/xorg-server/xkeyboard-config/symbols/ba b/xorg-server/xkeyboard-config/symbols/ba index 9a27cbd96..0cc4988d4 100644 --- a/xorg-server/xkeyboard-config/symbols/ba +++ b/xorg-server/xkeyboard-config/symbols/ba @@ -6,7 +6,7 @@ xkb_symbols "basic" { include "rs(latin)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "us" { name[Group1]= "Bosnian (US keyboard with Bosnian letters)"; @@ -15,7 +15,7 @@ xkb_symbols "us" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "alternatequotes" { name[Group1]= "Bosnian (use guillemets for quotes)"; @@ -23,7 +23,7 @@ xkb_symbols "alternatequotes" { include "rs(latinalternatequotes)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "unicode" { name[Group1]= "Bosnian (use Bosnian digraphs)"; @@ -31,7 +31,7 @@ xkb_symbols "unicode" { include "rs(latinunicode)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "unicodeus" { name[Group1]= "Bosnian (US keyboard with Bosnian digraphs)"; diff --git a/xorg-server/xkeyboard-config/symbols/bd b/xorg-server/xkeyboard-config/symbols/bd index 6a70d51a7..0fe144e8b 100644 --- a/xorg-server/xkeyboard-config/symbols/bd +++ b/xorg-server/xkeyboard-config/symbols/bd @@ -16,7 +16,7 @@ default partial alphanumeric_keys xkb_symbols "basic" { - name[Group1]= "Bengali"; + name[Group1]= "Bangla"; key <ESC> { [ Escape ] }; // numbers @@ -92,5 +92,5 @@ xkb_symbols "basic" { xkb_symbols "probhat" { include "in(ben_probhat)" - name[Group1]= "Bengali (Probhat)"; + name[Group1]= "Bangla (Probhat)"; }; diff --git a/xorg-server/xkeyboard-config/symbols/bg b/xorg-server/xkeyboard-config/symbols/bg index 994380c80..f44b5c60d 100644 --- a/xorg-server/xkeyboard-config/symbols/bg +++ b/xorg-server/xkeyboard-config/symbols/bg @@ -5,12 +5,12 @@ // both in source and binary form provided that the above copyright // notice and these terms are retained. The name of the author may not // be used to endorse or promote products derived from this software -// without prior permission. THIS SOFTWARE IS PROVIDES "AS IS" AND +// without prior permission. THIS SOFTWARE IS PROVIDED "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED. IN NO EVENT // SHALL THE AUTHOR BE LIABLE FOR ANY DAMAGES ARISING IN ANY WAY OUT // OF THE USE OF THIS SOFTWARE. // -////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// // Version 2.0 // The following variants are defined in this file: @@ -18,14 +18,14 @@ // "bds" - the BDS keyboard layout compliant with the proposed // Bulgarian state standard BDS 5237:2006 -// "phonetic" - Bulgarian phonetic layout with traditional position of -// the letters. +// "phonetic" - the phonetic Bulgarian layout with the traditional position +// of the letters // "bas_phonetic" - the phonetic keyboard layout compliant with the // proposed Bulgarian state standard BDS 5237:2006 -// "latin" - an extended variant of the QWERTY layout with symbols -// Bulgarian users will type while the keyboard is in Latin mode. +// "latin" - an extended variant of the QWERTY layout with symbols that +// Bulgarian users will type while the keyboard is in Latin mode // The reasons behind the layout of the symbols in levels 3 and 4 are // explained in http://arxiv.org/abs/0905.0484 (in Bulgarian). @@ -39,7 +39,7 @@ // 2. The layouts should not include level3(ralt_switch). -////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// // Describes Bulgarian keyboard "BDS" modified according to the // the new state standard BDS 5237:2006 and extended with symbols in @@ -48,314 +48,204 @@ default partial alphanumeric_keys xkb_symbols "bds" { name[Group1]= "Bulgarian"; - - key <TLDE> { [ parenleft, parenright, - bracketleft, bracketright ] }; - key <AE01> { [ 1, exclam ] }; - key <AE02> { [ 2, question ] }; - key <AE03> { [ 3, plus, - dagger, dagger ] }; - key <AE04> { [ 4, quotedbl ] }; - key <AE05> { [ 5, percent, - U2329, U232A ] }; - key <AE06> { [ 6, equal, - emdash, emdash ] }; - key <AE07> { [ 7, colon, - ellipsis, ellipsis ] }; - key <AE08> { [ 8, slash, - U0300, U0301 ] }; - key <AE09> { [ 9, endash ] }; - key <AE10> { [ 0, numerosign ] }; - key <AE11> { [ minus, dollar, - U2011, EuroSign ] }; - key <AE12> { [ period, EuroSign ] }; - - - key <AD01> { [ comma, Cyrillic_yeru, - rightsinglequotemark, leftsinglequotemark ] }; - key <AD02> { [ Cyrillic_u, Cyrillic_U ] }; - key <AD03> { [ Cyrillic_ie, Cyrillic_IE, - Cyrillic_e, Cyrillic_E ] }; - key <AD04> { [ Cyrillic_i, Cyrillic_I, - U045D, U040D ] }; - key <AD05> { [ Cyrillic_sha, Cyrillic_SHA ] }; - key <AD06> { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key <AD07> { [ Cyrillic_ka, Cyrillic_KA, - copyright, copyright ] }; - key <AD08> { [ Cyrillic_es, Cyrillic_ES, - copyright, copyright ] }; - key <AD09> { [ Cyrillic_de, Cyrillic_DE ] }; - key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; - key <AD11> { [ Cyrillic_tse, Cyrillic_TSE ] }; - key <AD12> { [ semicolon, section ] }; - - - key <AC01> { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key <AC02> { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key <AC03> { [ Cyrillic_a, Cyrillic_A ] }; - key <AC04> { [ Cyrillic_o, Cyrillic_O ] }; - key <AC05> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key <AC06> { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key <AC07> { [ Cyrillic_te, Cyrillic_TE, - trademark, trademark ] }; - key <AC08> { [ Cyrillic_en, Cyrillic_EN ] }; - key <AC09> { [ Cyrillic_ve, Cyrillic_VE ] }; - key <AC10> { [ Cyrillic_em, Cyrillic_EM ] }; - key <AC11> { [ Cyrillic_che, Cyrillic_CHE ] }; - key <BKSL> { [ doublelowquotemark, leftdoublequotemark, - guillemotleft, guillemotright ] }; - - - key <LSGT> { [ U045D, U040D ] }; - key <AB01> { [ Cyrillic_yu, Cyrillic_YU ] }; - key <AB02> { [ Cyrillic_shorti, Cyrillic_SHORTI, - U046D, U046C ] }; - key <AB03> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, - U046B, U046A ] }; - key <AB04> { [ Cyrillic_e, Cyrillic_E ] }; - key <AB05> { [ Cyrillic_ef, Cyrillic_EF ] }; - key <AB06> { [ Cyrillic_ha, Cyrillic_HA ] }; - key <AB07> { [ Cyrillic_pe, Cyrillic_PE ] }; - key <AB08> { [ Cyrillic_er, Cyrillic_ER, - registered, registered ] }; - key <AB09> { [ Cyrillic_el, Cyrillic_EL ] }; - key <AB10> { [ Cyrillic_be, Cyrillic_BE ] }; - - - key <SPCE> { [ space, space, - nobreakspace, nobreakspace ] }; - - - key <KPDL> { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Separator ] }; + + key <TLDE> {[ parenleft, parenright, bracketleft, bracketright ]}; + key <AE01> {[ 1, exclam ]}; + key <AE02> {[ 2, question ]}; + key <AE03> {[ 3, plus, dagger, dagger ]}; + key <AE04> {[ 4, quotedbl ]}; + key <AE05> {[ 5, percent, U2329, U232A ]}; + key <AE06> {[ 6, equal, emdash, emdash ]}; + key <AE07> {[ 7, colon, ellipsis, ellipsis ]}; + key <AE08> {[ 8, slash, U0300, U0301 ]}; + key <AE09> {[ 9, endash ]}; + key <AE10> {[ 0, numerosign ]}; + key <AE11> {[ minus, dollar, U2011, EuroSign ]}; + key <AE12> {[ period, EuroSign ]}; + + key <AD01> {[ comma, Cyrillic_yeru, rightsinglequotemark, leftsinglequotemark ]}; + key <AD02> {[ Cyrillic_u, Cyrillic_U ]}; + key <AD03> {[ Cyrillic_ie, Cyrillic_IE, Cyrillic_e, Cyrillic_E ]}; + key <AD04> {[ Cyrillic_i, Cyrillic_I, U045D, U040D ]}; + key <AD05> {[ Cyrillic_sha, Cyrillic_SHA ]}; + key <AD06> {[ Cyrillic_shcha, Cyrillic_SHCHA ]}; + key <AD07> {[ Cyrillic_ka, Cyrillic_KA, copyright, copyright ]}; + key <AD08> {[ Cyrillic_es, Cyrillic_ES, copyright, copyright ]}; + key <AD09> {[ Cyrillic_de, Cyrillic_DE ]}; + key <AD10> {[ Cyrillic_ze, Cyrillic_ZE ]}; + key <AD11> {[ Cyrillic_tse, Cyrillic_TSE ]}; + key <AD12> {[ semicolon, section ]}; + + key <AC01> {[ Cyrillic_softsign, U045D, Cyrillic_yeru, Cyrillic_YERU ]}; + key <AC02> {[ Cyrillic_ya, Cyrillic_YA, U0463, U0462 ]}; + key <AC03> {[ Cyrillic_a, Cyrillic_A ]}; + key <AC04> {[ Cyrillic_o, Cyrillic_O ]}; + key <AC05> {[ Cyrillic_zhe, Cyrillic_ZHE ]}; + key <AC06> {[ Cyrillic_ghe, Cyrillic_GHE ]}; + key <AC07> {[ Cyrillic_te, Cyrillic_TE, trademark, trademark ]}; + key <AC08> {[ Cyrillic_en, Cyrillic_EN ]}; + key <AC09> {[ Cyrillic_ve, Cyrillic_VE ]}; + key <AC10> {[ Cyrillic_em, Cyrillic_EM ]}; + key <AC11> {[ Cyrillic_che, Cyrillic_CHE ]}; + key <BKSL> {[ doublelowquotemark, leftdoublequotemark, guillemotleft, guillemotright ]}; + + key <LSGT> {[ U045D, U040D ]}; + key <AB01> {[ Cyrillic_yu, Cyrillic_YU ]}; + key <AB02> {[ Cyrillic_shorti, Cyrillic_SHORTI, U046D, U046C ]}; + key <AB03> {[ Cyrillic_hardsign, Cyrillic_HARDSIGN, U046B, U046A ]}; + key <AB04> {[ Cyrillic_e, Cyrillic_E ]}; + key <AB05> {[ Cyrillic_ef, Cyrillic_EF ]}; + key <AB06> {[ Cyrillic_ha, Cyrillic_HA ]}; + key <AB07> {[ Cyrillic_pe, Cyrillic_PE ]}; + key <AB08> {[ Cyrillic_er, Cyrillic_ER, registered, registered ]}; + key <AB09> {[ Cyrillic_el, Cyrillic_EL ]}; + key <AB10> {[ Cyrillic_be, Cyrillic_BE ]}; + + key <SPCE> {[ space, space, nobreakspace, nobreakspace ]}; + + key <KPDL> { type[Group1] = "KEYPAD", [ KP_Delete, KP_Separator ]}; }; -// This is improved variant of the traditional Bulgarian phonetic +// This is an improved variant of the traditional Bulgarian phonetic // keyboard. Some unnecessary symbols in levels 1 and 2 are replaced -// by more useful (the same way as in "bas_phonetic") and additional -// symbols in levels 3 and 4 are added. -partial alphanumeric_keys +// by more useful ones (similar as in "bas_phonetic") and additional +// symbols are added in levels 3 and 4. +partial alphanumeric_keys xkb_symbols "phonetic" { name[Group1]= "Bulgarian (traditional phonetic)"; - - key <TLDE> { [ Cyrillic_che, Cyrillic_CHE ] }; - key <AE01> { [ 1, exclam ] }; - key <AE02> { [ 2, at ] }; - key <AE03> { [ 3, numerosign ] }; - key <AE04> { [ 4, dollar, - EuroSign, EuroSign ] }; - key <AE05> { [ 5, percent ] }; - key <AE06> { [ 6, EuroSign ] }; - key <AE07> { [ 7, section ] }; - key <AE08> { [ 8, asterisk ] }; - key <AE09> { [ 9, parenleft, - bracketleft, U2329 ] }; - key <AE10> { [ 0, parenright, - bracketright, U232A ] }; - key <AE11> { [ minus, endash, - U2011, U2011 ] }; - key <AE12> { [ equal, plus, - emdash, dagger ] }; - - key <AD01> { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key <AD02> { [ Cyrillic_ve, Cyrillic_VE ] }; - key <AD03> { [ Cyrillic_ie, Cyrillic_IE, - Cyrillic_e, Cyrillic_E ] }; - key <AD04> { [ Cyrillic_er, Cyrillic_ER, - registered, registered ] }; - key <AD05> { [ Cyrillic_te, Cyrillic_TE, - trademark, trademark ] }; - key <AD06> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, - U046B, U046A ] }; - key <AD07> { [ Cyrillic_u, Cyrillic_U ] }; - key <AD08> { [ Cyrillic_i, Cyrillic_I, - U045D, U040D ] }; - key <AD09> { [ Cyrillic_o, Cyrillic_O ] }; - key <AD10> { [ Cyrillic_pe, Cyrillic_PE ] }; - key <AD11> { [ Cyrillic_sha, Cyrillic_SHA ] }; - key <AD12> { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - - - key <AC01> { [ Cyrillic_a, Cyrillic_A ] }; - key <AC02> { [ Cyrillic_es, Cyrillic_ES, - copyright, copyright ] }; - key <AC03> { [ Cyrillic_de, Cyrillic_DE ] }; - key <AC04> { [ Cyrillic_ef, Cyrillic_EF ] }; - key <AC05> { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key <AC06> { [ Cyrillic_ha, Cyrillic_HA ] }; - key <AC07> { [ Cyrillic_shorti, Cyrillic_SHORTI, - U046D, U046C ] }; - key <AC08> { [ Cyrillic_ka, Cyrillic_KA ] }; - key <AC09> { [ Cyrillic_el, Cyrillic_EL ] }; - key <AC10> { [ semicolon, colon, - ellipsis, ellipsis ] }; - key <AC11> { [ apostrophe, quotedbl, - rightsinglequotemark, leftsinglequotemark ] }; - key <BKSL> { [ Cyrillic_yu, Cyrillic_YU ] }; - - - key <LSGT> { [ U045D, U040D ] }; - key <AB01> { [ Cyrillic_ze, Cyrillic_ZE ] }; - key <AB02> { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key <AB03> { [ Cyrillic_tse, Cyrillic_TSE, - copyright, copyright ] }; - key <AB04> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key <AB05> { [ Cyrillic_be, Cyrillic_BE ] }; - key <AB06> { [ Cyrillic_en, Cyrillic_EN ] }; - key <AB07> { [ Cyrillic_em, Cyrillic_EM ] }; - key <AB08> { [ comma, doublelowquotemark, - guillemotleft, guillemotleft ] }; - key <AB09> { [ period, leftdoublequotemark, - guillemotright, guillemotright ] }; - key <AB10> { [ slash, question, - U0300, U0301 ] }; - - - key <SPCE> { [ space, space, - nobreakspace, nobreakspace ] }; - - - key <KPDL> { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Separator ] }; + key <TLDE> {[ Cyrillic_che, Cyrillic_CHE ]}; + key <AE01> {[ 1, exclam ]}; + key <AE02> {[ 2, at ]}; + key <AE03> {[ 3, numerosign ]}; + key <AE04> {[ 4, dollar, EuroSign, EuroSign ]}; + key <AE05> {[ 5, percent ]}; + key <AE06> {[ 6, EuroSign ]}; + key <AE07> {[ 7, section ]}; + key <AE08> {[ 8, asterisk ]}; + key <AE09> {[ 9, parenleft, bracketleft, U2329 ]}; + key <AE10> {[ 0, parenright, bracketright, U232A ]}; + key <AE11> {[ minus, endash, U2011, U2011 ]}; + key <AE12> {[ equal, plus, emdash, dagger ]}; + + key <AD01> {[ Cyrillic_ya, Cyrillic_YA, U0463, U0462 ]}; + key <AD02> {[ Cyrillic_ve, Cyrillic_VE ]}; + key <AD03> {[ Cyrillic_ie, Cyrillic_IE, Cyrillic_e, Cyrillic_E ]}; + key <AD04> {[ Cyrillic_er, Cyrillic_ER, registered, registered ]}; + key <AD05> {[ Cyrillic_te, Cyrillic_TE, trademark, trademark ]}; + key <AD06> {[ Cyrillic_hardsign, Cyrillic_HARDSIGN, U046B, U046A ]}; + key <AD07> {[ Cyrillic_u, Cyrillic_U ]}; + key <AD08> {[ Cyrillic_i, Cyrillic_I, U045D, U040D ]}; + key <AD09> {[ Cyrillic_o, Cyrillic_O ]}; + key <AD10> {[ Cyrillic_pe, Cyrillic_PE ]}; + key <AD11> {[ Cyrillic_sha, Cyrillic_SHA ]}; + key <AD12> {[ Cyrillic_shcha, Cyrillic_SHCHA ]}; + + key <AC01> {[ Cyrillic_a, Cyrillic_A ]}; + key <AC02> {[ Cyrillic_es, Cyrillic_ES, copyright, copyright ]}; + key <AC03> {[ Cyrillic_de, Cyrillic_DE ]}; + key <AC04> {[ Cyrillic_ef, Cyrillic_EF ]}; + key <AC05> {[ Cyrillic_ghe, Cyrillic_GHE ]}; + key <AC06> {[ Cyrillic_ha, Cyrillic_HA ]}; + key <AC07> {[ Cyrillic_shorti, Cyrillic_SHORTI, U046D, U046C ]}; + key <AC08> {[ Cyrillic_ka, Cyrillic_KA ]}; + key <AC09> {[ Cyrillic_el, Cyrillic_EL ]}; + key <AC10> {[ semicolon, colon, ellipsis, ellipsis ]}; + key <AC11> {[ apostrophe, quotedbl, rightsinglequotemark, leftsinglequotemark ]}; + key <BKSL> {[ Cyrillic_yu, Cyrillic_YU ]}; + + key <LSGT> {[ U045D, U040D ]}; + key <AB01> {[ Cyrillic_ze, Cyrillic_ZE ]}; + key <AB02> {[ Cyrillic_softsign, U045D, Cyrillic_yeru, Cyrillic_YERU ]}; + key <AB03> {[ Cyrillic_tse, Cyrillic_TSE, copyright, copyright ]}; + key <AB04> {[ Cyrillic_zhe, Cyrillic_ZHE ]}; + key <AB05> {[ Cyrillic_be, Cyrillic_BE ]}; + key <AB06> {[ Cyrillic_en, Cyrillic_EN ]}; + key <AB07> {[ Cyrillic_em, Cyrillic_EM ]}; + key <AB08> {[ comma, doublelowquotemark, guillemotleft, guillemotleft ]}; + key <AB09> {[ period, leftdoublequotemark, guillemotright, guillemotright ]}; + key <AB10> {[ slash, question, U0300, U0301 ]}; + + key <SPCE> {[ space, space, nobreakspace, nobreakspace ]}; + + key <KPDL> { type[Group1] = "KEYPAD", [ KP_Delete, KP_Separator ]}; }; -// This is the Bulgarian phonetic keyboard acording to the proposed -// state standard BDS 5237:2006 with additional symbols in -// levels 3 and 4. -partial alphanumeric_keys +// This is the Bulgarian phonetic keyboard according to the proposed +// state standard BDS 5237:2006 with additional symbols in levels 3 and 4. +partial alphanumeric_keys xkb_symbols "bas_phonetic" { include "bg(phonetic)" name[Group1]= "Bulgarian (new phonetic)"; - - key <TLDE> { [ Cyrillic_yu, Cyrillic_YU ] }; - key <AD01> { [ Cyrillic_che, Cyrillic_CHE ] }; - key <AD02> { [ Cyrillic_sha, Cyrillic_SHA ] }; - key <AD11> { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key <BKSL> { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key <AB02> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key <AB04> { [ Cyrillic_ve, Cyrillic_VE ] }; + + key <TLDE> {[ Cyrillic_yu, Cyrillic_YU ]}; + key <AD01> {[ Cyrillic_che, Cyrillic_CHE ]}; + key <AD02> {[ Cyrillic_sha, Cyrillic_SHA ]}; + key <AD11> {[ Cyrillic_ya, Cyrillic_YA, U0463, U0462 ]}; + key <BKSL> {[ Cyrillic_softsign, U045D, Cyrillic_yeru, Cyrillic_YERU ]}; + key <AB02> {[ Cyrillic_zhe, Cyrillic_ZHE ]}; + key <AB04> {[ Cyrillic_ve, Cyrillic_VE ]}; }; -// This is extended variant of the standard Latin QWERTY layout with +// This is an extended variant of the standard Latin QWERTY layout with // additional symbols in levels 3 and 4. -partial hidden alphanumeric_keys +partial hidden alphanumeric_keys xkb_symbols "latin" { - - key <TLDE> { [ grave, asciitilde, - U2248, U2245 ] }; - key <AE01> { [ 1, exclam, - notsign, notsign ] }; - key <AE02> { [ 2, at, - twosuperior, enfilledcircbullet ] }; - key <AE03> { [ 3, numbersign, - threesuperior, notequal ] }; - key <AE04> { [ 4, dollar, - EuroSign, sterling ] }; - key <AE05> { [ 5, percent, - U2030, U2030 ] }; - key <AE06> { [ 6, asciicircum, - logicaland, logicalor ] }; - key <AE07> { [ 7, ampersand, - section, section ] }; - key <AE08> { [ 8, asterisk, - infinity, multiply ] }; - key <AE09> { [ 9, parenleft, - U2202, nabla ] }; - key <AE10> { [ 0, parenright, - U2300, U2300 ] }; - key <AE11> { [ minus, underscore, - U2011, endash ] }; - key <AE12> { [ equal, plus, - emdash, plusminus ] }; - - - key <AD01> { [ q, Q, - Greek_THETA, Greek_theta ] }; - key <AD02> { [ w, W, - Greek_OMEGA, Greek_omega ] }; - key <AD03> { [ e, E, - U2203, Greek_epsilon ] }; - key <AD04> { [ r, R, - registered, Greek_rho ] }; - key <AD05> { [ t, T, - trademark, Greek_tau ] }; - key <AD06> { [ y, Y, - yen, Greek_upsilon ] }; - key <AD07> { [ u, U, - intersection, union ] }; - key <AD08> { [ i, I, - integral, Greek_iota ] }; - key <AD09> { [ o, O, - degree, U222E ] }; - key <AD10> { [ p, P, - Greek_PI, Greek_pi ] }; - key <AD11> { [ bracketleft, braceleft, - U2286, includedin ] }; - key <AD12> { [ bracketright, braceright, - U2208, U2209 ] }; - - - key <AC01> { [ a, A, - U2200, Greek_alpha ] }; - key <AC02> { [ s, S, - Greek_SIGMA, Greek_sigma ] }; - key <AC03> { [ d, D, - Greek_DELTA, Greek_delta ] }; - key <AC04> { [ f, F, - Greek_PHI, Greek_phi ] }; - key <AC05> { [ g, G, - Greek_GAMMA, Greek_gamma ] }; - key <AC06> { [ h, H, - U2225, Greek_eta ] }; - key <AC07> { [ j, J ] }; - key <AC08> { [ k, K, - U03F0, Greek_kappa ] }; - key <AC09> { [ l, L, - Greek_LAMBDA, Greek_lambda ] }; - key <AC10> { [ semicolon, colon, - division, division ] }; - key <AC11> { [ apostrophe, quotedbl, - leftdoublequotemark, rightdoublequotemark ] }; - key <BKSL> { [ backslash, bar, - identical, downtack ] }; - - - key <LSGT> { [ less, greater, - U2266, U2267 ] }; - key <AB01> { [ z, Z, - U2220, Greek_zeta ] }; - key <AB02> { [ x, X, - Greek_XI, Greek_xi ] }; - key <AB03> { [ c, C, - copyright, Greek_chi ] }; - key <AB04> { [ v, V, - Greek_PSI, Greek_psi ] }; - key <AB05> { [ b, B, - U03D1, Greek_beta ] }; - key <AB06> { [ n, N, - U207F, Greek_nu ] }; - key <AB07> { [ m, M, - Greek_mu, Greek_mu ] }; - key <AB08> { [ comma, less, - U2266, U21D4 ] }; - key <AB09> { [ period, greater, - U2267, U21D2 ] }; - key <AB10> { [ slash, question, - leftsinglequotemark, rightsinglequotemark ] }; - - - key <SPCE> { [ space, space, - nobreakspace, nobreakspace ] }; - - - key <KPDL> { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Decimal ] }; + + key <TLDE> {[ grave, asciitilde, U2248, U2245 ]}; + key <AE01> {[ 1, exclam, notsign, notsign ]}; + key <AE02> {[ 2, at, twosuperior, enfilledcircbullet ]}; + key <AE03> {[ 3, numbersign, threesuperior, notequal ]}; + key <AE04> {[ 4, dollar, EuroSign, sterling ]}; + key <AE05> {[ 5, percent, U2030, U2030 ]}; + key <AE06> {[ 6, asciicircum, logicaland, logicalor ]}; + key <AE07> {[ 7, ampersand, section, section ]}; + key <AE08> {[ 8, asterisk, infinity, multiply ]}; + key <AE09> {[ 9, parenleft, U2202, nabla ]}; + key <AE10> {[ 0, parenright, U2300, U2300 ]}; + key <AE11> {[ minus, underscore, U2011, endash ]}; + key <AE12> {[ equal, plus, emdash, plusminus ]}; + + key <AD01> {[ q, Q, Greek_THETA, Greek_theta ]}; + key <AD02> {[ w, W, Greek_OMEGA, Greek_omega ]}; + key <AD03> {[ e, E, U2203, Greek_epsilon ]}; + key <AD04> {[ r, R, registered, Greek_rho ]}; + key <AD05> {[ t, T, trademark, Greek_tau ]}; + key <AD06> {[ y, Y, yen, Greek_upsilon ]}; + key <AD07> {[ u, U, intersection, union ]}; + key <AD08> {[ i, I, integral, Greek_iota ]}; + key <AD09> {[ o, O, degree, U222E ]}; + key <AD10> {[ p, P, Greek_PI, Greek_pi ]}; + key <AD11> {[ bracketleft, braceleft, U2286, includedin ]}; + key <AD12> {[ bracketright, braceright, U2208, U2209 ]}; + + key <AC01> {[ a, A, U2200, Greek_alpha ]}; + key <AC02> {[ s, S, Greek_SIGMA, Greek_sigma ]}; + key <AC03> {[ d, D, Greek_DELTA, Greek_delta ]}; + key <AC04> {[ f, F, Greek_PHI, Greek_phi ]}; + key <AC05> {[ g, G, Greek_GAMMA, Greek_gamma ]}; + key <AC06> {[ h, H, U2225, Greek_eta ]}; + key <AC07> {[ j, J ]}; + key <AC08> {[ k, K, U03F0, Greek_kappa ]}; + key <AC09> {[ l, L, Greek_LAMBDA, Greek_lambda ]}; + key <AC10> {[ semicolon, colon, division, division ]}; + key <AC11> {[ apostrophe, quotedbl, leftdoublequotemark, rightdoublequotemark]}; + key <BKSL> {[ backslash, bar, identical, downtack ]}; + + key <LSGT> {[ less, greater, U2266, U2267 ]}; + key <AB01> {[ z, Z, U2220, Greek_zeta ]}; + key <AB02> {[ x, X, Greek_XI, Greek_xi ]}; + key <AB03> {[ c, C, copyright, Greek_chi ]}; + key <AB04> {[ v, V, Greek_PSI, Greek_psi ]}; + key <AB05> {[ b, B, U03D1, Greek_beta ]}; + key <AB06> {[ n, N, U207F, Greek_nu ]}; + key <AB07> {[ m, M, Greek_mu, Greek_mu ]}; + key <AB08> {[ comma, less, U2266, U21D4 ]}; + key <AB09> {[ period, greater, U2267, U21D2 ]}; + key <AB10> {[ slash, question, leftsinglequotemark, rightsinglequotemark]}; + + key <SPCE> {[ space, space, nobreakspace, nobreakspace ]}; + + key <KPDL> { type[Group1] = "KEYPAD", [ KP_Delete, KP_Decimal ]}; }; diff --git a/xorg-server/xkeyboard-config/symbols/bt b/xorg-server/xkeyboard-config/symbols/bt index c02505e98..e53942107 100644 --- a/xorg-server/xkeyboard-config/symbols/bt +++ b/xorg-server/xkeyboard-config/symbols/bt @@ -18,7 +18,7 @@ xkb_symbols "basic" { name[Group1]= "Dzongkha"; key <TLDE> { [ 0x1000F09, 0x1000F0A, 0x1000F6C, 0x1000F6D ] }; - + // numbers e.a. key <AE01> { [ 0x1000F21, 0x1000F04, 1, exclam ] }; key <AE02> { [ 0x1000F22, 0x1000F05, 2, at ] }; @@ -63,7 +63,7 @@ xkb_symbols "basic" { key <AC09> { [ 0x1000F59, 0x1000FA9, 0x1000F39, VoidSymbol ] }; key <AC10> { [ 0x1000F5A, 0x1000FAA, colon, semicolon ] }; key <AC11> { [ 0x1000F5B, 0x1000FAB, apostrophe, quotedbl ] }; - + // TODO: BKSL and LSGT are from gb layout, are there any variants? key <BKSL> { [ 0x1000F5D, 0x1000FAD, backslash, 0x1000FBA ] }; key <LSGT> { [ 0x1000F0D, 0x1000F11, 0x1000F10, 0x1000F0F ] }; diff --git a/xorg-server/xkeyboard-config/symbols/bw b/xorg-server/xkeyboard-config/symbols/bw index 48de2e2df..ab14cc7d8 100644 --- a/xorg-server/xkeyboard-config/symbols/bw +++ b/xorg-server/xkeyboard-config/symbols/bw @@ -4,7 +4,7 @@ xkb_symbols "tswana" { include "us" name[Group1]= "Tswana"; - + key <AC10> { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW key <AC11> { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS key <TLDE> { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE diff --git a/xorg-server/xkeyboard-config/symbols/by b/xorg-server/xkeyboard-config/symbols/by index 00ecd6a8d..d82bcf57e 100644 --- a/xorg-server/xkeyboard-config/symbols/by +++ b/xorg-server/xkeyboard-config/symbols/by @@ -19,7 +19,7 @@ partial alphanumeric_keys xkb_symbols "legacy" { include "by(basic)" name[Group1]= "Belarusian (legacy)"; - + key <AE03> { [ 3, numbersign ] }; key <AE04> { [ 4, asterisk ] }; key <AE05> { [ 5, colon ] }; @@ -36,7 +36,7 @@ partial alphanumeric_keys xkb_symbols "latin" { include "latin" name[Group1]= "Belarusian (Latin)"; - + key <AD02> { [ w, W, scaron, Scaron ] }; key <AD07> { [ u, U, ubreve, Ubreve ] }; key <AC02> { [ s, S, sacute, Sacute ] }; @@ -46,6 +46,6 @@ xkb_symbols "latin" { key <AB03> { [ c, C, cacute, Cacute ] }; key <AB04> { [ v, V, ccaron, Ccaron ] }; key <AB06> { [ n, N, nacute, Nacute ] }; - + include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/ca b/xorg-server/xkeyboard-config/symbols/ca index c4d37ad5c..abfbbd9f7 100644 --- a/xorg-server/xkeyboard-config/symbols/ca +++ b/xorg-server/xkeyboard-config/symbols/ca @@ -266,7 +266,7 @@ xkb_symbols "multi-2gr" { // Inuktitut keyboard for X11 // written by Pablo Saratxaga <pablo@mandrakesoft.com> -alphanumeric_keys +alphanumeric_keys xkb_symbols "ike" { name[Group1]= "Inuktitut"; @@ -453,18 +453,18 @@ xkb_symbols "multix" { xkb_symbols "olpc" { include "ca(fr)" - + key <AE02> { [ 2, quotedbl, ograve, Ograve ] }; key <AE03> { [ 3, slash, at, VoidSymbol ] }; - + key <AD03> { [ e, E, EuroSign, VoidSymbol] }; - + key <AB09> { [ period, period, 0x1002010 ] }; - + key <I219> { [ guillemotleft, guillemotright, degree, VoidSymbol ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "eng" { name[Group1] = "English (Canada)"; include "us(basic)" @@ -472,7 +472,7 @@ xkb_symbols "eng" { // EXTRAS: -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "kut" { // Ejective U0313 and acute accents are taken from shs layout. @@ -501,7 +501,7 @@ xkb_symbols "kut" { // Secwepemctsin keyboard for X11 // written by Neskie Manuel <neskiem@gmail.com> -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "shs" { include "us" diff --git a/xorg-server/xkeyboard-config/symbols/capslock b/xorg-server/xkeyboard-config/symbols/capslock index 337c5efd2..928d79a3e 100644 --- a/xorg-server/xkeyboard-config/symbols/capslock +++ b/xorg-server/xkeyboard-config/symbols/capslock @@ -68,7 +68,7 @@ xkb_symbols "ctrl_modifier" { replace key <CAPS> { type[Group1] = "ONE_LEVEL", symbols[Group1] = [ Caps_Lock ], - actions[Group1] = [ SetMods(modifiers=Control) ] + actions[Group1] = [ SetMods(modifiers=Control) ] }; modifier_map Control { <CAPS> }; }; diff --git a/xorg-server/xkeyboard-config/symbols/ch b/xorg-server/xkeyboard-config/symbols/ch index 54663f1fa..62c69f958 100644 --- a/xorg-server/xkeyboard-config/symbols/ch +++ b/xorg-server/xkeyboard-config/symbols/ch @@ -36,7 +36,7 @@ xkb_symbols "basic" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "legacy" { include "ch(basic)" @@ -44,12 +44,12 @@ xkb_symbols "legacy" { key <AE07> { [ 7, slash, brokenbar ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "de" { include "ch(basic)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "de_Sundeadkeys" { // modify the basic Swiss German layout to use Sun dead keys include "ch(basic)" @@ -58,13 +58,13 @@ xkb_symbols "de_Sundeadkeys" { key <AD12> { [ dead_diaeresis, exclam, bracketright ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "de_sundeadkeys" { include "ch(de_Sundeadkeys)" name[Group1]= "German (Switzerland, Sun dead keys)"; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "de_nodeadkeys" { // modify the basic Swiss German layout not to have any dead keys include "ch(basic)" @@ -74,7 +74,7 @@ xkb_symbols "de_nodeadkeys" { key <AD12> { [ diaeresis, exclam, bracketright ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "fr" { include "ch(basic)" @@ -123,7 +123,7 @@ xkb_symbols "fr_nodeadkeys" { partial alphanumeric_keys xkb_symbols "de_mac" { - + name[Group1]= "German (Switzerland, Macintosh)"; key <AE01> { [ 1, plus, plusminus, infinity ] }; @@ -143,7 +143,7 @@ xkb_symbols "de_mac" { key <AD02> { [ w, W, Greek_SIGMA, Aacute ] }; key <AD03> { [ e, E, EuroSign, Ediaeresis ] }; key <AD04> { [ r, R, registered, Egrave ] }; - key <AD05> { [ t, T, dagger, Icircumflex ] }; + key <AD05> { [ t, T, dagger, Icircumflex ] }; key <AD06> { [ z, Z, Greek_OMEGA, Iacute ] }; key <AD07> { [ u, U, degree, Ugrave ] }; key <AD08> { [ i, I, exclamdown, idotless ] }; @@ -152,7 +152,7 @@ xkb_symbols "de_mac" { key <AD11> { [ udiaeresis, egrave, section, ydiaeresis ] }; key <AD12> { [ dead_diaeresis, exclam, grave, apostrophe ] }; key <AC01> { [ a, A, aring, Aring ] }; - key <AC02> { [ s, S, ssharp, NoSymbol ] }; + key <AC02> { [ s, S, ssharp, NoSymbol ] }; // ligature fl key <AC03> { [ d, D, Greek_sigma, NoSymbol ] }; // partialderivative is not available here att @@ -168,7 +168,7 @@ xkb_symbols "de_mac" { key <AB02> { [ x, X, similarequal, trademark ] }; key <AB03> { [ c, C, copyright, NoSymbol ] }; key <AB04> { [ v, V, radical, diamond ] }; - key <AB05> { [ b, B, integral, NoSymbol ] }; + key <AB05> { [ b, B, integral, NoSymbol ] }; key <AB06> { [ n, N, dead_tilde, enopencircbullet ] }; // to be fixed att key <AB07> { [ m, M, mu, dead_abovering ] }; @@ -186,7 +186,7 @@ xkb_symbols "de_mac" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "fr_mac" { include "ch(de_mac)" diff --git a/xorg-server/xkeyboard-config/symbols/cn b/xorg-server/xkeyboard-config/symbols/cn index 8c2ffe422..6b6562dbc 100644 --- a/xorg-server/xkeyboard-config/symbols/cn +++ b/xorg-server/xkeyboard-config/symbols/cn @@ -58,7 +58,7 @@ xkb_symbols "basic" { // you and maybe they'll find a fix. You won't notice it unless you're // fast at typing Tibetan anyway. -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tib" { name[Group1]= "Tibetan"; @@ -113,7 +113,7 @@ xkb_symbols "tib" { key <AB08> { [ 0x1000f50, 0x1000f4b, 0x1000fa0, 0x1000f9b ] }; # ཐ ཋ ྠ ྛ key <AB09> { [ 0x1000f47, 0x1000f3a, 0x1000f97, 0x1000f8b ] }; # ཇ ༺ ྗ ྋ key <AB10> { [ 0x1000f49, 0x1000f3b, 0x1000f99, 0x1000f8a ] }; # ཉ ༻ ྙ ྊ - + }; // Tibetan Standard Keyboard with ASCII numerals @@ -131,7 +131,7 @@ xkb_symbols "tib" { // email addresses are not possible.) This mapping may change in the future // if a clearly better use for the shifted numerals is pointed out by users. -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tib_asciinum" { include "cn(tib)" diff --git a/xorg-server/xkeyboard-config/symbols/ctrl b/xorg-server/xkeyboard-config/symbols/ctrl index ca019ec7d..785777cfe 100644 --- a/xorg-server/xkeyboard-config/symbols/ctrl +++ b/xorg-server/xkeyboard-config/symbols/ctrl @@ -1,57 +1,80 @@ // Eliminate CapsLock, making it another Ctrl. -partial modifier_keys +partial modifier_keys xkb_symbols "nocaps" { - replace key <CAPS> { [ Control_L, Control_L ] }; + replace key <CAPS> { [ Control_L, Control_L ] }; modifier_map Control { <CAPS>, <LCTL> }; }; // Make the left Ctrl key a left Meta. xkb_symbols "lctrl_meta" { - replace key <LCTL> { [ Meta_L ] }; + replace key <LCTL> { [ Meta_L ] }; }; // Swap the functions of the CapsLock key and the left Ctrl key. -partial modifier_keys +partial modifier_keys xkb_symbols "swapcaps" { - replace key <CAPS> { [ Control_L ] }; - replace key <LCTL> { [ Caps_Lock ] }; + replace key <CAPS> { [ Control_L ] }; + replace key <LCTL> { [ Caps_Lock ] }; }; // Move Ctrl to the leftmost key on the middle row and CapsLock to the // leftmost key on the bottom row. Only works if the geometry or keycodes // file has defined appropriate aliases for the keys in question. -partial modifier_keys +partial modifier_keys xkb_symbols "ac_ctrl" { - replace key <AC00> { [ Control_L ] }; - replace key <AA00> { [ Caps_Lock ] }; + replace key <AC00> { [ Control_L ] }; + replace key <AA00> { [ Caps_Lock ] }; }; // Move Ctrl to the leftmost key on the bottom row and CapsLock to the // leftmost key on the middle row. Only works if the geometry or keycodes // file has defined appropriate aliases for the keys in question. -partial modifier_keys +partial modifier_keys xkb_symbols "aa_ctrl" { - replace key <AA00> { [ Control_L ] }; - replace key <AC00> { [ Caps_Lock ] }; + replace key <AA00> { [ Control_L ] }; + replace key <AC00> { [ Caps_Lock ] }; }; // Right Ctrl key functions as another right Alt. -partial modifier_keys +partial modifier_keys xkb_symbols "rctrl_ralt" { - key <RCTL> { symbols[Group1]= [ Alt_R ] }; + key <RCTL> { symbols[Group1]= [ Alt_R ] }; }; // Menu key functions as another right Ctrl. partial modifier_keys xkb_symbols "menu_rctrl" { - replace key <MENU> { [ Control_R, Control_R ] }; + replace key <MENU> { [ Control_R, Control_R ] }; modifier_map Control { Control_L, <MENU> }; }; // Right Alt key functions as another right Ctrl. -partial modifier_keys +partial modifier_keys xkb_symbols "ralt_rctrl" { replace key <RALT> { type[Group1] = "TWO_LEVEL", symbols[Group1] = [ Control_R, Control_R ] }; - modifier_map Control { <RALT> }; + modifier_map Control { <RALT> }; +}; + +// Swap the functions of the left Alt key and the left Ctrl key. +partial modifier_keys +xkb_symbols "swap_lalt_lctl" { + replace key <LALT> { [ Control_L, Control_L ] }; + replace key <LCTL> { [ Alt_L, Meta_L ] }; +}; + +// Swap the functions of the left Win key and the left Ctrl key. +partial modifier_keys +xkb_symbols "swap_lwin_lctl" { + replace key <LWIN> { [ Control_L ] }; + replace key <LCTL> { [ Super_L ] }; +}; + +// Map Ctrl to the left Alt key, Alt to the left Win key, +// and Super to the left Ctrl key. +partial modifier_keys +xkb_symbols "swap_lalt_lctl_lwin" { + replace key <LALT> { [ Control_L, Control_L ] }; + replace key <LWIN> { [ Alt_L, Meta_L ] }; + replace key <LCTL> { [ Super_L ] }; }; diff --git a/xorg-server/xkeyboard-config/symbols/cz b/xorg-server/xkeyboard-config/symbols/cz index 20af4b281..083cc7674 100644 --- a/xorg-server/xkeyboard-config/symbols/cz +++ b/xorg-server/xkeyboard-config/symbols/cz @@ -1,6 +1,6 @@ default partial alphanumeric_keys xkb_symbols "basic" { - + // This layout conforms to a new cz compromise standard designed // to satisfy most unix, windows and mac users. // 2001 by Kamil Toman <ktoman@email.cz> @@ -46,7 +46,7 @@ xkb_symbols "basic" { key <AC07> { [ j, J, apostrophe, NoSymbol ] }; key <AC08> { [ k, K, lstroke, NoSymbol ] }; key <AC09> { [ l, L, Lstroke, NoSymbol ] }; - + key <AC10> { [ uring, quotedbl, dollar, NoSymbol ] }; key <AC11> { [ section, exclam, apostrophe, ssharp ] }; key <AC12> { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; @@ -77,14 +77,14 @@ xkb_symbols "bksl" { key <BKSL> { [ backslash, bar, slash, NoSymbol ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "qwerty" { - + // This layout represent actual keyboard layout. It complies with symbols // printed on keys. // ----------------------------------------------------------------------- // This layout was created in 2011 by Lukáš Mojžíš <lmojzis@grenames.cz> - + include "cz(basic)" name[Group1]= "Czech (qwerty)"; diff --git a/xorg-server/xkeyboard-config/symbols/de b/xorg-server/xkeyboard-config/symbols/de index 01bde5d20..a497d7f48 100644 --- a/xorg-server/xkeyboard-config/symbols/de +++ b/xorg-server/xkeyboard-config/symbols/de @@ -39,7 +39,7 @@ xkb_symbols "basic" { key <AB02> { [ x, X, guillemotleft, U2039 ] }; key <AB04> { [ v, V, doublelowquotemark, singlelowquotemark ] }; key <AB05> { [ b, B, leftdoublequotemark, leftsinglequotemark ] }; - key <AB06> { [ n, N, rightdoublequotemark, rightsinglequotemark ] }; + key <AB06> { [ n, N, rightdoublequotemark, rightsinglequotemark ] }; key <AB08> { [ comma, semicolon, periodcentered, multiply ] }; key <AB09> { [ period, colon, U2026, division ] }; key <AB10> { [ minus, underscore, endash, emdash ] }; @@ -221,7 +221,7 @@ xkb_symbols "ro_nodeadkeys" { // in many programming languages. // to use this keymap, use a 105-key-keyboard and the command setxkbmap -model pc105 -layout dvorak -variant de // source: http://www-lehre.informatik.uni-osnabrueck.de/~rfreund/dvorak.php -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { include "us(dvorak)" @@ -479,7 +479,7 @@ xkb_symbols "neo" { // Copied from macintosh_vndr/de // olh@suse.de very close to MacOS map -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { include "de" @@ -496,7 +496,7 @@ xkb_symbols "mac" { key <AD07> { [ u, U, diaeresis, Aacute ] }; key <AD08> { [ i, I, slash, Ucircumflex ] }; key <AD11> { [ udiaeresis, Udiaeresis, periodcentered, degree ] }; - key <AD12> { [ plus, asterisk, asciitilde ] }; + key <AD12> { [ plus, asterisk, asciitilde ] }; key <AC01> { [ a, A, aring, Aring ] }; key <AC05> { [ g, G, copyright ] }; key <AC06> { [ h, H, ordfeminine ] }; @@ -506,7 +506,7 @@ xkb_symbols "mac" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac_nodeadkeys" { // modify the standard German mac layout to not have any dead keys include "de(mac)" @@ -571,13 +571,13 @@ xkb_symbols "dsb_qwertz" key <AD09> { [ o, O, oacute, Oacute ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "qwerty" { - + // This layout should work exactly as a de with the exception // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). // 2008 by Matej Košík <kosik@fiit.stuba.sk> - + include "de(basic)" name[Group1] = "German (qwerty)"; @@ -594,7 +594,7 @@ partial alphanumeric_keys xkb_symbols "ru" { include "de(basic)" - + name[Group1]= "Russian (Germany, phonetic)"; key.type[group1]="FOUR_LEVEL_ALPHABETIC"; diff --git a/xorg-server/xkeyboard-config/symbols/dk b/xorg-server/xkeyboard-config/symbols/dk index 34667fc48..838478bf8 100644 --- a/xorg-server/xkeyboard-config/symbols/dk +++ b/xorg-server/xkeyboard-config/symbols/dk @@ -43,7 +43,7 @@ xkb_symbols "nodeadkeys" { }; // Copied from macintosh_vndr/dk -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { include "dk" @@ -55,7 +55,7 @@ xkb_symbols "mac" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac_nodeadkeys" { include "dk(mac)" name[Group1]= "Danish (Macintosh, eliminate dead keys)"; @@ -64,7 +64,7 @@ xkb_symbols "mac_nodeadkeys" { key <AD12> { [diaeresis, asciicircum, asciitilde, dead_macron ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { include "no(dvorak)" diff --git a/xorg-server/xkeyboard-config/symbols/ee b/xorg-server/xkeyboard-config/symbols/ee index 9384bee83..9e6865e55 100644 --- a/xorg-server/xkeyboard-config/symbols/ee +++ b/xorg-server/xkeyboard-config/symbols/ee @@ -59,7 +59,7 @@ partial alphanumeric_keys xkb_symbols "dvorak" { include "us(dvorak)" name[Group1]= "Estonian (Dvorak)"; - + key <AE03> { [ 3, numbersign, sterling ] }; key <AE04> { [ 4, dollar, section, currency ] }; key <AE08> { [ 8, asterisk, onehalf ] }; @@ -68,7 +68,7 @@ xkb_symbols "dvorak" { key <AC02> { [ o, O, otilde, Otilde ] }; key <AC03> { [ e, E, odiaeresis, Odiaeresis ] }; key <AC04> { [ u, U, udiaeresis, Udiaeresis ] }; - key <AC10> { [ s, S, scaron, Scaron ] }; + key <AC10> { [ s, S, scaron, Scaron ] }; key <AB10> { [ z, Z, zcaron, Zcaron ] }; include "level3(ralt_switch)" diff --git a/xorg-server/xkeyboard-config/symbols/es b/xorg-server/xkeyboard-config/symbols/es index 62e2b2c6a..9e963a23f 100644 --- a/xorg-server/xkeyboard-config/symbols/es +++ b/xorg-server/xkeyboard-config/symbols/es @@ -141,7 +141,7 @@ xkb_symbols "ast" { }; // Copied from macintosh_vndr/es -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { include "es" name[Group1]= "Spanish (Macintosh)"; @@ -179,7 +179,7 @@ xkb_symbols "olpc" { key <AB08> { [ comma, semicolon ] }; key <AB09> { [ period, colon ] }; key <AB10> { [ minus, underscore ] }; - + key <I219> { [ less, greater, ISO_Next_Group ] }; include "level3(ralt_switch)" diff --git a/xorg-server/xkeyboard-config/symbols/fo b/xorg-server/xkeyboard-config/symbols/fo index dc9fa6b45..1000c9cf0 100644 --- a/xorg-server/xkeyboard-config/symbols/fo +++ b/xorg-server/xkeyboard-config/symbols/fo @@ -30,7 +30,7 @@ xkb_symbols "basic" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "nodeadkeys" { include "fo(basic)" diff --git a/xorg-server/xkeyboard-config/symbols/fr b/xorg-server/xkeyboard-config/symbols/fr index 3898b1c57..9c89db825 100644 --- a/xorg-server/xkeyboard-config/symbols/fr +++ b/xorg-server/xkeyboard-config/symbols/fr @@ -36,6 +36,8 @@ xkb_symbols "basic" { key <AB09> { [ colon, slash, periodcentered, division ] }; key <AB10> { [ exclam, section, dead_belowdot, dead_abovedot ] }; + include "kpdl(comma)" + include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/gb b/xorg-server/xkeyboard-config/symbols/gb index 7bf071cca..ead9e7b1c 100644 --- a/xorg-server/xkeyboard-config/symbols/gb +++ b/xorg-server/xkeyboard-config/symbols/gb @@ -25,7 +25,7 @@ xkb_symbols "basic" { include "level3(ralt_switch_multikey)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "intl" { // Describes the differences between a very simple en_US @@ -41,7 +41,7 @@ xkb_symbols "intl" { include "latin" - name[Group1]="English (UK, international with dead keys)"; + name[Group1]="English (UK, international with dead keys)"; key <AE02> { [ 2, dead_diaeresis, twosuperior, onehalf ] }; key <AE03> { [ 3, sterling, threesuperior, onethird ] }; @@ -57,7 +57,7 @@ xkb_symbols "intl" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "extd" { // Clone of the Microsoft "English (UK, Extended" layout, which // includes dead keys for: grave; diaeresis; circumflex; tilde; and @@ -73,9 +73,9 @@ xkb_symbols "extd" { include "latin" name[Group1]="English (UK, extended WinKeys)"; - + key <TLDE> { [ dead_grave, notsign, brokenbar, NoSymbol ] }; - + key <AE02> { [ 2, quotedbl, dead_diaeresis, onehalf ] }; key <AE03> { [ 3, sterling, threesuperior, onethird ] }; key <AE04> { [ 4, dollar, EuroSign, onequarter ] }; @@ -155,7 +155,7 @@ xkb_symbols "dvorakukp" { }; // Copied from macintosh_vndr/gb -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { // Describes the differences between a very simple en_US @@ -175,12 +175,12 @@ xkb_symbols "mac" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac_intl" { include "latin" - name[Group1]="English (UK, Macintosh international)"; + name[Group1]="English (UK, Macintosh international)"; key <AE02> { [ 2, at, EuroSign, onehalf ] }; key <AE03> { [ 3, sterling, twosuperior, onethird ] }; diff --git a/xorg-server/xkeyboard-config/symbols/ge b/xorg-server/xkeyboard-config/symbols/ge index 8c2e2e9a0..4f590a440 100644 --- a/xorg-server/xkeyboard-config/symbols/ge +++ b/xorg-server/xkeyboard-config/symbols/ge @@ -123,7 +123,7 @@ xkb_symbols "ergonomic" { key <AC07> { [ 0x010010db, noSymbol ] }; key <AC08> { [ 0x010010e1, noSymbol ] }; key <AC09> { [ 0x010010e0, noSymbol, L ] }; - key <AC10> { [ 0x010010d1, noSymbol, colon ] }; + key <AC10> { [ 0x010010d1, noSymbol, colon ] }; key <AC11> { [ 0x010010d2, noSymbol, 0x010010f9, quotedbl ] }; key <BKSL> { [ slash, section, backslash, bar ] }; diff --git a/xorg-server/xkeyboard-config/symbols/gh b/xorg-server/xkeyboard-config/symbols/gh index bd31a0b39..f29c25d5c 100644 --- a/xorg-server/xkeyboard-config/symbols/gh +++ b/xorg-server/xkeyboard-config/symbols/gh @@ -16,7 +16,7 @@ xkb_symbols "akan" { name[Group1]= "Akan"; key <AD01> { [ 0x0100025B, 0x01000190, q, Q ] }; - key <AB02> { [ 0x01000254, 0x01000186, x, X ] }; + key <AB02> { [ 0x01000254, 0x01000186, x, X ] }; }; partial alphanumeric_keys @@ -26,8 +26,8 @@ xkb_symbols "ga" { name[Group1]= "Ga"; key <AD01> { [ 0x0100025B, 0x01000190, q, Q ] }; - key <AB02> { [ 0x01000254, 0x01000186, x, X ] }; - key <AB03> { [ 0x0100014B, 0x0100014A, c, C ] }; + key <AB02> { [ 0x01000254, 0x01000186, x, X ] }; + key <AB03> { [ 0x0100014B, 0x0100014A, c, C ] }; }; partial alphanumeric_keys @@ -37,13 +37,13 @@ xkb_symbols "ewe" { name[Group1]= "Ewe"; key <AD01> { [ 0x0100025B, 0x01000190, q, Q ] }; - key <AB03> { [ 0x0100014B, 0x0100014A, c, C ] }; - key <AD11> { [ 0x01000254, 0x01000186, braceleft, braceleft ] }; - key <AD12> { [ 0x0100028B, 0x010001B2, braceright, braceright ] }; + key <AB03> { [ 0x0100014B, 0x0100014A, c, C ] }; + key <AD11> { [ 0x01000254, 0x01000186, braceleft, braceleft ] }; + key <AD12> { [ 0x0100028B, 0x010001B2, braceright, braceright ] }; key <BKSL> { [ 0x01000256, 0x01000189, backslash, backslash ] }; key <AC07> { [ 0x01000192, 0x01000191, j, J ] }; key <AC05> { [ g, G, 0x01000263, 0x01000194 ] }; - + }; partial alphanumeric_keys @@ -113,7 +113,7 @@ xkb_symbols "avn" { key <AB03> { [ 0x01000254, 0x01000186 ] }; // ɔ, Ɔ include "level3(ralt_switch)" - + }; // This keyboard layout fully imitates the 'Ghana Unicode' layout which is used in GILLBT on Windows with Keyman. @@ -146,6 +146,6 @@ xkb_symbols "gillbt" { key <AB01> { [ z, Z, 0x01000292, 0x010001B7 ] }; // ʒ, Ʒ key <AB02> { [ 0x01000269, 0x01000196, x, X ] }; // ɩ, Ɩ key <AB03> { [ c, C, 0x010000E7, 0x010000C7 ] }; // ç, Ç - + include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/group b/xorg-server/xkeyboard-config/symbols/group index fb2f879d0..8592f4344 100644 --- a/xorg-server/xkeyboard-config/symbols/group +++ b/xorg-server/xkeyboard-config/symbols/group @@ -1,108 +1,92 @@ -// using the group(switch) map, the right alt key temporarily chooses -// the second keyboard group (until it is released). -// -partial modifier_keys +// The right Alt key (while pressed) chooses the second keyboard group. +partial modifier_keys xkb_symbols "switch" { - key <RALT> { - symbols[Group1]= [ Mode_switch, Multi_key ], - virtualMods= AltGr + key <RALT> { + symbols[Group1] = [ Mode_switch, Multi_key ], + virtualMods= AltGr }; }; -// using the group(lswitch) map, the left alt key temporarily chooses -// the second keyboard group (until it is released). -// -partial modifier_keys +// The left Alt key (while pressed) chooses the second keyboard group. +partial modifier_keys xkb_symbols "lswitch" { - key <LALT> { - symbols[Group1]= [ Mode_switch, Multi_key ], - virtualMods= AltGr + key <LALT> { + symbols[Group1] = [ Mode_switch, Multi_key ], + virtualMods= AltGr }; }; - -// using the group(win_switch) map, both Windows'logo keys temporarily -// choose the second keyboard group (until release). If you use this -// map, you would declare you keyboard as pc101 or pc102 instead of -// pc104 or pc105. +// Either Win key (while pressed) chooses the second keyboard group. partial modifier_keys xkb_symbols "win_switch" { include "group(lwin_switch)" include "group(rwin_switch)" }; -// using the group(lwin_switch) map, the left Windows' logo key -// temporarily chooses the second keyboard group (until it is -// released). If you use this map, you would declare you keyboard as -// pc101 or pc102 instead of pc104 or pc105. +// The left Win key (while pressed) chooses the second keyboard group. +// (Using this map, you should declare your keyboard as pc101 or pc102 +// instead of pc104 or pc105.) partial modifier_keys xkb_symbols "lwin_switch" { - key <LWIN> { - symbols[Group1] = [ Mode_switch, Multi_key ], - virtualMods= AltGr + key <LWIN> { + symbols[Group1] = [ Mode_switch, Multi_key ], + virtualMods= AltGr }; }; -// using the group(rwin_switch) map, the right Windows' logo key -// temporarily chooses the second keyboard group (until it is -// released). If you use this map, you would declare you keyboard as -// pc101 or pc102 instead of pc104 or pc105. +// The right Win key (while pressed) chooses the second keyboard group. +// (Using this map, you should declare your keyboard as pc101 or pc102 +// instead of pc104 or pc105.) partial modifier_keys xkb_symbols "rwin_switch" { - key <RWIN> { - symbols[Group1] = [ Mode_switch, Multi_key ], - virtualMods= AltGr + key <RWIN> { + symbols[Group1] = [ Mode_switch, Multi_key ], + virtualMods= AltGr }; }; -// Right Ctrl key temporary chooses the second keyboard group. -// Needed mainly for Canadian keyboard +// The right Ctrl key (while pressed) chooses the second keyboard group. +// (Needed mainly for the Canadian keyboard.) partial modifier_keys xkb_symbols "rctrl_switch" { - key <RCTL> { - symbols[Group1]= [ Mode_switch ] + key <RCTL> { + symbols[Group1] = [ Mode_switch ] }; }; -// using the group(toggle) map, pressing the right alt key switches to -// the next sequential group (until the next explicit group change). -partial modifier_keys +// Pressing the right Alt key switches to the next group. +partial modifier_keys xkb_symbols "toggle" { virtual_modifiers AltGr; - key <RALT> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + key <RALT> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// using the group(shifts_toggle) map, pressing both shift keys together -// locks the next or previous sequential keyboard group -// (depending on which shift is pressed first - right or left, -// correspongingly) -partial modifier_keys +// Pressing both Shift keys switches to the next or previous group +// (depending on which Shift is pressed first). +partial modifier_keys xkb_symbols "shifts_toggle" { - key <LFSH> { [ Shift_L, ISO_Prev_Group ] }; - key <RTSH> { [ Shift_R, ISO_Next_Group ] }; + key <LFSH> { [ Shift_L, ISO_Prev_Group ] }; + key <RTSH> { [ Shift_R, ISO_Next_Group ] }; }; -// using the group(shift_caps_toggle) map, pressing: -// Shift+Caps Lock toggles group +// Pressing Shift+Caps_Lock switches to the next group. partial modifier_keys xkb_symbols "shift_caps_toggle" { - key <CAPS> { [ Caps_Lock, ISO_Next_Group ] }; + key <CAPS> { [ Caps_Lock, ISO_Next_Group ] }; }; -// using the group(shift_caps_switch) map, pressing: -// Caps Lock selects the first group -// Shift+Caps Lock selects the last group +// Pressing Caps_Lock selects the first group, +// pressing Shift+Caps_Lock selects the last group. partial modifier_keys xkb_symbols "shift_caps_switch" { key <CAPS> { [ ISO_First_Group, ISO_Last_Group ] }; }; -// using the group(win_menu_switch) map, pressing: -// LWIN selects the first group -// RWIN or MENU selects the last group +// Pressing the left Win key selects the first group, +// pressing the right Win or the Menu key selects the last group. partial modifier_keys xkb_symbols "win_menu_switch" { virtual_modifiers AltGr; @@ -120,9 +104,8 @@ xkb_symbols "win_menu_switch" { }; }; -// using the group(lctrl_rctrl_switch) map, pressing: -// Left Control selects the first group -// Right Control selects the last group +// Pressing the left Ctrl key selects the first group, +// pressing the right Ctrl key selects the last group. partial modifier_keys xkb_symbols "lctrl_rctrl_switch" { virtual_modifiers AltGr; @@ -140,20 +123,20 @@ xkb_symbols "lctrl_rctrl_switch" { // // CTRL-SHIFT toggle section // -partial modifier_keys +partial modifier_keys xkb_symbols "lctrl_lshift_toggle" { key <LFSH> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ Shift_L, ISO_Next_Group ] + symbols[Group1] = [ Shift_L, ISO_Next_Group ] }; key <LCTL> { [ Control_L, ISO_Next_Group ] }; }; -partial modifier_keys +partial modifier_keys xkb_symbols "lctrl_lshift_toggle_rev" { key <LFSH> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ Shift_L, ISO_Prev_Group ] + symbols[Group1] = [ Shift_L, ISO_Prev_Group ] }; key <LCTL> { [ Control_L, ISO_Prev_Group ] }; }; @@ -162,18 +145,18 @@ partial modifier_keys xkb_symbols "rctrl_rshift_toggle" { key <RTSH> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ Shift_R, ISO_Next_Group ] + symbols[Group1] = [ Shift_R, ISO_Next_Group ] }; key <RCTL> { [ Control_R, ISO_Next_Group ] }; }; -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_shift_toggle" { include "group(lctrl_lshift_toggle)" include "group(rctrl_rshift_toggle)" }; -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_shift_toggle_bidir" { include "group(lctrl_lshift_toggle_rev)" include "group(rctrl_rshift_toggle)" @@ -188,12 +171,12 @@ xkb_symbols "lctrl_lalt_toggle" { virtual_modifiers Alt; key <LALT> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], virtualMods= Alt }; key <LCTL> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Control_L, ISO_Next_Group ] + symbols[Group1] = [ Control_L, ISO_Next_Group ] }; }; @@ -202,12 +185,12 @@ xkb_symbols "lctrl_lalt_toggle_rev" { virtual_modifiers Alt; key <LALT> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Prev_Group ], + symbols[Group1] = [ NoSymbol, ISO_Prev_Group ], virtualMods= Alt }; key <LCTL> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Control_L, ISO_Prev_Group ] + symbols[Group1] = [ Control_L, ISO_Prev_Group ] }; }; @@ -216,22 +199,22 @@ xkb_symbols "rctrl_ralt_toggle" { virtual_modifiers Alt; key <RALT> { type[Group1]="PC_CONTROL_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], virtualMods= Alt }; key <RCTL> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Control_R, ISO_Next_Group ] + symbols[Group1] = [ Control_R, ISO_Next_Group ] }; }; -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_alt_toggle" { include "group(lctrl_lalt_toggle)" include "group(rctrl_ralt_toggle)" }; -partial modifier_keys +partial modifier_keys xkb_symbols "ctrl_alt_toggle_bidir" { include "group(lctrl_lalt_toggle_rev)" include "group(rctrl_ralt_toggle)" @@ -245,12 +228,12 @@ partial modifier_keys xkb_symbols "lalt_lshift_toggle" { virtual_modifiers Alt; key <LALT> { - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], virtualMods= Alt }; key <LFSH> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Shift_L, ISO_Next_Group ] + symbols[Group1] = [ Shift_L, ISO_Next_Group ] }; }; @@ -258,12 +241,12 @@ partial modifier_keys xkb_symbols "lalt_lshift_toggle_rev" { virtual_modifiers Alt; key <LALT> { - symbols[Group1]= [ NoSymbol, ISO_Prev_Group ], + symbols[Group1] = [ NoSymbol, ISO_Prev_Group ], virtualMods= Alt }; key <LFSH> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Shift_L, ISO_Prev_Group ] + symbols[Group1] = [ Shift_L, ISO_Prev_Group ] }; }; @@ -271,187 +254,186 @@ partial modifier_keys xkb_symbols "ralt_rshift_toggle" { virtual_modifiers Alt; key <RALT> { - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], virtualMods= Alt }; key <RTSH> { type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ Shift_R, ISO_Next_Group ] + symbols[Group1] = [ Shift_R, ISO_Next_Group ] }; }; -partial modifier_keys +partial modifier_keys xkb_symbols "alt_shift_toggle" { include "group(lalt_lshift_toggle)" include "group(ralt_rshift_toggle)" }; -partial modifier_keys +partial modifier_keys xkb_symbols "alt_shift_toggle_bidir" { include "group(lalt_lshift_toggle_rev)" include "group(ralt_rshift_toggle)" }; -// using the group(menu_toggle) map, pressing: -// Menu key toggles groups -// Shift+Menu acts as Menu +// Pressing the Menu key switches to the next group, +// while Shift+Menu acts as Menu. partial modifier_keys xkb_symbols "menu_toggle" { - key <MENU> { [ ISO_Next_Group, Menu ] }; + key <MENU> { [ ISO_Next_Group, Menu ] }; }; -// using the group(lwin_toggle) map, pressing the left Windows' logo key -// toggles groups. If you use this map, you would declare you keyboard -// as pc101 or pc102 instead of pc104 or pc105. +// Pressing the left Win key switches to the next group. +// (Using this map, you should declare your keyboard as +// pc101 or pc102 instead of pc104 or pc105.) partial modifier_keys xkb_symbols "lwin_toggle" { - virtual_modifiers AltGr; - key <LWIN> { - virtualMods= AltGr, - symbols[Group1] = [ ISO_Next_Group ] + virtual_modifiers AltGr; + key <LWIN> { + virtualMods= AltGr, + symbols[Group1] = [ ISO_Next_Group ] }; }; -// using the group(rwin_toggle) map, pressing the right Windows' logo key -// toggles groups. If you use this map, you would declare you keyboard -// as pc101 or pc102 instead of pc104 or pc105. +// Pressing the right Win key switches to the next group. +// (Using this map, you should declare your keyboard as +// pc101 or pc102 instead of pc104 or pc105.) partial modifier_keys xkb_symbols "rwin_toggle" { - virtual_modifiers AltGr; - key <RWIN> { - virtualMods= AltGr, - symbols[Group1] = [ ISO_Next_Group ] + virtual_modifiers AltGr; + key <RWIN> { + virtualMods= AltGr, + symbols[Group1] = [ ISO_Next_Group ] }; }; -// Both Ctrls pressed together toggle group +// Pressing both Ctrl keys switches to the next or previous group +// (depending on which Ctrl is pressed first). partial modifier_keys xkb_symbols "ctrls_toggle" { - virtual_modifiers LControl, RControl; + virtual_modifiers LControl, RControl; key <LCTL> { - type[Group1]="PC_RCONTROL_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Prev_Group ], - virtualMods= LControl + type[Group1]="PC_RCONTROL_LEVEL2", + symbols[Group1] = [ NoSymbol, ISO_Prev_Group ], + virtualMods= LControl }; key <RCTL> { - type[Group1]="PC_LCONTROL_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], - virtualMods= RControl + type[Group1]="PC_LCONTROL_LEVEL2", + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], + virtualMods= RControl }; }; -// Both Alts pressed together toggle group +// Pressing both Alt keys switches to the next or previous group +// (depending on which Alt is pressed first). partial modifier_keys xkb_symbols "alts_toggle" { - virtual_modifiers LAlt, RAlt; + virtual_modifiers LAlt, RAlt; key <LALT> { - type[Group1]="PC_RALT_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Prev_Group ], - virtualMods= LAlt + type[Group1]="PC_RALT_LEVEL2", + symbols[Group1] = [ NoSymbol, ISO_Prev_Group ], + virtualMods= LAlt }; key <RALT> { - type[Group1]="PC_LALT_LEVEL2", - symbols[Group1]= [ NoSymbol, ISO_Next_Group ], - virtualMods= RAlt + type[Group1]="PC_LALT_LEVEL2", + symbols[Group1] = [ NoSymbol, ISO_Next_Group ], + virtualMods= RAlt }; }; -// Left Shift key toggles group +// Pressing the left Shift key switches to the next group. partial modifier_keys xkb_symbols "lshift_toggle" { - virtual_modifiers AltGr; - key <LFSH> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + virtual_modifiers AltGr; + key <LFSH> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// Right Shift key toggles group +// Pressing the right Shift key switches to the next group. partial modifier_keys xkb_symbols "rshift_toggle" { - virtual_modifiers AltGr; - key <RTSH> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + virtual_modifiers AltGr; + key <RTSH> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// Left Alt key toggles group +// Pressing the left Alt key switches to the next group. partial modifier_keys xkb_symbols "lalt_toggle" { - virtual_modifiers AltGr; - key <LALT> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + virtual_modifiers AltGr; + key <LALT> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// Left Ctrl key toggles group +// Pressing the left Ctrl key switches to the next group. partial modifier_keys xkb_symbols "lctrl_toggle" { - virtual_modifiers AltGr; - key <LCTL> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + virtual_modifiers AltGr; + key <LCTL> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// Right Ctrl key toggles group +// Pressing the right Ctrl key switches to the next group. partial modifier_keys xkb_symbols "rctrl_toggle" { - virtual_modifiers AltGr; - key <RCTL> { - symbols[Group1]= [ ISO_Next_Group ], - virtualMods= AltGr + virtual_modifiers AltGr; + key <RCTL> { + symbols[Group1] = [ ISO_Next_Group ], + virtualMods= AltGr }; }; -// using the group(alt_caps_toggle) map, pressing: -// Alt+Caps Lock toggles group -// Caps Lock toggles caps lock +// Pressing Alt+Caps_Lock switches to the next group, +// pressing Caps_Lock toggles CapsLock. partial modifier_keys xkb_symbols "alt_caps_toggle" { - key <CAPS> { + key <CAPS> { type="PC_ALT_LEVEL2", - symbols[Group1]= [ Caps_Lock, ISO_Next_Group] + symbols[Group1] = [ Caps_Lock, ISO_Next_Group ] }; }; partial hidden modifier_keys xkb_symbols "olpc" { - key <I219> { [ ISO_Next_Group, ISO_Prev_Group ] }; + key <I219> { [ ISO_Next_Group, ISO_Prev_Group ] }; }; partial modifier_keys xkb_symbols "alt_space_toggle" { key <SPCE> { - type[Group1]="PC_ALT_LEVEL2", - symbols[Group1]= [ space, ISO_Next_Group ] + type[Group1]="PC_ALT_LEVEL2", + symbols[Group1] = [ space, ISO_Next_Group ] }; }; -// using the group(sclk_toggle) map, pressing the Scroll Lock key -// toggles groups. +// Pressing the Scroll Lock key switches to the next group, partial modifier_keys xkb_symbols "sclk_toggle" { - virtual_modifiers AltGr; - key <SCLK> { - virtualMods= AltGr, - symbols[Group1] = [ ISO_Next_Group ] + virtual_modifiers AltGr; + key <SCLK> { + virtualMods= AltGr, + symbols[Group1] = [ ISO_Next_Group ] }; }; -// Control_L+Win_L locks the first group (presumably Lat). -// Control_R+Menu locks the second group (presumably Rus). +// Control_L+Win_L selects the first group (presumably Lat), +// Control_R+Menu selects the second group (presumably Rus). partial modifier_keys xkb_symbols "lctrl_lwin_rctrl_menu" { key <LWIN> { - type[ Group1 ] = "PC_CONTROL_LEVEL2", - symbols[ Group1 ] = [ Super_L, ISO_First_Group ] + type[Group1] = "PC_CONTROL_LEVEL2", + symbols[Group1] = [ Super_L, ISO_First_Group ] }; key <MENU> { - type[ Group1 ] = "PC_CONTROL_LEVEL2", - symbols[ Group1 ] = [ Menu, ISO_Last_Group ] + type[Group1] = "PC_CONTROL_LEVEL2", + symbols[Group1] = [ Menu, ISO_Last_Group ] }; -}; // lctrl_lwin_rctrl_menu +}; diff --git a/xorg-server/xkeyboard-config/symbols/hr b/xorg-server/xkeyboard-config/symbols/hr index bda2afd22..1ec0c809a 100644 --- a/xorg-server/xkeyboard-config/symbols/hr +++ b/xorg-server/xkeyboard-config/symbols/hr @@ -13,7 +13,7 @@ xkb_symbols "basic" { key <AB10> { [ minus, underscore, dead_belowdot, dead_abovedot ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "us" { name[Group1]= "Croatian (US keyboard with Croatian letters)"; @@ -48,7 +48,7 @@ xkb_symbols "us" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "alternatequotes" { name[Group1]= "Croatian (use guillemets for quotes)"; @@ -56,7 +56,7 @@ xkb_symbols "alternatequotes" { include "rs(latinalternatequotes)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "unicode" { name[Group1]= "Croatian (use Croatian digraphs)"; @@ -64,7 +64,7 @@ xkb_symbols "unicode" { include "rs(latinunicode)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "unicodeus" { name[Group1]= "Croatian (US keyboard with Croatian digraphs)"; diff --git a/xorg-server/xkeyboard-config/symbols/hu b/xorg-server/xkeyboard-config/symbols/hu index 75b17fee5..e743360a3 100644 --- a/xorg-server/xkeyboard-config/symbols/hu +++ b/xorg-server/xkeyboard-config/symbols/hu @@ -353,7 +353,7 @@ hidden partial keypad_keys xkb_symbols "def_dot" { key <KPDL> { [ KP_Delete, KP_Decimal ] }; }; - + // def_dead: // Dead keys support part @@ -398,6 +398,7 @@ hidden partial alphanumeric_keys xkb_symbols "def_common" { key <AD01> { [ q, Q, backslash ] }; key <AD02> { [ w, W, bar ] }; + key <AD03> { [ e, E, Adiaeresis ] }; key <AD07> { [ u, U, EuroSign ] }; key <AD08> { [ i, I, Iacute, iacute ] }; key <AD09> { [ o, O, doublelowquotemark ] }; diff --git a/xorg-server/xkeyboard-config/symbols/ie b/xorg-server/xkeyboard-config/symbols/ie index 48f7232f0..0830fede4 100644 --- a/xorg-server/xkeyboard-config/symbols/ie +++ b/xorg-server/xkeyboard-config/symbols/ie @@ -86,7 +86,7 @@ xkb_symbols "basic" { key <AC10> { [ semicolon, colon, ellipsis, doubledagger ] }; key <AC11> { [ apostrophe, at, ae, AE ] }; key <BKSL> { [ numbersign, asciitilde, guillemotleft, guillemotright ] }; - + // // \ZXCVBNM,./ @@ -401,7 +401,7 @@ xkb_symbols "ogam_is434" { // Also overcomes annoying use of Scroll Lock LED inherited from // US symbols but not relevant here since we're not changing group. key <SCLK> {type[Group1] = "ONE_LEVEL", [ Shift_Lock ] }; - modifier_map Shift { Shift_Lock }; + modifier_map Shift { Shift_Lock }; include "compose(rwin)" }; diff --git a/xorg-server/xkeyboard-config/symbols/il b/xorg-server/xkeyboard-config/symbols/il index fa7564fb5..a1f615c62 100644 --- a/xorg-server/xkeyboard-config/symbols/il +++ b/xorg-server/xkeyboard-config/symbols/il @@ -43,12 +43,12 @@ xkb_symbols "basic" { key <AB09> { [ hebrew_finalzade, less ] }; key.type[Group1] = "THREE_LEVEL"; - + key <TLDE> { [ semicolon, asciitilde,0x10005b0 ]}; // Sheva key <AB10> { [ period, question, 0x10005c3 ]}; // Sof Pasuq key <AD03> { [ hebrew_qoph, E, EuroSign ]}; key <AC01> { [ hebrew_shin, A, 0x10020AA ]}; - + // The following may get overriden by the iso9995-3(basic101) symbols. // therefore they are included here. // Including them isn't a great idea (for instance: what if group 1 uses @@ -67,11 +67,11 @@ xkb_symbols "basic" { key <AE10> { [ 0, parenleft , 0x10005c1 ]}; // Shin dot key <AE11> { [ minus, underscore , 0x10005b9 ]}; // Holam key <AE12> { [ equal, plus , 0x10005bc ]}; // Dagesh/Shuruq - + // Mirrored: key <AD11> { [ bracketright, braceright, 0x10005bf ]}; // Rafe key <AD12> { [ bracketleft, braceleft, 0x10005bd ]}; // Meteg - + key <BKSL> { [ backslash, bar, 0x10005bb ]}; // Qubuts include "level3(ralt_switch)" @@ -79,7 +79,7 @@ xkb_symbols "basic" { // nikud patter based on Dekel Tsur's Hebrew mapping for LyX -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "lyx" { name[Group1]= "Hebrew (lyx)"; @@ -103,7 +103,7 @@ xkb_symbols "lyx" { key <AC01> { [ hebrew_shin, 0x10005b0 ] }; // Sheva key <AC02> { [ hebrew_dalet, 0x10005bc ] }; // Dagesh/Shuruq key <AC03> { [ hebrew_gimel, hebrew_gimel ] }; - key <AC04> { [ hebrew_kaph, hebrew_kaph ] }; + key <AC04> { [ hebrew_kaph, hebrew_kaph ] }; key <AC05> { [ hebrew_ayin, 0x10005c2 ] }; // Sin dot key <AC06> { [ hebrew_yod, 0x10005c1 ] }; // Shin dot key <AC07> { [ hebrew_chet, 0x10005b4 ] }; // Hiriq @@ -136,13 +136,13 @@ xkb_symbols "lyx" { key <AE08> { [ 8, asterisk ]}; key <AE09> { [ 9, parenright ]}; key <AE10> { [ 0, parenleft ]}; - + key <AE11> { [ minus , 0x10005be ] }; // H. Hiphen key <AE12> { [ equal , plus ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "phonetic" { // uses the phonetic layout from old Slackware 'il.map' file @@ -199,7 +199,7 @@ xkb_symbols "phonetic" { // layout below does not include 'il(basic)' but redoes the _whole_ thing from // scratch. -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "biblical" { name[Group1]= "Hebrew (Biblical, Tiro)"; key.type = "FOUR_LEVEL_SEMIALPHABETIC"; @@ -267,7 +267,7 @@ xkb_symbols "biblical" { // The layout corresponds phonetically to a US standard layout or similar (Qwerty). // If you are using an actual Hebrew keyboard, you are probably better off using a Tiro compliant scholarly layout // This linux port created and maintained by Dennis Meulensteen, dennis@meulensteen.nl -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "biblicalSIL" { name[Group1]= "Hebrew (Biblical, SIL phonetic)"; key.type = "FOUR_LEVEL_SEMIALPHABETIC"; diff --git a/xorg-server/xkeyboard-config/symbols/in b/xorg-server/xkeyboard-config/symbols/in index 68f63e528..fdf008887 100644 --- a/xorg-server/xkeyboard-config/symbols/in +++ b/xorg-server/xkeyboard-config/symbols/in @@ -1,6 +1,6 @@ // This layout includes all Indian layouts, including: // - Devanagari (Hindi, Marathi, Sanskrit) -// - Bengali +// - Bangla // - Gujarati // - Kannada // - Malayalam @@ -12,12 +12,12 @@ // Links: // - Indic INSCRIPT keyboard layout diagrams: // http://java.sun.com/products/jfc/tsc/articles/InputMethod/indiclayout.html -// - Bengali Baishakhi (Bengali layouts): -// - Bengali Baishakhi Inscript (Bengali layouts): -// - Bengali Bornona (Bengali layouts): -// - Uni Gitanjali (Bengali layouts): +// - Bangla Baishakhi (Bangla layouts): +// - Bangla Baishakhi Inscript (Bangla layouts): +// - Bangla Bornona (Bangla layouts): +// - Uni Gitanjali (Bangla layouts): // http://nltr.org -// - Ekusheyr Shadhinota (Bengali layouts): +// - Ekusheyr Shadhinota (Bangla layouts): // http://ekushey.org/projects/shadhinota/index.html // - Microsoft Windows XP SP2: Indic Language Standards - an Introduction: // http://www.bhashaindia.com/MSProducts/XpSp2/Articles/IndicLanguageStandards.aspx @@ -135,9 +135,9 @@ xkb_symbols "bolnagri" { key <AD08> { [ U093F, U0940, U0907, U0908 ] }; // I: i, ii matras key <AD09> { [ U094B, U094C, U0913, U0914 ] }; // O: o, au matras key <AD10> { [ U092A, U092B ] }; // P: pa, pha - key <AD11> { [ bracketleft, braceleft ] }; + key <AD11> { [ bracketleft, braceleft ] }; key <AD12> { [ bracketright, braceright ] }; - + //A Row key <AC01> { [ U093E, U0906, U0905, U0906 ] }; // A: aa, full A, AA key <AC02> { [ U0938, U0937 ] }; // S: sa, ssa @@ -148,7 +148,7 @@ xkb_symbols "bolnagri" { key <AC07> { [ U091C, U091D ] }; // J: ja, jha key <AC08> { [ U0915, U0916 ] }; // K: ka, kha key <AC09> { [ U0932, U0933, U0962, U090C ] }; // L: la, vocalic L or lru matra - key <AC10> { [ semicolon, colon ] }; + key <AC10> { [ semicolon, colon ] }; key <AC11> { [apostrophe, quotedbl ] }; //Z Row @@ -176,7 +176,7 @@ xkb_symbols "bolnagri" { partial alphanumeric_keys xkb_symbols "ben" { - name[Group1]= "Bengali (India)"; + name[Group1]= "Bangla (India)"; // Mainly numbers. key <AE01> { [ U09E7 ] }; @@ -244,7 +244,7 @@ xkb_symbols "ben" { }; xkb_symbols "ben_probhat" { - name[Group1]= "Bengali (India, Probhat)"; + name[Group1]= "Bangla (India, Probhat)"; key <ESC> { [ Escape ] }; // numbers @@ -318,10 +318,10 @@ xkb_symbols "ben_probhat" { include "rupeesign(4)" }; -// Bengali Baishakhi, Bengali Baishakhi Inscript, Bengali Bornona, Uni Gitanjali Layouts are added by Promathesh Mandal <promathesh812004@gmail.com> +// Bangla Baishakhi, Bangla Baishakhi Inscript, Bangla Bornona, Uni Gitanjali Layouts are added by Promathesh Mandal <promathesh812004@gmail.com> xkb_symbols "ben_baishakhi" { - name[Group1]= "Bengali (India, Baishakhi)"; + name[Group1]= "Bangla (India, Baishakhi)"; key <ESC> { [ Escape ] }; // numbers @@ -398,7 +398,7 @@ xkb_symbols "ben_baishakhi" { }; xkb_symbols "ben_inscript" { - name[Group1]= "Bengali (India, Baishakhi Inscript)"; + name[Group1]= "Bangla (India, Baishakhi Inscript)"; // Mainly numbers. key <TLDE> { [ 0x100200D, 0x100200C ] }; @@ -464,7 +464,7 @@ xkb_symbols "ben_inscript" { }; xkb_symbols "ben_gitanjali" { - name[Group1]= "Bengali (India, Uni Gitanjali)"; + name[Group1]= "Bangla (India, Uni Gitanjali)"; key <ESC> { [ Escape ] }; // numbers @@ -542,7 +542,7 @@ xkb_symbols "ben_gitanjali" { xkb_symbols "ben_bornona" { - name[Group1]= "Bengali (India, Bornona)"; + name[Group1]= "Bangla (India, Bornona)"; key <ESC> { [ Escape ] }; // numbers @@ -616,7 +616,7 @@ xkb_symbols "ben_bornona" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "guj" { name[Group1]= "Gujarati"; @@ -683,7 +683,7 @@ xkb_symbols "guj" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "kan" { // Inscript layout for Kannada @@ -719,7 +719,7 @@ xkb_symbols "kan" { key <AD10> { [ U0c9c, U0c9d ] }; key <AD11> { [ U0ca1, U0ca2 ] }; key <AD12> { [ U0cbc, U0c9e ] }; - + key <AC01> { [ U0ccb, U0c93 ] }; key <AC02> { [ U0cc7, U0c8f ] }; key <AC03> { [ U0ccd, U0c85 ] }; @@ -757,13 +757,13 @@ xkb_symbols "kan" { // Date : Sat Aug 17 21:10:48 IST 2002 // Mapping: -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mal" { name[Group1] = "Malayalam"; //From grave to backslash (\) - + key <TLDE> { [ U0d4a , U0d12 ] }; // svu: @@ -771,7 +771,7 @@ xkb_symbols "mal" { // but the digits are replaced with the ones from 'mal_plusnum' - // for the integrity of all Indian layouts // -// key <AE01> { [1 , exclam ] }; +// key <AE01> { [1 , exclam ] }; // key <AE02> { [2 , at ] }; // key <AE03> { [3 , numbersign ] }; // key <AE04> { [4 , dollar ] }; @@ -797,9 +797,9 @@ xkb_symbols "mal" { key <AE12> { [ U0d43 , U0d0b ] }; key <BKSL> { [U0200c, U05C ]};//bksl: ZWNJ - + // From 'q' to right bracket (]) - + key <AD01> { [ U0d4c , U0d14 ] }; key <AD02> { [ U0d48 , U0d10 ] }; key <AD03> { [ U0d3e , U0d06 ] }; @@ -814,7 +814,7 @@ xkb_symbols "mal" { key <AD12> { [ U0200d , U0d1e ] }; // From 'a' to apostrophe (') - + key <AC01> { [ U0d4b , U0d13 ] }; key <AC02> { [ U0d47 , U0d0f ] }; key <AC03> { [ U0d4d , U0d05 ] }; @@ -826,9 +826,9 @@ xkb_symbols "mal" { key <AC09> { [ U0d24 , U0d25 ] }; key <AC10> { [ U0d1a , U0d1b ] }; key <AC11> { [ U0d1f , U0d20 ] }; - + // From 'z' to slash (/) - + key <AB01> { [ U0d46 , U0d0e ] }; key <AB02> { [ U0d02 , U200b ] };//X:ZWSP key <AB03> { [ U0d2e , U0d23 ] }; @@ -884,7 +884,7 @@ xkb_symbols "mal_lalitha" { key <AD10> { [ U0D2A ] }; // P: pa key <AD11> { [ bracketleft, braceleft ] };//braceleft: key <AD12> { [ bracketright, braceright ] };//braceright: - + //A Row key <AC01> { [ U0D3E, U0D05, U0D06, U0D05 ] }; // A: a,aa key <AC02> { [ U0D38, U0D37 ] }; // S: sa, ssa @@ -895,7 +895,7 @@ xkb_symbols "mal_lalitha" { key <AC07> { [ U0D1C, U0D1D ] }; // J: ja, jha key <AC08> { [ U0D15, U0D16 ] }; // K: ka, kha key <AC09> { [ U0D32, U0D33 ] }; // L: la, vocalic L or lru matra` - key <AC10> { [ semicolon, colon ] }; + key <AC10> { [ semicolon, colon ] }; key <AC11> { [apostrophe, quotedbl ] }; //Z Row @@ -919,14 +919,14 @@ xkb_symbols "mal_lalitha" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "ori" { // Inscript layout for Oriya // Author: G Karunakar <karunakar@freedomink.org> // Date: Wed Nov 13 18:16:19 IST 2002 name[Group1]= "Oriya"; - + key <AE01> { [ U0b67 ] }; key <AE02> { [ U0b68 ] }; key <AE03> { [ U0b69 ] }; @@ -952,7 +952,7 @@ xkb_symbols "ori" { key <AD10> { [ U0b1c, U0b1d ] }; key <AD11> { [ U0b21, U0b22 ] }; key <AD12> { [ U0b3c, U0b1e ] }; - + key <AC01> { [ U0b4b, U0b13 ] }; key <AC02> { [ U0b47, U0b0f ] }; key <AC03> { [ U0b4d, U0b05 ] }; @@ -964,7 +964,7 @@ xkb_symbols "ori" { key <AC09> { [ U0b24, U0b25 ] }; key <AC10> { [ U0b1a, U0b1b ] }; key <AC11> { [ U0b1f, U0b20 ] }; - + key <AB02> { [ U0b02, U0b01 ] }; key <AB03> { [ U0b2e, U0b23 ] }; key <AB04> { [ U0b28 ] }; @@ -985,7 +985,7 @@ xkb_symbols "ori" { // based on a keyboard map from an 'xkb/symbols/tml' file // INSCRIPT -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tam" { name[Group1]= "Tamil"; @@ -1016,7 +1016,7 @@ xkb_symbols "tam" { // Mainly voiced consonants key <AD07> { [ U0BB9, U0B99 ] }; - key <AD10> { [ U0B9c ] }; + key <AD10> { [ U0B9c ] }; key <AD12> { [ U0B9E ] }; // Mainly short vowels @@ -1051,7 +1051,7 @@ xkb_symbols "tam" { include "rupeesign(4)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tam_unicode" { // Description: A keymap based on the TamilNet'99 typewriter keyboard @@ -1061,7 +1061,7 @@ xkb_symbols "tam_unicode" { // Secondary contact: Sri Ramadoss M <amachu@au-kbc.org> // Date : Fri Sep 4 11:32:00 CST 2009 // Mapping: - + name[Group1]= "Tamil (Unicode)"; // granthas @@ -1105,7 +1105,7 @@ xkb_symbols "tam_unicode" { key <AC09> { [ U0B9F ] }; key <AC10> { [ U0BCD, U0B83 ] }; key <AC11> { [ U0B99 ] }; - + // Zrow key <AB01> { [ U0BA3 ] }; key <AB02> { [ U0B92, U0B93 ] }; @@ -1182,7 +1182,7 @@ xkb_symbols "tam_keyboard_with_numerals" { key <AB08> { [ U0B87, U0B88 ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tam_TSCII" { // Description : A Tamil typewrite-style keymap @@ -1200,7 +1200,7 @@ xkb_symbols "tam_TSCII" { key <AE05> { [ 0x1000085, 0x100008a ] }; // sa key <AE06> { [ 0x1000086, 0x100008b ] }; // ha key <AE07> { [ 0x1000087, 0x100008c ] }; // ksha - + // Qrow key <AD01> { [ 0x10000bb, 0x100009a ] }; // nja key <AD02> { [ 0x10000c8, 0x10000da ] }; // Ra @@ -1226,7 +1226,7 @@ xkb_symbols "tam_TSCII" { key <AC09> { [ 0x10000bc, 0x10000ce ] }; // da key <AC10> { [ 0x10000c6, 0x10000d8 ] }; // zha key <AC11> { [ 0x10000b9, 0x1000099 ] }; // nga - + // Zrow key <AB01> { [ 0x10000bd, 0x10000cf ] }; // Na key <AB02> { [ 0x10000b4, 0x10000b5 ] }; // o, O @@ -1239,7 +1239,7 @@ xkb_symbols "tam_TSCII" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tam_TAB" { // Description: A keymap based on the TamilNet'99 typewriter keyboard @@ -1257,7 +1257,7 @@ xkb_symbols "tam_TAB" { key <AE05> { [ 0x10000fd ] } ; key <AE06> { [ 0x10000fe ] } ; key <AE07> { [ 0x10000ff ] } ; - + // q-row key <AD01> { [ 0x10000eb, 0x10000b3 ] }; key <AD02> { [ 0x10000f8, 0x10000c1 ] }; @@ -1283,7 +1283,7 @@ xkb_symbols "tam_TAB" { key <AC09> { [ 0x10000ec, 0x10000b4 ] }; key <AC10> { [ 0x10000f6, 0x10000bf ] }; key <AC11> { [ 0x10000e9, 0x10000b1 ] }; - + // z-row key <AB01> { [ 0x10000ed, 0x10000b5 ] }; key <AB02> { [ 0x10000e5, 0x10000e6 ] }; @@ -1295,7 +1295,7 @@ xkb_symbols "tam_TAB" { key <AB08> { [ 0x10000de, 0x10000df ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tel" { // Inscript layout for Telugu using Unicode @@ -1318,8 +1318,8 @@ xkb_symbols "tel" { key <AE10> { [ U0c66, parenright ] }; key <AE11> { [ U0c03, underscore ] }; key <AE12> { [ U0c43, U0c0b ] }; - key <BKSP> { [ BackSpace ] }; - + key <BKSP> { [ BackSpace ] }; + key <AD01> { [ U0c4c, U0c14 ] }; key <AD02> { [ U0c48, U0c10 ] }; key <AD03> { [ U0c3e, U0c06 ] }; @@ -1332,7 +1332,7 @@ xkb_symbols "tel" { key <AD10> { [ U0c1c, U0c1d ] }; key <AD11> { [ U0c21, U0c22 ] }; key <AD12> { [ U0c1e ] }; - + key <AC01> { [ U0c4b, U0c13 ] }; key <AC02> { [ U0c47, U0c0f ] }; key <AC03> { [ U0c4d, U0c05 ] }; @@ -1344,7 +1344,7 @@ xkb_symbols "tel" { key <AC09> { [ U0c24, U0c25 ] }; key <AC10> { [ U0c1a, U0c1b ] }; key <AC11> { [ U0c1f, U0c20 ] }; - + key <AB01> { [ U0c46, U0c0e ] }; key <AB02> { [ U0c02, U0c01 ] }; key <AB03> { [ U0c2e, U0c23 ] }; @@ -1364,19 +1364,19 @@ xkb_symbols "tel" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "urd-phonetic" { include "pk(urd-phonetic)" name[Group1]= "Urdu (phonetic)"; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "urd-phonetic3" { include "pk(urd-crulp)" name[Group1]= "Urdu (alternative phonetic)"; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "urd-winkeys" { include "pk(urd-nla)" name[Group1]= "Urdu (WinKeys)"; @@ -1457,7 +1457,7 @@ xkb_symbols "guru" { // http://www.satluj.org/Jhelum.html //Modified for Inscript to make //Original Author : Amanpreet Singh Alam <apreet.alam@gmail.com - + partial alphanumeric_keys xkb_symbols "jhelum" { name[Group1] = "Punjabi (Gurmukhi Jhelum)"; @@ -1478,7 +1478,7 @@ xkb_symbols "jhelum" { key <AE11> { [ minus,underscore] }; key <AE12> { [ equal,plus] }; key <BKSL> { [ U0964,U0965,U007C,U005C] }; //pipe : danda, double danda - + //Q Row key <AD01> { [ U0A4C, U0A14 ] }; // Q: oo, ooh key <AD02> { [ U0A48, U0A10 ] }; // W: ee, ae @@ -1490,9 +1490,9 @@ xkb_symbols "jhelum" { key <AD08> { [ U0A17, U0A18, U0A5A ] }; // I:ga, gha key <AD09> { [ U0A24, U0A1F ] }; // O: ta, tha key <AD10> { [ U0A2A, U0A5E, VoidSymbol,U0A5E ] }; // P: pa, pha - key <AD11> { [ U0A21, U0A22, bracketleft, braceleft ] }; + key <AD11> { [ U0A21, U0A22, bracketleft, braceleft ] }; key <AD12> { [ U0A19, U0A1E, bracketright, braceright ] }; - + //A Row key <AC01> { [ U0A4B, U0A13 ] }; // A: o, oo key <AC02> { [ U0A47, U0A0F ] }; // S: e, ee @@ -1505,7 +1505,7 @@ xkb_symbols "jhelum" { key <AC09> { [ U0A32, U0A25, U0A33 ] }; // L: la, tha key <AC10> { [ U0A38, colon, U0A36 ] }; //; sa key <AC11> { [apostrophe, quotedbl ] }; - + //Z Row key <AB01> { [ U0A71, U0A3C ] }; // Z: addak, par bindi key <AB02> { [ U0A02, U0A70 ] }; // X: bindi, tippi @@ -1517,7 +1517,7 @@ xkb_symbols "jhelum" { key <AB08> { [ comma, U262C ] };// comma: comma, dev abbreviation sign key <AB09> { [ period, U0A74 ] }; // period: period, nukta key <AB10> { [ slash, question ] }; - + // modifier_map Shift { Shift_L }; // modifier_map Lock { Caps_Lock }; // modifier_map Control{ Control_L }; @@ -1534,15 +1534,15 @@ xkb_symbols "olpc" { key <TLDE> { [ U094A, U0912 ] }; // DEVANAGARI VOWEL SIGN SHORT O; DEVANAGARI LETTER SHORT O key <AE01> { [ U0967, U090D ] }; // DEVANAGARI DIGIT ONE; DEVANAGARI LETTER CANDRA E key <AE02> { [ U0968, U0945 ] }; // DEVANAGARI DIGIT TWO; DEVANAGARI VOWEL SIGN CANDRA E - key <AE03> { [ U0969 ] }; // DEVANAGARI DIGIT THREE; - key <AE04> { [ U096A ] }; // DEVANAGARI DIGIT FOUR; - key <AE05> { [ U096B ] }; // DEVANAGARI DIGIT FIVE; - key <AE06> { [ U096C ] }; // DEVANAGARI DIGIT SIX; - key <AE07> { [ U096D ] }; // DEVANAGARI DIGIT SEVEN; - key <AE08> { [ U096E ] }; // DEVANAGARI DIGIT EIGHT; - key <AE09> { [ U096F, parenleft ] }; // DEVANAGARI DIGIT NINE; - key <AE10> { [ U0966, parenright ] }; // DEVANAGARI DIGIT ZERO; - key <AE11> { [ minus, U0903 ] }; // DEVANAGARI SIGN VISARGA; + key <AE03> { [ U0969 ] }; // DEVANAGARI DIGIT THREE; + key <AE04> { [ U096A ] }; // DEVANAGARI DIGIT FOUR; + key <AE05> { [ U096B ] }; // DEVANAGARI DIGIT FIVE; + key <AE06> { [ U096C ] }; // DEVANAGARI DIGIT SIX; + key <AE07> { [ U096D ] }; // DEVANAGARI DIGIT SEVEN; + key <AE08> { [ U096E ] }; // DEVANAGARI DIGIT EIGHT; + key <AE09> { [ U096F, parenleft ] }; // DEVANAGARI DIGIT NINE; + key <AE10> { [ U0966, parenright ] }; // DEVANAGARI DIGIT ZERO; + key <AE11> { [ minus, U0903 ] }; // DEVANAGARI SIGN VISARGA; key <AE12> { [ U0943, U090B ] }; // DEVANAGARI VOWEL SIGN VOCALIC R; DEVANAGARI LETTER VOCALIC R key <AD01> { [ U094C, U0914 ] }; // DEVANAGARI VOWEL SIGN AU; DEVANAGARI LETTER AU @@ -1591,7 +1591,7 @@ xkb_symbols "olpc" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "hin-wx" { name[Group1]= "Hindi (Wx)"; @@ -1678,13 +1678,13 @@ xkb_symbols "eng" { // Comment : Based on the Inscript Keyboard created by M Baiju // Mapping: -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mal_enhanced" { name[Group1] = "Malayalam (enhanced Inscript with Rupee Sign)"; //From grave to backslash (\) - + key <TLDE> { [ U0d4a , U0d12 ] }; key <AE01> { [ U0d67 , exclam ] }; key <AE02> { [ U0d68 , at ] }; @@ -1703,7 +1703,7 @@ xkb_symbols "mal_enhanced" { // From 'q' to right bracket (]) - + key <AD01> { [ U0d57 , U0d14 ] }; key <AD02> { [ U0d48 , U0d10 ] }; key <AD03> { [ U0d3e , U0d06 ] }; @@ -1718,7 +1718,7 @@ xkb_symbols "mal_enhanced" { key <AD12> { [ U0200d , U0d1e ] }; // From 'a' to apostrophe (') - + key <AC01> { [ U0d4b , U0d13 ] }; key <AC02> { [ U0d47 , U0d0f ] }; key <AC03> { [ U0d4d , U0d05 ] }; @@ -1730,9 +1730,9 @@ xkb_symbols "mal_enhanced" { key <AC09> { [ U0d24 , U0d25 ] }; key <AC10> { [ U0d1a , U0d1b ] }; key <AC11> { [ U0d1f , U0d20 ] }; - + // From 'z' to slash (/) - + key <AB01> { [ U0d46 , U0d0e ] }; key <AB02> { [ U0d02 , U0d7a ] }; key <AB03> { [ U0d2e , U0d23 ] }; diff --git a/xorg-server/xkeyboard-config/symbols/inet b/xorg-server/xkeyboard-config/symbols/inet index 839439a96..fe21f1ed7 100644 --- a/xorg-server/xkeyboard-config/symbols/inet +++ b/xorg-server/xkeyboard-config/symbols/inet @@ -1,8 +1,8 @@ -// EAK (Easy Access, Internet, Multimedia, PDA) keyboards +// EAK (Easy Access keyboards: Internet, Multimedia, PDA) // Copyright (C) 2002 Stanislav Brabec <sbrabec@suse.cz> // -// Based on LinEAK project -// LinEAK - Linux support for Easy Access and Internet Keyboards +// Based on the LinEAK project. +// LinEAK - Linux support for Easy Access and Internet Keyboards // Copyright (C) 2001, 2002 Mark Smulders <Mark@PIRnet.nl> // Usage in XF86Config: @@ -13,28 +13,25 @@ // Simple command line usage: // setxkbmap 'my_kb_layout' -variant 'my_kb_variant' -model 'my_eak_type' -// All keyboards listed here should be also mentioned in -// rules/base, base.lst and base.xml. - -// Very common set of media keys +// Very common set of media keys. partial hidden alphanumeric_keys xkb_symbols "media_common" { - key <I01> { [ XF86AudioMedia ] }; + key <I01> { [ XF86AudioMedia ] }; key <I10> { [ XF86AudioPrev ] }; key <I19> { [ XF86AudioNext ] }; key <I20> { [ XF86AudioMute ] }; key <I22> { [ XF86AudioPlay, XF86AudioPause ] }; key <I24> { [ XF86AudioStop, XF86Eject ] }; - key <I2E> { [ XF86AudioLowerVolume ] }; + key <I2E> { [ XF86AudioLowerVolume ] }; key <I30> { [ XF86AudioRaiseVolume ] }; key <K5A> { [ XF86Eject ] }; key <K6C> { [ XF86Eject ] }; }; -// popular web navigation combination +// Popular web navigation keys. partial hidden alphanumeric_keys xkb_symbols "nav_common" { - key <I21> { [ XF86Calculator ] }; + key <I21> { [ XF86Calculator ] }; key <I32> { [ XF86WWW ] }; key <I65> { [ XF86Search ] }; key <I66> { [ XF86Favorites ] }; @@ -44,7 +41,7 @@ xkb_symbols "nav_common" { key <I6A> { [ XF86Back ] }; key <I6B> { [ XF86MyComputer ] }; key <I6C> { [ XF86Mail ] }; - key <I6D> { [ XF86AudioMedia ] }; + key <I6D> { [ XF86AudioMedia ] }; }; // ACPI Standard @@ -58,7 +55,7 @@ xkb_symbols "acpi_common" { key <I16> { [ XF86Sleep ] }; }; -// Combined sections, for simplicity +// Combined sections, for simplicity. partial hidden alphanumeric_keys xkb_symbols "media_nav_common" { include "inet(media_common)" @@ -122,7 +119,7 @@ xkb_symbols "evdev" { key <FK20> { [ XF86AudioMicMute ] }; -// key <I120> { [ ] }; // KEY_MACRO +// key <I120> { [ ] }; // KEY_MACRO key <I126> { [ plusminus ] }; key <I128> { [ XF86LaunchA ] }; key <I147> { [ XF86MenuKB ] }; @@ -139,8 +136,8 @@ xkb_symbols "evdev" { key <I158> { [ XF86WWW ] }; key <I159> { [ XF86DOS ] }; key <I160> { [ XF86ScreenSaver ] }; -// key <I161> { [ ] }; // KEY_DIRECTION - key <I162> { [ XF86RotateWindows ] }; + key <I161> { [ XF86RotateWindows ] }; + key <I162> { [ XF86TaskPane ] }; key <I163> { [ XF86Mail ] }; key <I164> { [ XF86Favorites ] }; key <I165> { [ XF86MyComputer ] }; @@ -220,7 +217,7 @@ xkb_symbols "evdev" { // key <I253> { [ ] }; // KEY_DISPLAY_OFF -- turn off display // key <I254> { [ ] }; // KEY_WIMAX key <I255> { [ XF86Hibernate ] }; // KEY_HIBERNATE - + key <FK13> { [ XF86Tools ] }; key <FK14> { [ XF86Launch5 ] }; key <FK15> { [ XF86Launch6 ] }; @@ -230,6 +227,8 @@ xkb_symbols "evdev" { }; +// Acer + // Acer AirKey V partial alphanumeric_keys xkb_symbols "airkey" { @@ -299,15 +298,16 @@ xkb_symbols "acer_laptop" { key <K66> { [ XF86Launch3 ] }; // Fn+F2 (HAL) // Special Characters - // To avoid setting a precedent/ standard that will be broken in later + // To avoid setting a precedent/standard that will be broken in later // versions of HAL, these keys are commented out for now. When they are no // longer marked 'FIXME' and have saner keycodes, these two entries can be // fixed and permanently uncommented. In the meantime, just uncomment these - // to make the keys work + // to make the keys work. // key <K5D> { [ EuroSign ] }; // Euro (HAL) // key <K5E> { [ dollar ] }; // Dollar (HAL) }; + // Azona // Azona RF2300 wireless Internet Keyboard @@ -374,7 +374,6 @@ xkb_symbols "btc5113rf" { key <I32> { [ XF86Search ] }; }; - // BTC 9000 partial alphanumeric_keys xkb_symbols "btc9000" { @@ -444,7 +443,8 @@ xkb_symbols "btc9019u" { key <I02> { [ XF86HomePage ] }; }; -// Cherry Blue Line + +// Cherry // Cherry Blue Line CyBo@rd partial alphanumeric_keys @@ -509,7 +509,7 @@ xkb_symbols "cherrycyboard" { }; // Cherry CyMotion Expert -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "cherrycmexpert" { include "inet(cherryblueb)" include "inet(acpi_common)" @@ -520,7 +520,7 @@ xkb_symbols "cherrycmexpert" { // Chicony // Chicony Internet Keyboard -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "chicony" { include "inet(acpi_common)" key <I12> { [ XF86AudioMute ] }; @@ -542,7 +542,7 @@ xkb_symbols "chicony" { }; // Chicony KU-0108 -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "chicony0108" { include "inet(cherrycyboard)" }; @@ -592,7 +592,7 @@ xkb_symbols "compaqeak8" { }; // Compaq Internet Keyboard (7 keys) -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "compaqik7" { key <I12> { [ XF86LightBulb ] }; key <I1E> { [ XF86Mail ] }; @@ -630,7 +630,6 @@ xkb_symbols "compaqik18" { key <I68> { [ Print ] }; }; - // Laptop/notebook Compaq (eg. Armada, Evo) Laptop Keyboard partial alphanumeric_keys xkb_symbols "armada" { @@ -639,9 +638,9 @@ xkb_symbols "armada" { key <I1E> { [ XF86Mail ] }; key <I1F> { [ XF86HomePage ] }; key <I23> { [ XF86WWW ] }; - key <I59> { [ XF86Launch2 ] }; // Battery Monitor + key <I59> { [ XF86Launch2 ] }; // Battery Monitor key <I6F> { [ XF86AudioMedia ] }; - key <I75> { [ XF86Launch0 ] }; // Info Center + key <I75> { [ XF86Launch0 ] }; // Info Center }; // Laptop/notebook Compaq (eg. Presario) Internet Keyboard @@ -707,8 +706,8 @@ xkb_symbols "dellusbmm" { // From Olivier Lahaye <olivier dot lahaye at motorola dot com> include "inet(media_nav_acpi_common)" key <I02> { [ XF86HomePage ] }; - key <K67> { [ XF86MyComputer ] }; - key <XFER> { [ XF86AudioMedia ] }; + key <K67> { [ XF86MyComputer ] }; + key <XFER> { [ XF86AudioMedia ] }; }; @@ -751,8 +750,7 @@ xkb_symbols "genius" { key <I32> { [ XF86WWW ] }; }; - -// GeniusComfy21e +// Genius Comfy 21e partial alphanumeric_keys xkb_symbols "geniuscomfy2" { // Describes the extra keys on a Genius Comfy KB-21e-Scroll @@ -761,6 +759,7 @@ xkb_symbols "geniuscomfy2" { key <I23> { [ Return ] }; }; + // Gyration partial alphanumeric_keys @@ -781,7 +780,7 @@ xkb_symbols "gyration" { // Hewlett-Packard // Hewlett-Packard Internet Keyboard -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "hpi6" { include "inet(media_nav_acpi_common)" key <I02> { [ XF86HomePage ] }; @@ -944,9 +943,8 @@ xkb_symbols "honeywell_euroboard" { // IBM - // IBM Rapid Access -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "rapidaccess" { key <I12> { [ XF86AudioMute ] }; key <I17> { [ XF86Launch2 ] }; @@ -965,7 +963,7 @@ xkb_symbols "rapidaccess" { }; // IBM Rapid Access II -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "rapidaccess2" { include "inet(acpi_common)" key <I12> { [ XF86AudioNext ] }; @@ -999,6 +997,7 @@ xkb_symbols "ibm_spacesaver" { }; }; + // Logitech // Logitech common definitions @@ -1041,8 +1040,8 @@ xkb_symbols "logitech_set3" { partial alphanumeric_keys xkb_symbols "logiaccess" { include "inet(logitech_base)" - key <FK13> { [ XF86MailForward ] }; - key <FK14> { [ XF86Send ] }; + key <FK13> { [ XF86MailForward ] }; + key <FK14> { [ XF86Send ] }; key <I11> { [ XF86Messenger ] }; key <I12> { [ XF86WebCam ] }; }; @@ -1069,10 +1068,9 @@ partial alphanumeric_keys xkb_symbols "logiex110" { include "inet(logitech_base)" key <I2F> { [ XF86Close ] }; // Close - // Extended function keys // In the Console before starting X -// Using setkeycodes e03b 212 e03c 213 e03d 214 e03e 215 e03f 216 e040 217 +// Using setkeycodes e03b 212 e03c 213 e03d 214 e03e 215 e03f 216 e040 217 // setkeycodes e041 218 e042 219 e043 220 e044 221 e057 222 e058 223 6d 206 // *=keys that are there but need different symbol names. key <I3B> { [ Help ] }; // F1 @@ -1163,7 +1161,7 @@ xkb_symbols "logiultraxc" { key <KPDC> { [ XF86AudioRaiseVolume ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "logidinovo" { include "inet(media_nav_common)" key <I02> { [ XF86HomePage ] }; @@ -1175,7 +1173,7 @@ xkb_symbols "logidinovo" { key <XFER> { [ XF86AudioMedia ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "logidinovoedge" { include "inet(media_acpi_common)" key <I02> { [ XF86HomePage ] }; @@ -1315,39 +1313,39 @@ xkb_symbols "microsoftinet" { key <I68> { [ XF86AudioStop ] }; }; -// Microsoft Natural Keyboard Pro USB -partial alphanumeric_keys - xkb_symbols "microsoftprousb" { +// Microsoft Natural Keyboard Pro USB +partial alphanumeric_keys +xkb_symbols "microsoftprousb" { include "inet(nav_common)" - key <FK16> { [ XF86Reload ] }; - key <I01> { [ XF86AudioMedia ] }; - key <I02> { [ XF86HomePage ] }; - key <I17> { [ XF86AudioStop ] }; - key <I1E> { [ XF86AudioRaiseVolume ] }; - key <I1F> { [ XF86AudioPlay, XF86AudioPause ] }; - key <I22> { [ XF86AudioNext ] }; - key <I24> { [ XF86AudioPrev ] }; - key <I25> { [ XF86AudioLowerVolume ] }; - key <I26> { [ XF86AudioMute ] }; - key <I63> { [ XF86Standby ] }; - // Internet Section -- Left Side - // Multimedia Section -- Right Side - // My Computer Section -- Far Right - // My computer maps to printscreen, so leaving commented out for now - // key <PRSC> { [ XF86MyComputer ] }; -}; - -// Microsoft Natural Keyboard Pro OEM -partial alphanumeric_keys -xkb_symbols "microsoftprooem" { + key <FK16> { [ XF86Reload ] }; + key <I01> { [ XF86AudioMedia ] }; + key <I02> { [ XF86HomePage ] }; + key <I17> { [ XF86AudioStop ] }; + key <I1E> { [ XF86AudioRaiseVolume ] }; + key <I1F> { [ XF86AudioPlay, XF86AudioPause ] }; + key <I22> { [ XF86AudioNext ] }; + key <I24> { [ XF86AudioPrev ] }; + key <I25> { [ XF86AudioLowerVolume ] }; + key <I26> { [ XF86AudioMute ] }; + key <I63> { [ XF86Standby ] }; +// Internet Section -- Left Side +// Multimedia Section -- Right Side +// My Computer Section -- Far Right +// My computer maps to printscreen, so leaving commented out for now +// key <PRSC> { [ XF86MyComputer ] }; +}; + +// Microsoft Natural Keyboard Pro OEM +partial alphanumeric_keys +xkb_symbols "microsoftprooem" { include "inet(media_nav_common)" - key <FK17> { [ XF86Search ] }; - key <I02> { [ XF86HomePage ] }; - key <I63> { [ XF86Standby ] }; - key <K67> { [ XF86MyComputer ] }; -// Internet Section -- Left Side -// Multimedia Section -- Right Side -// My Computer Section -- Far Right + key <FK17> { [ XF86Search ] }; + key <I02> { [ XF86HomePage ] }; + key <I63> { [ XF86Standby ] }; + key <K67> { [ XF86MyComputer ] }; +// Internet Section -- Left Side +// Multimedia Section -- Right Side +// My Computer Section -- Far Right }; // Microsoft Internet Keyboard Pro, Swedish @@ -1401,28 +1399,28 @@ xkb_symbols "microsoftoffice" { key <RCTL> { [ XF86Paste ] }; }; -// Microsoft Wireless Multimedia Keyboard 1.0A -partial alphanumeric_keys -xkb_symbols "microsoftmult" { +// Microsoft Wireless Multimedia Keyboard 1.0A +partial alphanumeric_keys +xkb_symbols "microsoftmult" { include "inet(media_nav_acpi_common)" - key <AE13> { [ XF86Messenger ] }; - key <FK14> { [ XF86New ] }; - key <FK15> { [ XF86Open ] }; - key <FK16> { [ XF86Close ] }; - key <FK17> { [ XF86Reply ] }; - key <I07> { [ Redo ] }; - key <I08> { [ Undo ] }; - key <I16> { [ XF86LogOff ] }; - key <I23> { [ XF86Spell ] }; - key <I3B> { [ Help ] }; - key <I3C> { [ XF86Music ] }; - key <I42> { [ XF86Forward ] }; - key <I43> { [ XF86Send ] }; - key <I57> { [ XF86Save ] }; - key <I58> { [ Print ] }; - key <I64> { [ XF86Pictures ] }; - key <I80> { [ XF86Documents ] }; -}; + key <AE13> { [ XF86Messenger ] }; + key <FK14> { [ XF86New ] }; + key <FK15> { [ XF86Open ] }; + key <FK16> { [ XF86Close ] }; + key <FK17> { [ XF86Reply ] }; + key <I07> { [ Redo ] }; + key <I08> { [ Undo ] }; + key <I16> { [ XF86LogOff ] }; + key <I23> { [ XF86Spell ] }; + key <I3B> { [ Help ] }; + key <I3C> { [ XF86Music ] }; + key <I42> { [ XF86Forward ] }; + key <I43> { [ XF86Send ] }; + key <I57> { [ XF86Save ] }; + key <I58> { [ Print ] }; + key <I64> { [ XF86Pictures ] }; + key <I80> { [ XF86Documents ] }; +}; // Oretec @@ -1646,6 +1644,7 @@ xkb_symbols "symplon" { key <UP> { [ XF86MenuPB ] }; }; + // Toshiba // Toshiba Satellite S3000 @@ -1663,6 +1662,7 @@ xkb_symbols "toshiba_s3000" { key <I76> { [ XF86AudioLowerVolume ] }; }; + // Trust // Trust Wireless Keyboard Classic @@ -1673,7 +1673,6 @@ xkb_symbols "trust" { key <I1E> { [ XF86Eject ] }; }; - // Trust Direct Access Keyboard partial alphanumeric_keys xkb_symbols "trustda" { @@ -1711,6 +1710,7 @@ xkb_symbols "yahoo" { key <I28> { [ XF86WWW ] }; }; + // Apple keyboards (macbooks, powerbooks, powermac G5, etc) partial alphanumeric_keys xkb_symbols "apple" { @@ -1751,14 +1751,15 @@ xkb_symbols "cymotionlinux" { key <XFER> { [ XF86AudioMedia ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "silvercrest" { include "inet(media_nav_acpi_common)" - key <I02> { [ XF86HomePage ] }; + key <I02> { [ XF86HomePage ] }; key <I21> { [ XF86Launch2 ] }; key <K67> { [ XF86Launch1 ] }; }; + // eMachines partial alphanumeric_keys @@ -1782,13 +1783,12 @@ xkb_symbols "emachines" { key <KPSU> { [ KP_Subtract ] }; }; + // BenQ +// BenQ X* (X730, X500, X800) // -// BenQ X* -// (X730, X500, X800) -// -// to make the FN_LOCK and CONFIG key work on the BenQ X500 , use ... +// To make the FN_LOCK and CONFIG key work on the BenQ X500 , use: // setkeycodes e074 130 # KEY_PROPS from /usr/include/linux/input.h // setkeycodes e075 171 # KEY_CONFIG from /usr/include/linux/input.h partial alphanumeric_keys @@ -1800,15 +1800,17 @@ xkb_symbols "benqx" { key <I31> { [ XF86Calendar ] }; }; + // Intel // Intel Classmate partial alphanumeric_keys xkb_symbols "classmate" { - key <I2E> { [ XF86AudioLowerVolume ] }; + key <I2E> { [ XF86AudioLowerVolume ] }; key <I30> { [ XF86AudioRaiseVolume ] }; }; + // Unitek partial alphanumeric_keys @@ -1822,6 +1824,7 @@ xkb_symbols "unitekkb1925" { key <I1A> { [ XF86Reload ] }; }; + // Creative // Creative Desktop Wireless 7000 @@ -1831,6 +1834,7 @@ xkb_symbols "creativedw7000" { key <I66> { [ XF86Pictures ] }; }; + // Compal // Compal FL90 @@ -1846,13 +1850,13 @@ xkb_symbols "pc105" { include "inet(media_nav_acpi_common)" }; + // HTC Dream partial alphanumeric_keys xkb_symbols "htcdream" { key <BKSP> { [ BackSpace ] }; key <RTRN> { [ Return ] }; - //first row key <AE01> { [ 1, 1, exclam, exclam ] }; key <AE02> { [ 2, 2, at, at ] }; key <AE03> { [ 3, 3, numbersign, numbersign ] }; @@ -1864,12 +1868,10 @@ xkb_symbols "htcdream" { key <AE09> { [ 9, 9, parenleft, parenleft ] }; key <AE10> { [ 0, 0, parenright, parenright ] }; - //fifth row key <LFSH> { [ Shift_L ] }; key <SPCE> { [ space ] }; key <AB09> { [ period, period, slash, slash ] }; key <RTSH> { [ Shift_R ] }; - //modifiers modifier_map Shift { <LFSH>, <RTSH> }; }; diff --git a/xorg-server/xkeyboard-config/symbols/ir b/xorg-server/xkeyboard-config/symbols/ir index d0a11b749..983bf60d9 100644 --- a/xorg-server/xkeyboard-config/symbols/ir +++ b/xorg-server/xkeyboard-config/symbols/ir @@ -62,7 +62,7 @@ xkb_symbols "pes_part_basic" { key <AD09> { [ Arabic_khah, bracketright, 0x100202e ] }; key <AD10> { [ Arabic_hah, bracketleft, 0x100202c ] }; key <AD11> { [ Arabic_jeem, braceright, 0x100202a ] }; - key <AD12> { [ Arabic_tcheh, braceleft, 0x100202b ] }; + key <AD12> { [ Arabic_tcheh, braceleft, 0x100202b ] }; key <AC01> { [ Arabic_sheen, Arabic_hamzaonwaw, VoidSymbol ] }; key <AC02> { [ Arabic_seen, Arabic_hamzaonyeh, VoidSymbol ] }; @@ -73,17 +73,15 @@ xkb_symbols "pes_part_basic" { key <AC07> { [ Arabic_teh, Arabic_tehmarbuta, VoidSymbol ] }; key <AC08> { [ Arabic_noon, guillemotright, 0x100fd3e ] }; key <AC09> { [ Arabic_meem, guillemotleft, 0x100fd3f ] }; - key <AC10> { [ Arabic_keheh, colon, semicolon ] }; + key <AC10> { [ Arabic_keheh, colon, semicolon ] }; key <AC11> { [ Arabic_gaf, Arabic_semicolon, quotedbl ] }; key <AB01> { [ Arabic_zah, Arabic_kaf, VoidSymbol ] }; key <AB02> { [ Arabic_tah, 0x1000653, VoidSymbol ] }; key <AB03> { [ Arabic_zain, Arabic_jeh, VoidSymbol ] }; - key <AB04> { [ Arabic_ra, Arabic_superscript_alef -, 0x1000656 ] }; + key <AB04> { [ Arabic_ra, Arabic_superscript_alef,0x1000656 ] }; key <AB05> { [ Arabic_thal, 0x100200c, 0x100200d ] }; - key <AB06> { [ Arabic_dal, Arabic_hamza_above -, Arabic_hamza_below ] }; + key <AB06> { [ Arabic_dal, Arabic_hamza_above, Arabic_hamza_below ] }; key <AB07> { [ Arabic_peh, Arabic_hamza, ellipsis ] }; key <AB08> { [ Arabic_waw, greater, comma ] }; key <AB09> { [ period, less, apostrophe ] }; @@ -169,7 +167,7 @@ xkb_symbols "ku_alt" { // // Copyright (C) 2006 Erdal Ronahî, published under the GPL v2 // -// Special copyright note: author explicitly permitted to license this +// Special copyright note: author explicitly permitted to license this // layout under MIT/X11 license, for details see // https://bugs.freedesktop.org/show_bug.cgi?id=9541 // @@ -256,51 +254,51 @@ xkb_symbols "ave" { name[Group1] = "Avestan"; - key <AB01> { [ U10B30, U10B32 ] }; // 𐬰 𐬲 - key <AB02> { [ U10B11, U10B12 ] }; // 𐬑 𐬒 - key <AB03> { [ U10B17, UE102 ] }; // 𐬗 - key <AB04> { [ U10B2C, U10B13 ] }; // 𐬬 𐬓 - key <AB05> { [ U10B20, U10B21 ] }; // 𐬠 𐬡 - key <AB06> { [ U10B25, U10B27 ] }; // 𐬥 𐬧 - key <AB07> { [ U10B28, U10B29 ] }; // 𐬨 𐬩 - key <AB08> { [ U10B3C, U10B39 ] }; // 𐬼 𐬹 - key <AB09> { [ U10B3E, U10B3D ] }; // 𐬾 𐬽 - key <AB10> { [ U10B3F, periodcentered ] }; // 𐬿 · - - key <AC01> { [ U10B00, U10B01 ] }; // 𐬀 𐬁 - key <AC02> { [ U10B2F, U10B31 ] }; // 𐬯 𐬱 - key <AC03> { [ U10B1B, U10B1C ] }; // 𐬛 𐬜 - key <AC04> { [ U10B1F, U10B16 ] }; // 𐬟 𐬖 - key <AC05> { [ U10B14, U10B15 ] }; // 𐬔 𐬕 - key <AC06> { [ U10B35, UE100 ] }; // 𐬵 - key <AC07> { [ U10B18, U10B24 ] }; // 𐬘 𐬤 - key <AC08> { [ U10B10, UE101 ] }; // 𐬐 - key <AC09> { [ U10B2E, UE103 ] }; // 𐬮 - key <AC10> { [ U10B3B, U10B3A ] }; // 𐬻 𐬺 - key <AC11> { [ U10B1D ] }; // 𐬝 - - key <AD01> { [ U10B22, U10B23 ] }; // 𐬢 𐬣 - key <AD02> { [ U10B33, U10B34 ] }; // 𐬳 𐬴 - key <AD03> { [ U10B08, U10B09 ] }; // 𐬈 𐬉 - key <AD04> { [ U10B2D, U10B26 ] }; // 𐬭 𐬦 - key <AD05> { [ U10B19, U10B1A ] }; // 𐬙 𐬚 - key <AD06> { [ U10B2B, U10B2A ] }; // 𐬫 𐬪 - key <AD07> { [ U10B0E, U10B0F ] }; // 𐬎 𐬏 - key <AD08> { [ U10B0C, U10B0D ] }; // 𐬌 𐬍 + key <AB01> { [ U10B30, U10B32 ] }; // 𐬰 𐬲 + key <AB02> { [ U10B11, U10B12 ] }; // 𐬑 𐬒 + key <AB03> { [ U10B17, UE102 ] }; // 𐬗 + key <AB04> { [ U10B2C, U10B13 ] }; // 𐬬 𐬓 + key <AB05> { [ U10B20, U10B21 ] }; // 𐬠 𐬡 + key <AB06> { [ U10B25, U10B27 ] }; // 𐬥 𐬧 + key <AB07> { [ U10B28, U10B29 ] }; // 𐬨 𐬩 + key <AB08> { [ U10B3C, U10B39 ] }; // 𐬼 𐬹 + key <AB09> { [ U10B3E, U10B3D ] }; // 𐬾 𐬽 + key <AB10> { [ U10B3F, periodcentered ] }; // 𐬿 · + + key <AC01> { [ U10B00, U10B01 ] }; // 𐬀 𐬁 + key <AC02> { [ U10B2F, U10B31 ] }; // 𐬯 𐬱 + key <AC03> { [ U10B1B, U10B1C ] }; // 𐬛 𐬜 + key <AC04> { [ U10B1F, U10B16 ] }; // 𐬟 𐬖 + key <AC05> { [ U10B14, U10B15 ] }; // 𐬔 𐬕 + key <AC06> { [ U10B35, UE100 ] }; // 𐬵 + key <AC07> { [ U10B18, U10B24 ] }; // 𐬘 𐬤 + key <AC08> { [ U10B10, UE101 ] }; // 𐬐 + key <AC09> { [ U10B2E, UE103 ] }; // 𐬮 + key <AC10> { [ U10B3B, U10B3A ] }; // 𐬻 𐬺 + key <AC11> { [ U10B1D ] }; // 𐬝 + + key <AD01> { [ U10B22, U10B23 ] }; // 𐬢 𐬣 + key <AD02> { [ U10B33, U10B34 ] }; // 𐬳 𐬴 + key <AD03> { [ U10B08, U10B09 ] }; // 𐬈 𐬉 + key <AD04> { [ U10B2D, U10B26 ] }; // 𐬭 𐬦 + key <AD05> { [ U10B19, U10B1A ] }; // 𐬙 𐬚 + key <AD06> { [ U10B2B, U10B2A ] }; // 𐬫 𐬪 + key <AD07> { [ U10B0E, U10B0F ] }; // 𐬎 𐬏 + key <AD08> { [ U10B0C, U10B0D ] }; // 𐬌 𐬍 key <AD09> { [ U10B0A, U10B0B ] }; // 𐬊 𐬋 - key <AD10> { [ U10B1E ] }; // 𐬞 - key <AD11> { [ U10B06, U10B07 ] }; // 𐬆 𐬇 - key <AD12> { [ U10B02, U10B03 ] }; // 𐬂 𐬃 - - key <AE01> { [ U10B78 ] }; // 𐭸 - key <AE02> { [ U10B79 ] }; // 𐭹 - key <AE03> { [ U10B7A ] }; // 𐭺 - key <AE04> { [ U10B7B ] }; // 𐭻 - key <AE05> { [ U10B7C ] }; // 𐭼 - key <AE06> { [ U10B7D ] }; // 𐭽 - key <AE07> { [ U10B7E ] }; // 𐭾 - key <AE08> { [ U10B7F ] }; // 𐭿 - - key <BKSL> { [ U10B04, U10B05 ] }; // 𐬄 𐬅 - key <LSGT> { [ U10B04, U10B05 ] }; // 𐬄 𐬅 + key <AD10> { [ U10B1E ] }; // 𐬞 + key <AD11> { [ U10B06, U10B07 ] }; // 𐬆 𐬇 + key <AD12> { [ U10B02, U10B03 ] }; // 𐬂 𐬃 + + key <AE01> { [ U10B78 ] }; // 𐭸 + key <AE02> { [ U10B79 ] }; // 𐭹 + key <AE03> { [ U10B7A ] }; // 𐭺 + key <AE04> { [ U10B7B ] }; // 𐭻 + key <AE05> { [ U10B7C ] }; // 𐭼 + key <AE06> { [ U10B7D ] }; // 𐭽 + key <AE07> { [ U10B7E ] }; // 𐭾 + key <AE08> { [ U10B7F ] }; // 𐭿 + + key <BKSL> { [ U10B04, U10B05 ] }; // 𐬄 𐬅 + key <LSGT> { [ U10B04, U10B05 ] }; // 𐬄 𐬅 }; diff --git a/xorg-server/xkeyboard-config/symbols/is b/xorg-server/xkeyboard-config/symbols/is index 5137e2d71..34d6bed33 100644 --- a/xorg-server/xkeyboard-config/symbols/is +++ b/xorg-server/xkeyboard-config/symbols/is @@ -125,7 +125,7 @@ xkb_symbols "mac" { key <AE11> { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; key <AE12> { [ minus, underscore, endash, emdash ] }; - + //-- Row 4 (D) --// key <AD01> { [ q, Q, paragraph, VoidSymbol ] }; key <AD02> { [ w, W, U2211, VoidSymbol ] }; @@ -139,8 +139,8 @@ xkb_symbols "mac" { key <AD10> { [ p, P, Greek_pi, Greek_PI ] }; key <AD11> { [ eth, Eth, U201e, U201c ] }; key <AD12> { [ apostrophe, question, questiondown, U00B7 ] }; - - + + //-- Row 3 (C) --// key <AC01> { [ a, A, aring, Aring ] }; key <AC02> { [ s, S, ssharp, abovedot ] }; @@ -154,8 +154,8 @@ xkb_symbols "mac" { key <AC10> { [ ae, AE, oe, OE ] }; key <AC11> { [ dead_acute, dead_diaeresis, U201A, U2018 ] }; key <BKSL> { [ plus, asterisk, U2022, plusminus ] }; - - + + //-- Row 2 (B) --// key <LSGT> { [ less, greater, section, UF8FF ] }; key <AB01> { [ z, Z, U3A9, VoidSymbol ] }; @@ -191,7 +191,7 @@ xkb_symbols "mac" { // -- Ævar Arnfjörð Bjarmason <avarab@gmail.com> // Icelandic Dvorak -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { name[Group1]= "Icelandic (Dvorak)"; diff --git a/xorg-server/xkeyboard-config/symbols/it b/xorg-server/xkeyboard-config/symbols/it index 3e402c98a..8a66a306a 100644 --- a/xorg-server/xkeyboard-config/symbols/it +++ b/xorg-server/xkeyboard-config/symbols/it @@ -33,6 +33,8 @@ xkb_symbols "basic" { key <LSGT> { [ less, greater,guillemotleft,guillemotright] }; + include "kpdl(comma)" + include "level3(ralt_switch)" }; @@ -175,7 +177,7 @@ xkb_symbols "us" { include "us(euro)" name[Group1]= "Italian (US keyboard with Italian letters)"; - + key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] }; key <AE01> { [ 1, exclam, onesuperior ] }; key <AE02> { [ 2, at, twosuperior ] }; diff --git a/xorg-server/xkeyboard-config/symbols/jp b/xorg-server/xkeyboard-config/symbols/jp index 189228e57..52f574623 100644 --- a/xorg-server/xkeyboard-config/symbols/jp +++ b/xorg-server/xkeyboard-config/symbols/jp @@ -101,6 +101,14 @@ xkb_symbols "common" { }; partial alphanumeric_keys +xkb_symbols "henkan" { + key <XFER> { + type[Group1]="PC_ALT_LEVEL2", + symbols[Group1]= [ Henkan, Mode_switch ] + }; +}; + +partial alphanumeric_keys xkb_symbols "OADG109A" { include "jp(common)" diff --git a/xorg-server/xkeyboard-config/symbols/ke b/xorg-server/xkeyboard-config/symbols/ke index 74e8c2dd2..d58796d76 100644 --- a/xorg-server/xkeyboard-config/symbols/ke +++ b/xorg-server/xkeyboard-config/symbols/ke @@ -9,7 +9,7 @@ xkb_symbols "swa" { include "us" name[Group1]= "Swahili (Kenya)"; - + key <AC10> { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW key <AC11> { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS key <TLDE> { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE @@ -18,17 +18,17 @@ xkb_symbols "swa" { key <AE09> { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE key <AE10> { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON key <AE11> { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW - + include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "kik" { include "us" name[Group1]= "Kikuyu"; - + key <AC10> { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW key <AC11> { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS key <TLDE> { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE @@ -37,6 +37,6 @@ xkb_symbols "kik" { key <AE09> { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE key <AE10> { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON key <AE11> { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW - + include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index bc47a90e9..9b49a5773 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -349,7 +349,7 @@ xkb_symbols "legacynumber" { key <KP7> { [ KP_Home, KP_7 ] }; // <home> 7 key <KP8> { [ KP_Up, KP_8 ] }; // <up> 8 key <KP9> { [ KP_Prior, KP_9 ] }; // <prior> 9 - + key <KP4> { [ KP_Left, KP_4 ] }; // <left> 4 key <KP5> { [ KP_Begin, KP_5 ] }; // <begin> 5 key <KP6> { [ KP_Right, KP_6 ] }; // <right> 6 @@ -391,7 +391,7 @@ xkb_symbols "legacynumber_wang" { key <KP7> { [ KP_Home, KP_7, less ] }; // <home> 7 < key <KP8> { [ KP_Up, KP_8, greater ] }; // <up> 8 > key <KP9> { [ KP_Prior, KP_9, asciicircum ] }; // <prior> 9 ^ - + key <KP4> { [ KP_Left, KP_4, bracketleft ] }; // <left> 4 [ key <KP5> { [ KP_Begin, KP_5, bracketright ] }; // <begin> 5 ] key <KP6> { [ KP_Right, KP_6, dollar ] }; // <right> 6 $ @@ -431,7 +431,7 @@ xkb_symbols "ossnumber" { key <KP7> { [ KP_Home, KP_7, 0x1002196, 0x10021D6 ] }; // <home> 7 ↖ ⇖ key <KP8> { [ KP_Up, KP_8, 0x1002191, 0x10021D1 ] }; // <up> 8 ↑ ⇑ key <KP9> { [ KP_Prior, KP_9, 0x1002197, 0x10021D7 ] }; // <prior> 9 ↗ ⇗ - + key <KP4> { [ KP_Left, KP_4, 0x1002190, 0x10021D0 ] }; // <left> 4 ← ⇐ key <KP5> { [ KP_Begin, KP_5, 0x1002194, 0x10021D4 ] }; // <begin> 5 ↔ ⇔ key <KP6> { [ KP_Right, KP_6, 0x1002192, 0x10021D2 ] }; // <right> 6 → ⇒ @@ -471,7 +471,7 @@ xkb_symbols "ossnumber_wang" { key <KP7> { [ KP_Home, KP_7, less, 0x1002196 ] }; // <home> 7 < ↖ key <KP8> { [ KP_Up, KP_8, greater, 0x1002191 ] }; // <up> 8 > ↑ key <KP9> { [ KP_Prior, KP_9, asciicircum, 0x1002197 ] }; // <prior> 9 ^ ↗ - + key <KP4> { [ KP_Left, KP_4, bracketleft, 0x1002190 ] }; // <left> 4 [ ← key <KP5> { [ KP_Begin, KP_5, bracketright, 0x1002194 ] }; // <begin> 5 ] ↔ key <KP6> { [ KP_Right, KP_6, dollar, 0x1002192 ] }; // <right> 6 $ → @@ -532,7 +532,7 @@ xkb_symbols "hex" { key <KP7> { [ NoSymbol, NoSymbol, a ] }; key <KP8> { [ NoSymbol, NoSymbol, b ] }; key <KP9> { [ NoSymbol, NoSymbol, c ] }; - + // home row key <KP4> { [ NoSymbol, NoSymbol, d ] }; key <KP5> { [ NoSymbol, NoSymbol, e ] }; diff --git a/xorg-server/xkeyboard-config/symbols/kh b/xorg-server/xkeyboard-config/symbols/kh index ee58abf2f..5c1723324 100644 --- a/xorg-server/xkeyboard-config/symbols/kh +++ b/xorg-server/xkeyboard-config/symbols/kh @@ -27,7 +27,7 @@ default partial alphanumeric_keys xkb_symbols "basic" { name[Group1]= "Khmer (Cambodia)"; - + // there are four levels defined: // // normal shift right-alt right-alt + shift @@ -93,13 +93,13 @@ xkb_symbols "basic" { // third level with right-Alt include "level3(ralt_switch)" - + }; partial alphanumeric_keys xkb_symbols "olpc" { include "kh(basic)" - + // Contact Walter@laptop.org key <AC10> { [ 0x10017be, 0x10017c8, 0x10017d6, 0x10019f5 ] }; diff --git a/xorg-server/xkeyboard-config/symbols/kr b/xorg-server/xkeyboard-config/symbols/kr index ced9a0720..84c0effca 100644 --- a/xorg-server/xkeyboard-config/symbols/kr +++ b/xorg-server/xkeyboard-config/symbols/kr @@ -16,13 +16,13 @@ xkb_symbols "kr104" { partial hidden function_keys xkb_symbols "koreankeys" { key <K71> { [ Hangul ] }; - key <K72> { [ Hangul_Hanja ] }; + key <K72> { [ Hangul_Hanja ] }; }; partial hidden function_keys xkb_symbols "koreankeys_raltctl" { key <RALT> { [ Hangul ] }; - key <RCTL> { [ Hangul_Hanja ] }; + key <RCTL> { [ Hangul_Hanja ] }; }; // EXTRAS: diff --git a/xorg-server/xkeyboard-config/symbols/lt b/xorg-server/xkeyboard-config/symbols/lt index 8b6b80e5f..ee6b73708 100644 --- a/xorg-server/xkeyboard-config/symbols/lt +++ b/xorg-server/xkeyboard-config/symbols/lt @@ -68,7 +68,7 @@ xkb_symbols "us" { // // Made by Gediminas Paulauskas <menesis@delfi.lt> // Minor modifications by Ričardas Čepas and Rimas Kudelis - + partial alphanumeric_keys modifier_keys xkb_symbols "std" { @@ -121,7 +121,7 @@ xkb_symbols "std" { // // Made by Piter PUNK <piterpk@terra.com.br> // Minor modifications and cleanup by Rimas Kudelis, 2010 - + partial alphanumeric_keys modifier_keys xkb_symbols "ibm" { @@ -169,12 +169,12 @@ xkb_symbols "ibm" { partial alphanumeric_keys modifier_keys xkb_symbols "lekp" { - + include "capslock(backspace)" include "level3(ralt_switch)" - + name[Group1]="Lithuanian (LEKP)"; - + key <TLDE> {[ grave, asciitilde, acute ]}; key <AE01> {[ slash, numbersign, bar ]}; key <AE02> {[ backslash, at, section ]}; diff --git a/xorg-server/xkeyboard-config/symbols/mao b/xorg-server/xkeyboard-config/symbols/mao index bf3482679..cc73d25f3 100644 --- a/xorg-server/xkeyboard-config/symbols/mao +++ b/xorg-server/xkeyboard-config/symbols/mao @@ -2,7 +2,7 @@ default partial alphanumeric_keys xkb_symbols "basic" { // Adds the macrons needed for the Maori language to - // a simple us keyboard layout. + // a simple US keyboard layout. include "latin" @@ -16,6 +16,7 @@ xkb_symbols "basic" { key <AD07> { [ u, U, umacron, Umacron ] }; key <RALT> { type[Group1]="TWO_LEVEL", - [ ISO_Level3_Shift, Multi_key ] }; + [ ISO_Level3_Shift, Multi_key ] }; + modifier_map Mod5 { <RALT> }; }; diff --git a/xorg-server/xkeyboard-config/symbols/md b/xorg-server/xkeyboard-config/symbols/md index 1664da9cd..cd3430beb 100644 --- a/xorg-server/xkeyboard-config/symbols/md +++ b/xorg-server/xkeyboard-config/symbols/md @@ -29,11 +29,11 @@ xkb_symbols "basic" { partial alphanumeric_keys xkb_symbols "gag" { - + include "us(basic)" name[Group1]="Moldavian (Gagauz)"; - + key <TLDE> { [ grave, asciitilde ] }; key <AE01> { [ 1, exclam ] }; key <AE02> { [ 2, quotedbl, at ] }; @@ -47,7 +47,7 @@ xkb_symbols "gag" { key <AE10> { [ 0, parenright ] }; key <AE11> { [ minus, underscore ] }; key <AE12> { [ equal, plus ] }; - + key <AD01> { [ tcedilla, Tcedilla, q, Q ] }; key <AD02> { [ ecircumflex, Ecircumflex, w, W ] }; key <AD03> { [ e, E ] }; @@ -60,7 +60,7 @@ xkb_symbols "gag" { key <AD10> { [ p, P ] }; key <AD11> { [ odiaeresis, Odiaeresis, bracketleft, braceleft ] }; key <AD12> { [ udiaeresis, Udiaeresis, bracketright, braceright ] }; - + key <AC01> { [ a, A ] }; key <AC02> { [ s, S ] }; key <AC03> { [ d, D ] }; @@ -72,7 +72,7 @@ xkb_symbols "gag" { key <AC09> { [ l, L ] }; key <AC10> { [ scedilla, Scedilla ] }; key <AC11> { [ idotless, I, apostrophe ] }; - + key <AB01> { [ z, Z ] }; key <AB02> { [ ccedilla, Ccedilla, x, X ] }; key <AB03> { [ c, Ccedilla ] }; @@ -83,7 +83,7 @@ xkb_symbols "gag" { key <AB08> { [ adiaeresis, Adiaeresis ] }; key <AB09> { [ comma, less ] }; key <AB10> { [ period, greater, slash ] }; - + key <BKSL> { [ backslash, bar ] }; include "level3(ralt_switch)" diff --git a/xorg-server/xkeyboard-config/symbols/mk b/xorg-server/xkeyboard-config/symbols/mk index 40075848a..0903d6617 100644 --- a/xorg-server/xkeyboard-config/symbols/mk +++ b/xorg-server/xkeyboard-config/symbols/mk @@ -53,7 +53,7 @@ xkb_symbols "basic" { key <AB08> { [ comma, semicolon ] }; key <AB09> { [ period, colon ] }; key <AB10> { [ slash, question ] }; - + include "kpdl(comma)" }; diff --git a/xorg-server/xkeyboard-config/symbols/mv b/xorg-server/xkeyboard-config/symbols/mv index cb05b8b3c..e6836f3bb 100644 --- a/xorg-server/xkeyboard-config/symbols/mv +++ b/xorg-server/xkeyboard-config/symbols/mv @@ -18,7 +18,7 @@ xkb_symbols "basic" { key <AE10> { [ 0, parenright ] }; key <AE11> { [ minus, underscore ] }; key <AE12> { [ equal, plus ] }; - + key <AD01> { [ 0x10007B0, 0x10007A4 ] }; key <AD02> { [ 0x1000787, 0x10007A2 ] }; key <AD03> { [ 0x10007AC, 0x10007AD ] }; diff --git a/xorg-server/xkeyboard-config/symbols/ng b/xorg-server/xkeyboard-config/symbols/ng index ea1fca278..ccd9d81ce 100644 --- a/xorg-server/xkeyboard-config/symbols/ng +++ b/xorg-server/xkeyboard-config/symbols/ng @@ -15,8 +15,8 @@ xkb_symbols "yoruba" { name[Group1]= "Yoruba"; key <AD01> { [ 0x01001EB9, 0x01001EB8, q, Q ] }; - key <AB02> { [ 0x01001ECD, 0x01001ECC, x, X ] }; - key <AB04> { [ 0x01001E63, 0x01001E62, v, V ] }; + key <AB02> { [ 0x01001ECD, 0x01001ECC, x, X ] }; + key <AB04> { [ 0x01001E63, 0x01001E62, v, V ] }; }; partial alphanumeric_keys @@ -26,7 +26,7 @@ xkb_symbols "igbo" { name[Group1]= "Igbo"; key <AD01> { [ 0x01001ECB, 0x01001ECA, q, Q ] }; - key <AB02> { [ 0x01001E45, 0x01001E44, x, X ] }; + key <AB02> { [ 0x01001E45, 0x01001E44, x, X ] }; key <AC10> { [ 0x01001EE5, 0x01001EE4, semicolon, colon ] }; key <AD11> { [ 0x01001ECD, 0x01001ECC, bracketleft, braceleft ] }; }; diff --git a/xorg-server/xkeyboard-config/symbols/nl b/xorg-server/xkeyboard-config/symbols/nl index ff60dbba7..1dde405f8 100644 --- a/xorg-server/xkeyboard-config/symbols/nl +++ b/xorg-server/xkeyboard-config/symbols/nl @@ -49,6 +49,8 @@ xkb_symbols "basic" { key <LSGT> { [bracketright, bracketleft, bar, brokenbar ] }; + include "kpdl(comma)" + include "level3(ralt_switch)" }; @@ -132,7 +134,7 @@ xkb_symbols "sundeadkeys" { }; // Copied from macintosh_vndr/nl -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { include "latin" diff --git a/xorg-server/xkeyboard-config/symbols/no b/xorg-server/xkeyboard-config/symbols/no index 5bba1959e..5609de06e 100644 --- a/xorg-server/xkeyboard-config/symbols/no +++ b/xorg-server/xkeyboard-config/symbols/no @@ -53,7 +53,7 @@ xkb_symbols "nodeadkeys" { }; // Norwegian Dvorak -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { include "us(dvorak)" @@ -186,7 +186,7 @@ xkb_symbols "smi_nodeadkeys" { }; // Copied from macintosh_vndr/no -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { // Describes the differences between a very simple en_US @@ -211,7 +211,7 @@ xkb_symbols "mac" { key <BKSL> { [ at, asterisk ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac_nodeadkeys" { // Modifies the basic Norwegian layout to eliminate dead keys @@ -222,7 +222,7 @@ xkb_symbols "mac_nodeadkeys" { key <AD12> { [ diaeresis, asciicircum, asciitilde, macron ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "colemak" { // Colemak layout - http://colemak.com/ diff --git a/xorg-server/xkeyboard-config/symbols/pk b/xorg-server/xkeyboard-config/symbols/pk index b85d887a3..8ab26ed5e 100644 --- a/xorg-server/xkeyboard-config/symbols/pk +++ b/xorg-server/xkeyboard-config/symbols/pk @@ -86,7 +86,7 @@ xkb_symbols "urd-crulp" { key <AE10> { [ 0x10006F0 , 0x1000030, 0x1000028 ] }; key <AE11> { [ 0x100002D , 0x100005F ] }; - key <AE12> { [ 0x100003D , 0x100002B ] }; + key <AE12> { [ 0x100003D , 0x100002B ] }; key <AD01> { [ 0x1000642 , 0x1000652 ] }; key <AD02> { [ 0x1000648 , 0x1000651, 0x1000602 ] }; key <AD03> { [ 0x1000639 , 0x1000670, 0x1000656 ] }; diff --git a/xorg-server/xkeyboard-config/symbols/pl b/xorg-server/xkeyboard-config/symbols/pl index a448e2baa..a468e790d 100644 --- a/xorg-server/xkeyboard-config/symbols/pl +++ b/xorg-server/xkeyboard-config/symbols/pl @@ -62,6 +62,7 @@ xkb_symbols "legacy" { name[Group1]="Polish (legacy)"; key <AD03> { [ e, E, eogonek, Eogonek ] }; + key <AD07> { [ u, U, EuroSign, cent ] }; key <AD09> { [ o, O, oacute, Oacute ] }; key <AC01> { [ a, A, aogonek, Aogonek ] }; @@ -131,10 +132,10 @@ xkb_symbols "qwertz" { // "1/!" key. If you do not use Polish quotes at all, you can use "pl_basic" map. // Basic Polish keymap (without Polish quotes) -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { include "us(dvorak)" - + name[Group1] = "Polish (Dvorak)"; key <AD08> { [ c, C, cacute, Cacute ] }; @@ -146,7 +147,7 @@ xkb_symbols "dvorak" { key <AC10> { [ s, S, sacute, Sacute ] }; key <AB09> { [ v, V, zacute, Zacute ] }; key <AB10> { [ z, Z, zabovedot, Zabovedot ] }; - + include "kpdl(comma)" include "level3(ralt_switch)" @@ -156,7 +157,7 @@ xkb_symbols "dvorak" { partial alphanumeric_keys xkb_symbols "dvorak_quotes" { include "pl(dvorak)" - + name[Group1] = "Polish (Dvorak, Polish quotes on quotemark key)"; key <AD01> { [ apostrophe, quotedbl, doublelowquotemark, rightdoublequotemark ] }; @@ -482,7 +483,7 @@ xkb_symbols "colemak" { key <AB02> { [ x, X, zacute, Zacute ] }; key <AB03> { [ c, C, cacute, Cacute ] }; key <AC01> { [ a, A, aogonek, Aogonek ] }; - key <AC03> { [ s, S, sacute, Sacute ] }; + key <AC03> { [ s, S, sacute, Sacute ] }; key <AC07> { [ n, N, nacute, Nacute ] }; key <AC08> { [ e, E, eogonek, Eogonek ] }; key <AC10> { [ o, O, oacute, Oacute ] }; diff --git a/xorg-server/xkeyboard-config/symbols/ru b/xorg-server/xkeyboard-config/symbols/ru index c48637637..043e011e6 100644 --- a/xorg-server/xkeyboard-config/symbols/ru +++ b/xorg-server/xkeyboard-config/symbols/ru @@ -22,7 +22,7 @@ xkb_symbols "winkeys" { key <BKSL> { [ backslash, slash ] }; }; -partial hidden alphanumeric_keys +partial hidden alphanumeric_keys xkb_symbols "common" { key <AE01> { [ 1, exclam ] }; @@ -179,7 +179,7 @@ xkb_symbols "phonetic" { key <LatA> { [ Cyrillic_a, Cyrillic_A ] }; key <LatW> { [ Cyrillic_ve, Cyrillic_VE ] }; key <LatC> { [ Cyrillic_tse, Cyrillic_TSE ] }; - key <LatX> { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key <LatX> { [ Cyrillic_ha, Cyrillic_HA ] }; key <LatD> { [ Cyrillic_de, Cyrillic_DE ] }; key <LatE> { [ Cyrillic_ie, Cyrillic_IE ] }; key <LatV> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; @@ -188,7 +188,7 @@ xkb_symbols "phonetic" { key <LatR> { [ Cyrillic_er, Cyrillic_ER ] }; key <LatN> { [ Cyrillic_en, Cyrillic_EN ] }; key <LatB> { [ Cyrillic_be, Cyrillic_BE ] }; - key <LatH> { [ Cyrillic_ha, Cyrillic_HA ] }; + key <LatH> { [ Cyrillic_che, Cyrillic_CHE ] }; key <LatG> { [ Cyrillic_ghe, Cyrillic_GHE ] }; key <LatY> { [ Cyrillic_yeru, Cyrillic_YERU ] }; key <LatM> { [ Cyrillic_em, Cyrillic_EM ] }; @@ -201,7 +201,7 @@ xkb_symbols "phonetic" { key <LatP> { [ Cyrillic_pe, Cyrillic_PE ] }; key <AD11> { [ Cyrillic_sha, Cyrillic_SHA ] }; - key <AE12> { [ Cyrillic_che, Cyrillic_CHE ] }; + key <AE12> { [ Cyrillic_softsign, Cyrillic_softsign ] }; key <AD12> { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; key <BKSL> { [ Cyrillic_e, Cyrillic_E ] }; }; @@ -242,7 +242,7 @@ xkb_symbols "tt" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "os_legacy" { include "ru(common)" @@ -253,7 +253,7 @@ xkb_symbols "os_legacy" { key <AC11> { [ 0x010004D5, 0x010004D4 ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "os_winkeys" { include "ru(winkeys)" @@ -336,7 +336,7 @@ xkb_symbols "cv_latin" { // Vlad Shakhov <lumpen.intellectual@gmail.com> // Last Changes 2007/10/23 by Vlad Shakhov <lumpen.intellectual@gmail.com> -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "kom" { include "ru(winkeys)" @@ -348,7 +348,7 @@ xkb_symbols "kom" { // cyrilllic o with diaeresis key <AC07> { [ Cyrillic_o, Cyrillic_O, U04E7, U04E6 ] }; - + // hard I as additional key for soft Cyrillic_I key <AB05> { [ Cyrillic_i, Cyrillic_I, Ukrainian_i, Ukrainian_I ] }; @@ -404,7 +404,7 @@ xkb_symbols "sah" { //based on the Kalmyk language layout: http://soft.oyrat.org/ //Nikolay Korneev <halmg@oyrat.org> //Toli Miron <mirontoli@gmail.com> - + partial alphanumeric_keys xkb_symbols "xal" { include "ru(winkeys)" @@ -416,24 +416,24 @@ xkb_symbols "xal" { key <AE01> { [ question, exclam, 1 ] }; key <AE02> { [ numerosign, quotedbl, 2 ] }; key <AE03> { [ Cyrillic_u_straight, Cyrillic_U_straight, 3 ] }; - key <AE04> { [ Cyrillic_schwa, Cyrillic_SCHWA, 4 ] }; + key <AE04> { [ Cyrillic_schwa, Cyrillic_SCHWA, 4 ] }; key <AE05> { [ asterisk, percent, 5 ] }; key <AE06> { [ Cyrillic_en_descender, Cyrillic_EN_descender, 6 ] }; - key <AE07> { [ Cyrillic_o_bar, Cyrillic_O_bar, 7 ] }; - key <AE08> { [ Cyrillic_shha, Cyrillic_SHHA, 8 ] }; + key <AE07> { [ Cyrillic_o_bar, Cyrillic_O_bar, 7 ] }; + key <AE08> { [ Cyrillic_shha, Cyrillic_SHHA, 8 ] }; key <AE09> { [ Cyrillic_zhe_descender, Cyrillic_ZHE_descender, 9 ] }; key <AE10> { [ semicolon, colon, 0 ] }; key <TLDE> { [ parenleft, parenright, Cyrillic_io, Cyrillic_IO ] }; key <AD02> { [ Cyrillic_tse, Cyrillic_TSE, dollar ] }; - key <AD03> { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; - key <AD04> { [ Cyrillic_ka, Cyrillic_KA, registered ] }; - key <AD05> { [ Cyrillic_ie, Cyrillic_IE, trademark ] }; - key <AD11> { [ Cyrillic_ha, Cyrillic_HA, bracketleft ] }; + key <AD03> { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; + key <AD04> { [ Cyrillic_ka, Cyrillic_KA, registered ] }; + key <AD05> { [ Cyrillic_ie, Cyrillic_IE, trademark ] }; + key <AD11> { [ Cyrillic_ha, Cyrillic_HA, bracketleft ] }; key <AD12> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, bracketright ] }; key <AC11> { [ Cyrillic_e, Cyrillic_E, apostrophe ] }; - key <AB03> { [ Cyrillic_es, Cyrillic_ES, copyright ] }; + key <AB03> { [ Cyrillic_es, Cyrillic_ES, copyright ] }; key <AB08> { [ Cyrillic_be, Cyrillic_BE, less ] }; key <AB09> { [ Cyrillic_yu, Cyrillic_YU, greater ] }; @@ -476,7 +476,7 @@ xkb_symbols "bak" { key <AE11> { [ minus, percent, minus, underscore ]}; key <AE12> { [ 0x010004af, 0x010004ae, equal, plus ]}; key <BKSL> { [ 0x010004a3, 0x010004a2, backslash, slash ]}; - + include "level3(ralt_switch)" }; @@ -511,7 +511,7 @@ xkb_symbols "srp" { partial alphanumeric_keys xkb_symbols "chm" { include "ru(common)" - + name[Group1]= "Mari"; key.type[group1]="FOUR_LEVEL_ALPHABETIC"; diff --git a/xorg-server/xkeyboard-config/symbols/se b/xorg-server/xkeyboard-config/symbols/se index a498f693d..7c37d2a1d 100644 --- a/xorg-server/xkeyboard-config/symbols/se +++ b/xorg-server/xkeyboard-config/symbols/se @@ -45,7 +45,7 @@ xkb_symbols "nodeadkeys" { }; // Swedish Dvorak -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "dvorak" { name[Group1]="Swedish (Dvorak)"; @@ -162,7 +162,7 @@ xkb_symbols "smi" { }; // Copied from macintosh_vndr/se -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "mac" { // Describes the differences between a very simple en_US diff --git a/xorg-server/xkeyboard-config/symbols/si b/xorg-server/xkeyboard-config/symbols/si index 6733d2bd1..cff5f5602 100644 --- a/xorg-server/xkeyboard-config/symbols/si +++ b/xorg-server/xkeyboard-config/symbols/si @@ -8,7 +8,7 @@ xkb_symbols "basic" { key <TLDE> { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "us" { name[Group1]= "Slovenian (US keyboard with Slovenian letters)"; @@ -19,7 +19,7 @@ xkb_symbols "us" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "alternatequotes" { name[Group1]= "Slovenian (use guillemets for quotes)"; diff --git a/xorg-server/xkeyboard-config/symbols/sk b/xorg-server/xkeyboard-config/symbols/sk index b48e5aa8d..2162d533d 100644 --- a/xorg-server/xkeyboard-config/symbols/sk +++ b/xorg-server/xkeyboard-config/symbols/sk @@ -1,6 +1,6 @@ default partial alphanumeric_keys xkb_symbols "basic" { - + // This layout conforms to a new sk compromise standard designed // to satisfy most unix, windows and mac users. // 2001 by Kamil Toman <ktoman@email.cz> @@ -46,7 +46,7 @@ xkb_symbols "basic" { key <AC07> { [ j, J, apostrophe, NoSymbol ] }; key <AC08> { [ k, K, lstroke, NoSymbol ] }; key <AC09> { [ l, L, Lstroke, NoSymbol ] }; - + key <AC10> { [ocircumflex, quotedbl, dollar, NoSymbol ] }; key <AC11> { [ section, exclam, apostrophe, ssharp ] }; key <AC12> { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; @@ -78,13 +78,13 @@ xkb_symbols "bksl" { key <BKSL> { [ backslash, bar, slash, NoSymbol ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "qwerty" { - + // This layout should work exactly as a sk with the exception // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). // 2001 by Kamil Toman <ktoman@email.cz> - + include "sk(basic)" name[Group1] = "Slovak (qwerty)"; diff --git a/xorg-server/xkeyboard-config/symbols/srvr_ctrl b/xorg-server/xkeyboard-config/symbols/srvr_ctrl index 52b4eb9a0..902c51cf7 100644 --- a/xorg-server/xkeyboard-config/symbols/srvr_ctrl +++ b/xorg-server/xkeyboard-config/symbols/srvr_ctrl @@ -1,4 +1,4 @@ -// Actions which control the server's behavior +// Actions which control the server's behavior. partial keypad_keys function_keys xkb_symbols "xfree86" { @@ -6,7 +6,7 @@ xkb_symbols "xfree86" { include "srvr_ctrl(fkey2vt)" }; -partial function_keys +partial function_keys xkb_symbols "fkey2vt" { key <FK01> { @@ -68,7 +68,6 @@ xkb_symbols "fkey2vt" { type="CTRL+ALT", symbols[Group1]= [ F12, F12, F12, F12, XF86_Switch_VT_12 ] }; - }; partial function_keys keypad_keys @@ -94,3 +93,18 @@ xkb_symbols "no_srvr_keys" { key <KPSU> { [ KP_Subtract, KP_Subtract ] }; key <KPAD> { [ KP_Add, KP_Add ] }; }; + +partial function_keys +xkb_symbols "grab_debug" { + + key <FK11> { + type="CTRL+ALT", + symbols[Group1]= [ F11, F11, F11, F11, XF86LogGrabInfo ] + }; + + key <FK12> { + type="CTRL+ALT", + symbols[Group1]= [ F12, F12, F12, F12, XF86LogWindowTree ] + }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/th b/xorg-server/xkeyboard-config/symbols/th index 9cdde53cd..c2390ffc4 100644 --- a/xorg-server/xkeyboard-config/symbols/th +++ b/xorg-server/xkeyboard-config/symbols/th @@ -59,12 +59,12 @@ xkb_symbols "basic" { key <BKSL> { [ Thai_khokhuat, Thai_khokhon ] }; }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "pat" { name[Group1]= "Thai (Pattachote)"; // The thai layout defines a second keyboard group and changes // the behavior of a few modifier keys. - + // converted to THai keysysms - Pablo Saratxaga pablo@mandrakesoft.com // Pattachote modification by Visanu Euarchukiati -- visanu@inet.co.th key <TLDE> { [ underscore, Thai_baht ] }; @@ -121,7 +121,7 @@ xkb_symbols "pat" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "tis" { name[Group1]= "Thai (TIS-820.2538)"; // The thai layout defines a second keyboard group and changes diff --git a/xorg-server/xkeyboard-config/symbols/tj b/xorg-server/xkeyboard-config/symbols/tj index 38a7cd257..e7816cbf9 100644 --- a/xorg-server/xkeyboard-config/symbols/tj +++ b/xorg-server/xkeyboard-config/symbols/tj @@ -16,57 +16,57 @@ xkb_symbols "basic" { name[Group1] = "Tajik"; - include "kpdl(comma)" + include "kpdl(comma)" include "level3(ralt_switch)" - key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я - key <AB02> { [ Cyrillic_che, Cyrillic_CHE ] }; // ч Ч - key <AB03> { [ Cyrillic_es, Cyrillic_ES ] }; // с С - key <AB04> { [ Cyrillic_em, Cyrillic_EM ] }; // м М - key <AB05> { [ Cyrillic_i, Cyrillic_I ] }; // и И - key <AB06> { [ Cyrillic_te, Cyrillic_TE ] }; // т Т - key <AB07> { [ 0x10004e3, 0x10004e2 ] }; // ӣ Ӣ - key <AB08> { [ Cyrillic_be, Cyrillic_BE ] }; // б Б - key <AB09> { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю - key <AB10> { [ period, comma ] }; // . , - key <AC01> { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф - key <AC02> { [ 0x10004b7, 0x10004b6 ] }; // ҷ Ҷ - key <AC03> { [ Cyrillic_ve, Cyrillic_VE ] }; // в В - key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; // а А - key <AC05> { [ Cyrillic_pe, Cyrillic_PE ] }; // п П - key <AC06> { [ Cyrillic_er, Cyrillic_ER ] }; // р Р - key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; // о О - key <AC08> { [ Cyrillic_el, Cyrillic_EL ] }; // л Л - key <AC09> { [ Cyrillic_de, Cyrillic_DE ] }; // д Д - key <AC10> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж - key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; // э Э - key <AD01> { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й - key <AD02> { [ 0x100049b, 0x100049a ] }; // қ Қ - key <AD03> { [ Cyrillic_u, Cyrillic_U ] }; // у У - key <AD04> { [ Cyrillic_ka, Cyrillic_KA ] }; // к К - key <AD05> { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е - key <AD06> { [ Cyrillic_en, Cyrillic_EN ] }; // н Н - key <AD07> { [ Cyrillic_ghe, Cyrillic_GHE ] }; // г Г - key <AD08> { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш - key <AD09> { [ 0x10004b3, 0x10004b2 ] }; // ҳ Ҳ - key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З - key <AD11> { [ Cyrillic_ha, Cyrillic_HA ] }; // х Х - key <AD12> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ - key <AE01> { [ 1, exclam, 0x10000a7 ] }; // 1 ! § - key <AE02> { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » - key <AE03> { [ 3, numerosign ] }; // 3 № - key <AE04> { [ 4, semicolon ] }; // 4 ; - key <AE05> { [ 5, percent ] }; // 5 % - key <AE06> { [ 6, colon, 0x1002013 ] }; // 6 : – - key <AE07> { [ 7, question, ampersand ] }; // 7 ? & - key <AE08> { [ 8, asterisk ] }; // 8 * - key <AE09> { [ 9, parenleft ] }; // 9 ( - key <AE10> { [ 0, parenright, 0x10000b0 ] }; // 0 ) ° - key <AE11> { [ 0x1000493, 0x1000492, minus, underscore ] }; // ғ Ғ - _ - key <AE12> { [ 0x10004ef, 0x10004ee, equal, plus ] }; // ӯ Ӯ = + - key <BKSL> { [ backslash, slash ] }; // \ / - key <LSGT> { [ slash, bar ] }; // / | - key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё + key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я + key <AB02> { [ Cyrillic_che, Cyrillic_CHE ] }; // ч Ч + key <AB03> { [ Cyrillic_es, Cyrillic_ES ] }; // с С + key <AB04> { [ Cyrillic_em, Cyrillic_EM ] }; // м М + key <AB05> { [ Cyrillic_i, Cyrillic_I ] }; // и И + key <AB06> { [ Cyrillic_te, Cyrillic_TE ] }; // т Т + key <AB07> { [ 0x10004e3, 0x10004e2 ] }; // ӣ Ӣ + key <AB08> { [ Cyrillic_be, Cyrillic_BE ] }; // б Б + key <AB09> { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю + key <AB10> { [ period, comma ] }; // . , + key <AC01> { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф + key <AC02> { [ 0x10004b7, 0x10004b6 ] }; // ҷ Ҷ + key <AC03> { [ Cyrillic_ve, Cyrillic_VE ] }; // в В + key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; // а А + key <AC05> { [ Cyrillic_pe, Cyrillic_PE ] }; // п П + key <AC06> { [ Cyrillic_er, Cyrillic_ER ] }; // р Р + key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; // о О + key <AC08> { [ Cyrillic_el, Cyrillic_EL ] }; // л Л + key <AC09> { [ Cyrillic_de, Cyrillic_DE ] }; // д Д + key <AC10> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж + key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; // э Э + key <AD01> { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й + key <AD02> { [ 0x100049b, 0x100049a ] }; // қ Қ + key <AD03> { [ Cyrillic_u, Cyrillic_U ] }; // у У + key <AD04> { [ Cyrillic_ka, Cyrillic_KA ] }; // к К + key <AD05> { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е + key <AD06> { [ Cyrillic_en, Cyrillic_EN ] }; // н Н + key <AD07> { [ Cyrillic_ghe, Cyrillic_GHE ] }; // г Г + key <AD08> { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш + key <AD09> { [ 0x10004b3, 0x10004b2 ] }; // ҳ Ҳ + key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З + key <AD11> { [ Cyrillic_ha, Cyrillic_HA ] }; // х Х + key <AD12> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ + key <AE01> { [ 1, exclam, 0x10000a7 ] }; // 1 ! § + key <AE02> { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » + key <AE03> { [ 3, numerosign ] }; // 3 № + key <AE04> { [ 4, semicolon ] }; // 4 ; + key <AE05> { [ 5, percent ] }; // 5 % + key <AE06> { [ 6, colon, 0x1002013 ] }; // 6 : – + key <AE07> { [ 7, question, ampersand ] }; // 7 ? & + key <AE08> { [ 8, asterisk ] }; // 8 * + key <AE09> { [ 9, parenleft ] }; // 9 ( + key <AE10> { [ 0, parenright, 0x10000b0 ] }; // 0 ) ° + key <AE11> { [ 0x1000493, 0x1000492, minus, underscore ] }; // ғ Ғ - _ + key <AE12> { [ 0x10004ef, 0x10004ee, equal, plus ] }; // ӯ Ӯ = + + key <BKSL> { [ backslash, slash ] }; // \ / + key <LSGT> { [ slash, bar ] }; // / | + key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё }; // -------------------------------------------------------------------- @@ -85,52 +85,52 @@ xkb_symbols "legacy" include "kpdl(comma)" include "level3(ralt_switch)" - key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я - key <AB02> { [ Cyrillic_che, Cyrillic_CHE, 0x10004b7, 0x10004b6 ] }; // ч Ч ҷ Ҷ - key <AB03> { [ Cyrillic_es, Cyrillic_ES ] }; // с С - key <AB04> { [ Cyrillic_em, Cyrillic_EM ] }; // м М - key <AB05> { [ Cyrillic_i, Cyrillic_I, 0x10004e3, 0x10004e2 ] }; // и И ӣ Ӣ - key <AB06> { [ Cyrillic_te, Cyrillic_TE ] }; // т Т - key <AB07> { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ь Ь - key <AB08> { [ Cyrillic_be, Cyrillic_BE ] }; // б Б - key <AB09> { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю - key <AB10> { [ period, comma ] }; // . , - key <AC01> { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф - key <AC02> { [ Cyrillic_yeru, Cyrillic_YERU ] }; // ы Ы - key <AC03> { [ Cyrillic_ve, Cyrillic_VE ] }; // в В - key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; // а А - key <AC05> { [ Cyrillic_pe, Cyrillic_PE ] }; // п П - key <AC06> { [ Cyrillic_er, Cyrillic_ER ] }; // р Р - key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; // о О - key <AC08> { [ Cyrillic_el, Cyrillic_EL ] }; // л Л - key <AC09> { [ Cyrillic_de, Cyrillic_DE ] }; // д Д - key <AC10> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж - key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; // э Э - key <AD01> { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й - key <AD02> { [ Cyrillic_tse, Cyrillic_TSE ] }; // ц Ц - key <AD03> { [ Cyrillic_u, Cyrillic_U, 0x10004ef, 0x10004ee ] }; // у У ӯ Ӯ - key <AD04> { [ Cyrillic_ka, Cyrillic_KA, 0x100049b, 0x100049a ] }; // к К қ Қ - key <AD05> { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е - key <AD06> { [ Cyrillic_en, Cyrillic_EN ] }; // н Н - key <AD07> { [ Cyrillic_ghe, Cyrillic_GHE, 0x1000493, 0x1000492 ] }; // г Г ғ Ғ - key <AD08> { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш - key <AD09> { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // щ Щ - key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З - key <AD11> { [ Cyrillic_ha, Cyrillic_HA, 0x10004b3, 0x10004b2 ] }; // х Х ҳ Ҳ - key <AD12> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ - key <AE01> { [ 1, exclam, 0x10000a7 ] }; // 1 ! § - key <AE02> { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » - key <AE03> { [ 3, numerosign ] }; // 3 № - key <AE04> { [ 4, semicolon ] }; // 4 ; - key <AE05> { [ 5, percent ] }; // 5 % - key <AE06> { [ 6, colon, 0x1002013 ] }; // 6 : – - key <AE07> { [ 7, question, ampersand ] }; // 7 ? & - key <AE08> { [ 8, asterisk ] }; // 8 * - key <AE09> { [ 9, parenleft ] }; // 9 ( - key <AE10> { [ 0, parenright ] }; // 0 ) - key <AE11> { [ minus, underscore ] }; // - _ - key <AE12> { [ equal, plus ] }; // = + - key <BKSL> { [ backslash, slash ] }; // \ / - key <LSGT> { [ slash, bar ] }; // / | - key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё + key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я + key <AB02> { [ Cyrillic_che, Cyrillic_CHE, 0x10004b7, 0x10004b6 ] }; // ч Ч ҷ Ҷ + key <AB03> { [ Cyrillic_es, Cyrillic_ES ] }; // с С + key <AB04> { [ Cyrillic_em, Cyrillic_EM ] }; // м М + key <AB05> { [ Cyrillic_i, Cyrillic_I, 0x10004e3, 0x10004e2 ] }; // и И ӣ Ӣ + key <AB06> { [ Cyrillic_te, Cyrillic_TE ] }; // т Т + key <AB07> { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ь Ь + key <AB08> { [ Cyrillic_be, Cyrillic_BE ] }; // б Б + key <AB09> { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю + key <AB10> { [ period, comma ] }; // . , + key <AC01> { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф + key <AC02> { [ Cyrillic_yeru, Cyrillic_YERU ] }; // ы Ы + key <AC03> { [ Cyrillic_ve, Cyrillic_VE ] }; // в В + key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; // а А + key <AC05> { [ Cyrillic_pe, Cyrillic_PE ] }; // п П + key <AC06> { [ Cyrillic_er, Cyrillic_ER ] }; // р Р + key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; // о О + key <AC08> { [ Cyrillic_el, Cyrillic_EL ] }; // л Л + key <AC09> { [ Cyrillic_de, Cyrillic_DE ] }; // д Д + key <AC10> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж + key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; // э Э + key <AD01> { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й + key <AD02> { [ Cyrillic_tse, Cyrillic_TSE ] }; // ц Ц + key <AD03> { [ Cyrillic_u, Cyrillic_U, 0x10004ef, 0x10004ee ] }; // у У ӯ Ӯ + key <AD04> { [ Cyrillic_ka, Cyrillic_KA, 0x100049b, 0x100049a ] }; // к К қ Қ + key <AD05> { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е + key <AD06> { [ Cyrillic_en, Cyrillic_EN ] }; // н Н + key <AD07> { [ Cyrillic_ghe, Cyrillic_GHE, 0x1000493, 0x1000492 ] }; // г Г ғ Ғ + key <AD08> { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш + key <AD09> { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // щ Щ + key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З + key <AD11> { [ Cyrillic_ha, Cyrillic_HA, 0x10004b3, 0x10004b2 ] }; // х Х ҳ Ҳ + key <AD12> { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ + key <AE01> { [ 1, exclam, 0x10000a7 ] }; // 1 ! § + key <AE02> { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » + key <AE03> { [ 3, numerosign ] }; // 3 № + key <AE04> { [ 4, semicolon ] }; // 4 ; + key <AE05> { [ 5, percent ] }; // 5 % + key <AE06> { [ 6, colon, 0x1002013 ] }; // 6 : – + key <AE07> { [ 7, question, ampersand ] }; // 7 ? & + key <AE08> { [ 8, asterisk ] }; // 8 * + key <AE09> { [ 9, parenleft ] }; // 9 ( + key <AE10> { [ 0, parenright ] }; // 0 ) + key <AE11> { [ minus, underscore ] }; // - _ + key <AE12> { [ equal, plus ] }; // = + + key <BKSL> { [ backslash, slash ] }; // \ / + key <LSGT> { [ slash, bar ] }; // / | + key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё }; diff --git a/xorg-server/xkeyboard-config/symbols/tm b/xorg-server/xkeyboard-config/symbols/tm index 8d84f9a85..e861b35c3 100644 --- a/xorg-server/xkeyboard-config/symbols/tm +++ b/xorg-server/xkeyboard-config/symbols/tm @@ -4,7 +4,7 @@ default partial xkb_symbols "basic" { name[Group1]="Turkmen"; - + include "us" key <TLDE> { [ zcaron, Zcaron, grave, asciitilde ] }; diff --git a/xorg-server/xkeyboard-config/symbols/ua b/xorg-server/xkeyboard-config/symbols/ua index e286f4835..9aea09e05 100644 --- a/xorg-server/xkeyboard-config/symbols/ua +++ b/xorg-server/xkeyboard-config/symbols/ua @@ -8,7 +8,7 @@ default partial alphanumeric_keys xkb_symbols "unicode" { include "ua(winkeys)" - + name[Group1]= "Ukrainian"; key <TLDE> { [ U2019, apostrophe, U0301, asciitilde ] }; // Apostrophe and Stress symbol @@ -43,7 +43,7 @@ xkb_symbols "unicode" { include "level3(ralt_switch)" }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "legacy" { name[Group1]= "Ukrainian (legacy)"; @@ -105,7 +105,7 @@ xkb_symbols "legacy" { partial alphanumeric_keys xkb_symbols "winkeys" { include "ua(legacy)" - + name[Group1]= "Ukrainian (WinKeys)"; key <AE03> { [ 3, numerosign ] }; @@ -149,7 +149,7 @@ xkb_symbols "typewriter" { partial alphanumeric_keys xkb_symbols "phonetic" { include "ua(legacy)" - + name[Group1]= "Ukrainian (phonetic)"; key <LatQ> { [ Cyrillic_ya, Cyrillic_YA ] }; diff --git a/xorg-server/xkeyboard-config/symbols/us b/xorg-server/xkeyboard-config/symbols/us index 0eff07539..4948a6345 100644 --- a/xorg-server/xkeyboard-config/symbols/us +++ b/xorg-server/xkeyboard-config/symbols/us @@ -425,7 +425,7 @@ xkb_symbols "dvorak-l" { partial alphanumeric_keys xkb_symbols "dvorak-r" { - + include "us(dvorak)" name[Group1]= "English (right handed Dvorak)"; @@ -726,7 +726,7 @@ xkb_symbols "mac" { include "level3(ralt_switch)" }; - + // Colemak symbols for xkb on X.Org Server 7.x // 2006-01-01 Shai Coleman, http://colemak.com/ @@ -894,11 +894,11 @@ xkb_symbols "classmate-intl" { oslash, Ooblique ] }; key <KPAD> { [ KP_Add, KP_Add, paragraph, degree ] }; - + key <KP0> { [ KP_Insert, KP_0, mu, mu ] }; key <KPDL> { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_caron ] }; + dead_abovedot, dead_caron ] }; key <KPDV> { [ KP_Divide, KP_Divide, questiondown, dead_hook ] }; @@ -927,9 +927,9 @@ xkb_symbols "classmate-alt-intl" { key <KPAD> { [ KP_Add, KP_Add, dead_ogonek, dead_diaeresis ] }; - + key <KPDL> { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_circumflex ] }; + dead_abovedot, dead_circumflex ] }; key <KPDV> { [ KP_Divide, KP_Divide, dead_hook, dead_hook ] }; @@ -975,11 +975,11 @@ xkb_symbols "classmate-altgr-intl" { oslash, Ooblique ] }; key <KPAD> { [ KP_Add, KP_Add, paragraph, degree ] }; - + key <KP0> { [ KP_Insert, KP_0, mu, mu ] }; key <KPDL> { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_caron ] }; + dead_abovedot, dead_caron ] }; key <KPDV> { [ KP_Divide, KP_Divide, questiondown, dead_hook ] }; @@ -1399,7 +1399,7 @@ xkb_symbols "cz_sk_de" { key <AE10> { [ 0, parenright, eacute, Eacute ] }; key <AE11> { [minus, underscore, ssharp, 0x1001E9E ] }; key <AE12> { [equal, plus, dead_acute, dead_caron ] }; - + key <AD03> { [ e, E, EuroSign, Eacute ] }; key <AD11> { [bracketleft, braceleft, udiaeresis, Udiaeresis ] }; @@ -1514,7 +1514,7 @@ xkb_symbols "alt-intl-unicode" { }; -partial alphanumeric_keys +partial alphanumeric_keys xkb_symbols "ats" { include "us" @@ -1551,19 +1551,19 @@ xkb_symbols "crd" { name[Group1]= "Coeur d'Alene Salish"; - key <AD02> { [ w, W, U02B7, U02B7 ] }; - key <AE07> { [ 7, ampersand, U0294 ] }; - key <AD01> { [ q, Q, U221A ] }; - key <AB04> { [ v, V, U0259 ] }; - key <BKSL> { [ backslash, bar, U026B ] }; - key <AD03> { [ e, E, U025B ] }; - key <AD08> { [ i, I, U026A ] }; - key <AC07> { [ j, J, U01F0 ] }; - key <AE06> { [ 6, asciicircum, U0295 ] }; - key <AC02> { [ s, S, U0161 ] }; - key <AB03> { [ c, C, U010D ] }; - key <AD09> { [ o, O, U0254 ] }; - key <AB09> { [ period, greater, U0323 ] }; + key <AD02> { [ w, W, U02B7, U02B7 ] }; + key <AE07> { [ 7, ampersand, U0294 ] }; + key <AD01> { [ q, Q, U221A ] }; + key <AB04> { [ v, V, U0259 ] }; + key <BKSL> { [ backslash, bar, U026B ] }; + key <AD03> { [ e, E, U025B ] }; + key <AD08> { [ i, I, U026A ] }; + key <AC07> { [ j, J, U01F0 ] }; + key <AE06> { [ 6, asciicircum, U0295 ] }; + key <AC02> { [ s, S, U0161 ] }; + key <AB03> { [ c, C, U010D ] }; + key <AD09> { [ o, O, U0254 ] }; + key <AB09> { [ period, greater, U0323 ] }; include "level3(ralt_switch)" include "compose(rctrl)" diff --git a/xorg-server/xkeyboard-config/symbols/uz b/xorg-server/xkeyboard-config/symbols/uz index e88741b73..d76e3c9b9 100644 --- a/xorg-server/xkeyboard-config/symbols/uz +++ b/xorg-server/xkeyboard-config/symbols/uz @@ -6,17 +6,17 @@ // // Jun 2, 2003. Mashrab Kuvatov <kmashrab@uni-bremen.de> // -// Created based on Russian standard keyboard. AEN <aen@logic.ru> -// The following symbols of Russian standard keyboard were replaced: +// Created based on the Russian standard keyboard. AEN <aen@logic.ru> +// The following symbols of the Russian standard keyboard were replaced: // minus (key <AE11>) with Byelorussian_shortu (U045e), -// equal (key <AE12>) with Cyrillic_ka_descender (U049b) -// Cyrillic_ha (key <AD11>) with Cyrillic_ghe_bar (U0493) -// Cyrillic_hardsign (key <AD12>) with Cyrillic_ha_descender (U04b3) -// The following symbols of Russian standard keyboard were moved: -// Cyrillic_ze to key <AC02> (english 's'), -// Cyrillic_sha to key <AD08> (english 'i'), -// Cyrillic_ha to key <AD09> (english 'o'), -// Cyrillic_hardsign to key <AD10> (english 'p'). +// equal (key <AE12>) with Cyrillic_ka_descender (U049b), +// Cyrillic_ha (key <AD11>) with Cyrillic_ghe_bar (U0493), +// Cyrillic_hardsign (key <AD12>) with Cyrillic_ha_descender (U04b3). +// The following symbols of the Russian standard keyboard were moved: +// Cyrillic_ze to key <AC02> (English 's'), +// Cyrillic_sha to key <AD08> (English 'i'), +// Cyrillic_ha to key <AD09> (English 'o'), +// Cyrillic_hardsign to key <AD10> (English 'p'). // // Feb 25, 2007. Mashrab Kuvatov <kmashrab@uni-bremen.de> // @@ -28,62 +28,61 @@ // Latin variant is somewhat experimental, since there is no // official standard for it. It is a copy of "us" layout, where // apostrophe is replaced with U02BB. -// default partial alphanumeric_keys xkb_symbols "cyrillic" { name[Group1]= "Uzbek"; - key <AE01> { [ 1, exclam ] }; - key <AE02> { [ 2, quotedbl ] }; - key <AE03> { [ 3, numerosign ] }; - key <AE04> { [ 4, semicolon ] }; - key <AE05> { [ 5, percent ] }; + key <AE01> { [ 1, exclam ] }; + key <AE02> { [ 2, quotedbl ] }; + key <AE03> { [ 3, numerosign ] }; + key <AE04> { [ 4, semicolon ] }; + key <AE05> { [ 5, percent ] }; key <AE06> { [ 6, colon ] }; key <AE07> { [ 7, question ] }; key <AE08> { [ 8, asterisk ] }; key <AE09> { [ 9, parenleft ] }; key <AE10> { [ 0, parenright ] }; - key <BKSL> { [ backslash, bar ] }; + key <BKSL> { [ backslash, bar ] }; key <AB10> { [ period, comma ] }; - key <LSGT> { [ slash, bar ] }; + key <LSGT> { [ slash, bar ] }; key.type[group1]="ALPHABETIC"; - key <AE11> { [Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; + key <AE11> { [Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; key <AE12> { [Cyrillic_ha_descender, Cyrillic_HA_descender ] }; key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] }; key <AD01> { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; key <AD02> { [ Cyrillic_tse, Cyrillic_TSE ] }; - key <AD03> { [ Cyrillic_u, Cyrillic_U ] }; + key <AD03> { [ Cyrillic_u, Cyrillic_U ] }; key <AD04> { [ Cyrillic_ka, Cyrillic_KA ] }; key <AD05> { [ Cyrillic_ie, Cyrillic_IE ] }; key <AD06> { [ Cyrillic_en, Cyrillic_EN ] }; key <AD07> { [ Cyrillic_ghe, Cyrillic_GHE ] }; key <AD08> { [ Cyrillic_sha, Cyrillic_SHA ] }; key <AD09> { [ Byelorussian_shortu, Byelorussian_SHORTU ] }; - key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; - key <AD11> { [ Cyrillic_ha, Cyrillic_HA ] }; - key <AD12> { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key <AD10> { [ Cyrillic_ze, Cyrillic_ZE ] }; + key <AD11> { [ Cyrillic_ha, Cyrillic_HA ] }; + key <AD12> { [Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; key <AC01> { [ Cyrillic_ef, Cyrillic_EF ] }; key <AC02> { [Cyrillic_ka_descender, Cyrillic_KA_descender ] }; key <AC03> { [ Cyrillic_ve, Cyrillic_VE ] }; - key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; + key <AC04> { [ Cyrillic_a, Cyrillic_A ] }; key <AC05> { [ Cyrillic_pe, Cyrillic_PE ] }; key <AC06> { [ Cyrillic_er, Cyrillic_ER ] }; - key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; + key <AC07> { [ Cyrillic_o, Cyrillic_O ] }; key <AC08> { [ Cyrillic_el, Cyrillic_EL ] }; key <AC09> { [ Cyrillic_de, Cyrillic_DE ] }; key <AC10> { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; + key <AC11> { [ Cyrillic_e, Cyrillic_E ] }; key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; key <AB02> { [ Cyrillic_che, Cyrillic_CHE ] }; key <AB03> { [ Cyrillic_es, Cyrillic_ES ] }; key <AB04> { [ Cyrillic_em, Cyrillic_EM ] }; key <AB06> { [ Cyrillic_te, Cyrillic_TE ] }; - key <AB05> { [ Cyrillic_i, Cyrillic_I ] }; - key <AB07> { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key <AB05> { [ Cyrillic_i, Cyrillic_I ] }; + key <AB07> { [Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; key <AB08> { [ Cyrillic_be, Cyrillic_BE ] }; key <AB09> { [ Cyrillic_yu, Cyrillic_YU ] }; }; diff --git a/xorg-server/xkeyboard-config/symbols/za b/xorg-server/xkeyboard-config/symbols/za index 75f6d9a27..aba979196 100644 --- a/xorg-server/xkeyboard-config/symbols/za +++ b/xorg-server/xkeyboard-config/symbols/za @@ -1,42 +1,42 @@ -// based on the Latvian and GB keyboard maps +// Based on the Latvian and GB keyboard maps. default partial alphanumeric_keys modifier_keys xkb_symbols "basic" { - // Describes the differences between an en_US - // keyboard and a South African layout with - // dead keys. By Dwayne Bailey (dwayne@translate.org.za) + // Describes the differences between an en_US layout + // and a South African layout with dead keys. + // By Dwayne Bailey (dwayne@translate.org.za). include "latin" name[Group1]="English (South Africa)"; - key <TLDE> { [ grave, asciitilde, dead_grave ] }; - key <AE02> { [ 2, at, yen ] }; - key <AE03> { [ 3, numbersign, sterling ] }; - key <AE04> { [ 4, dollar, dollar ] }; - key <AE05> { [ 5, percent, EuroSign ] }; - key <AE06> { [ 6, asciicircum, dead_circumflex ] }; - - key <AD03> { [ e, E, ediaeresis, Ediaeresis ] }; - key <AD04> { [ r, R, ecircumflex, Ecircumflex ] }; - key <AD05> { [ t, T, U1e71, U1e70 ] }; - key <AD06> { [ y, Y, ucircumflex, Ucircumflex ] }; - key <AD07> { [ u, U, udiaeresis, Udiaeresis ] }; - key <AD08> { [ i, I, idiaeresis, Idiaeresis ] }; - key <AD09> { [ o, O, odiaeresis, Odiaeresis ] }; - key <AD10> { [ p, P, ocircumflex, Ocircumflex ] }; - - key <AC01> { [ a, A, adiaeresis, Adiaeresis ] }; - key <AC02> { [ s, S, scaron, Scaron ] }; - key <AC03> { [ d, D, U1e13, U1e12 ] }; - key <AC09> { [ l, L, U1e3d, U1e3c ] }; - key <AC10> { [ semicolon, colon, dead_diaeresis ] }; - key <AC11> { [apostrophe, quotedbl, dead_acute ] }; - - key <AB06> { [ n, N, U1e4b, U1e4a ] }; - key <AB07> { [ m, M, U1e45, U1e44 ] }; - key <AB09> { [ period, greater, dead_abovedot ] }; + key <TLDE> { [ grave, asciitilde, dead_grave ] }; + key <AE02> { [ 2, at, yen ] }; + key <AE03> { [ 3, numbersign, sterling ] }; + key <AE04> { [ 4, dollar, dollar ] }; + key <AE05> { [ 5, percent, EuroSign ] }; + key <AE06> { [ 6,asciicircum, dead_circumflex ] }; + + key <AD03> { [ e, E, ediaeresis, Ediaeresis ] }; + key <AD04> { [ r, R, ecircumflex, Ecircumflex ] }; + key <AD05> { [ t, T, U1e71, U1e70 ] }; + key <AD06> { [ y, Y, ucircumflex, Ucircumflex ] }; + key <AD07> { [ u, U, udiaeresis, Udiaeresis ] }; + key <AD08> { [ i, I, idiaeresis, Idiaeresis ] }; + key <AD09> { [ o, O, odiaeresis, Odiaeresis ] }; + key <AD10> { [ p, P, ocircumflex, Ocircumflex ] }; + + key <AC01> { [ a, A, adiaeresis, Adiaeresis ] }; + key <AC02> { [ s, S, scaron, Scaron ] }; + key <AC03> { [ d, D, U1e13, U1e12 ] }; + key <AC09> { [ l, L, U1e3d, U1e3c ] }; + key <AC10> { [ semicolon, colon, dead_diaeresis ] }; + key <AC11> { [apostrophe, quotedbl, dead_acute ] }; + + key <AB06> { [ n, N, U1e4b, U1e4a ] }; + key <AB07> { [ m, M, U1e45, U1e44 ] }; + key <AB09> { [ period, greater, dead_abovedot ] }; include "level3(ralt_switch)" }; |