--- mesa-7.9~git20100924.orig/common.py +++ mesa-7.9~git20100924/common.py @@ -0,0 +1,93 @@ +####################################################################### +# Common SCons code + +import os +import os.path +import re +import subprocess +import sys +import platform as _platform + + +####################################################################### +# Defaults + +_platform_map = { + 'linux2': 'linux', + 'win32': 'windows', +} + +default_platform = sys.platform +default_platform = _platform_map.get(default_platform, default_platform) + +_machine_map = { + 'x86': 'x86', + 'i386': 'x86', + 'i486': 'x86', + 'i586': 'x86', + 'i686': 'x86', + 'ppc' : 'ppc', + 'x86_64': 'x86_64', +} + + +# find default_machine value +if 'PROCESSOR_ARCHITECTURE' in os.environ: + default_machine = os.environ['PROCESSOR_ARCHITECTURE'] +else: + default_machine = _platform.machine() +default_machine = _machine_map.get(default_machine, 'generic') + + +# find default_llvm value +if 'LLVM' in os.environ: + default_llvm = 'yes' +else: + # Search sys.argv[] for a "platform=foo" argument since we don't have + # an 'env' variable at this point. + platform = default_platform + pattern = re.compile("(platform=)(.*)") + for arg in sys.argv: + m = pattern.match(arg) + if m: + platform = m.group(2) + + default_llvm = 'no' + try: + if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0: + default_llvm = 'yes' + except: + pass + + +# find default_dri value +if default_platform in ('linux', 'freebsd'): + default_dri = 'yes' +elif default_platform in ('winddk', 'windows', 'wince', 'darwin'): + default_dri = 'no' +else: + default_dri = 'no' + + +####################################################################### +# Common options + +def AddOptions(opts): + try: + from SCons.Variables.BoolVariable import BoolVariable as BoolOption + except ImportError: + from SCons.Options.BoolOption import BoolOption + try: + from SCons.Variables.EnumVariable import EnumVariable as EnumOption + except ImportError: + from SCons.Options.EnumOption import EnumOption + opts.Add(BoolOption('debug', 'debug build', 'yes')) + opts.Add(BoolOption('profile', 'profile build', 'no')) + opts.Add(BoolOption('quiet', 'quiet command lines', 'yes')) + opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, + allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) + opts.Add(EnumOption('platform', 'target platform', default_platform, + allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8'))) + opts.Add('toolchain', 'compiler toolchain', 'default') + opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) + opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) --- mesa-7.9~git20100924.orig/.emacs-dirvars +++ mesa-7.9~git20100924/.emacs-dirvars @@ -0,0 +1,10 @@ +;; -*- emacs-lisp -*- +;; +;; This file is processed by the dirvars emacs package. Each variable +;; setting below is performed when this dirvars file is loaded. +;; +indent-tabs-mode: nil +tab-width: 8 +c-basic-offset: 3 +kde-emacs-after-parent-string: "" +evaluate: (c-set-offset 'inline-open '0) --- mesa-7.9~git20100924.orig/autogen.sh +++ mesa-7.9~git20100924/autogen.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +SRCDIR=`(cd "$srcdir" && pwd)` +ORIGDIR=`pwd` + +if test "x$SRCDIR" != "x$ORIGDIR"; then + echo "Mesa cannot be built when srcdir != builddir" 1>&2 + exit 1 +fi + +MAKEFLAGS="" + +autoreconf -v --install || exit 1 + +"$srcdir"/configure "$@" --- mesa-7.9~git20100924.orig/SConstruct +++ mesa-7.9~git20100924/SConstruct @@ -0,0 +1,216 @@ +####################################################################### +# Top-level SConstruct +# +# For example, invoke scons as +# +# scons debug=1 dri=0 machine=x86 +# +# to set configuration variables. Or you can write those options to a file +# named config.py: +# +# # config.py +# debug=1 +# dri=0 +# machine='x86' +# +# Invoke +# +# scons -h +# +# to get the full list of options. See scons manpage for more info. +# + +import os +import os.path +import sys +import SCons.Util + +import common + +####################################################################### +# Configuration options + +default_statetrackers = 'mesa' +default_targets = 'graw-null' + +if common.default_platform in ('linux', 'freebsd', 'darwin'): + default_drivers = 'softpipe,galahad,failover,svga,i915,i965,trace,identity,llvmpipe' + default_winsys = 'xlib' +elif common.default_platform in ('winddk',): + default_drivers = 'softpipe,svga,i915,i965,trace,identity' + default_winsys = 'all' +elif common.default_platform in ('embedded',): + default_drivers = 'softpipe,llvmpipe' + default_winsys = 'xlib' +else: + default_drivers = 'all' + default_winsys = 'all' + +opts = Variables('config.py') +common.AddOptions(opts) +opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers, + ['mesa', 'python', 'xorg', 'egl'])) +opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers, + ['softpipe', 'galahad', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'r600', 'identity', 'llvmpipe', 'nouveau', 'nv50', 'nvfx'])) +opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys, + ['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'r600', 'graw-xlib'])) + +opts.Add(ListVariable('targets', 'driver targets to build', default_targets, + ['dri-i915', + 'dri-i965', + 'dri-nouveau', + 'dri-radeong', + 'dri-swrast', + 'dri-vmwgfx', + 'egl-i915', + 'egl-i965', + 'egl-nouveau', + 'egl-radeon', + 'egl-swrast', + 'egl-vmwgfx', + 'graw-xlib', + 'graw-null', + 'libgl-gdi', + 'libgl-xlib', + 'xorg-i915', + 'xorg-i965', + 'xorg-nouveau', + 'xorg-radeon', + 'xorg-vmwgfx'])) + +opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) + +env = Environment( + options = opts, + tools = ['gallium'], + toolpath = ['#scons'], + ENV = os.environ, +) + +if os.environ.has_key('CC'): + env['CC'] = os.environ['CC'] +if os.environ.has_key('CFLAGS'): + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) +if os.environ.has_key('CXX'): + env['CXX'] = os.environ['CXX'] +if os.environ.has_key('CXXFLAGS'): + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) +if os.environ.has_key('LDFLAGS'): + env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) + +Help(opts.GenerateHelpText(env)) + +# replicate options values in local variables +debug = env['debug'] +dri = env['dri'] +machine = env['machine'] +platform = env['platform'] + +# derived options +x86 = machine == 'x86' +ppc = machine == 'ppc' +gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded') +msvc = platform in ('windows', 'winddk') + +Export([ + 'debug', + 'x86', + 'ppc', + 'dri', + 'platform', + 'gcc', + 'msvc', +]) + + +####################################################################### +# Environment setup + +# Always build trace, rbug, identity, softpipe, and llvmpipe (where possible) +if 'trace' not in env['drivers']: + env['drivers'].append('trace') +if 'rbug' not in env['drivers']: + env['drivers'].append('rbug') +if 'galahad' not in env['drivers']: + env['drivers'].append('galahad') +if 'identity' not in env['drivers']: + env['drivers'].append('identity') +if 'softpipe' not in env['drivers']: + env['drivers'].append('softpipe') +if env['llvm'] and 'llvmpipe' not in env['drivers']: + env['drivers'].append('llvmpipe') +if 'sw' not in env['drivers']: + env['drivers'].append('sw') + +# Includes +env.Prepend(CPPPATH = [ + '#/include', +]) +env.Append(CPPPATH = [ + '#/src/gallium/include', + '#/src/gallium/auxiliary', + '#/src/gallium/drivers', + '#/src/gallium/winsys', +]) + +if env['msvc']: + env.Append(CPPPATH = ['#include/c99']) + +# Embedded +if platform == 'embedded': + env.Append(CPPDEFINES = [ + '_POSIX_SOURCE', + ('_POSIX_C_SOURCE', '199309L'), + '_SVID_SOURCE', + '_BSD_SOURCE', + '_GNU_SOURCE', + + 'PTHREADS', + ]) + env.Append(LIBS = [ + 'm', + 'pthread', + 'dl', + ]) + +# Posix +if platform in ('posix', 'linux', 'freebsd', 'darwin'): + env.Append(CPPDEFINES = [ + '_POSIX_SOURCE', + ('_POSIX_C_SOURCE', '199309L'), + '_SVID_SOURCE', + '_BSD_SOURCE', + '_GNU_SOURCE', + 'PTHREADS', + 'HAVE_POSIX_MEMALIGN', + ]) + if gcc: + env.Append(CFLAGS = ['-fvisibility=hidden']) + if platform == 'darwin': + env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE']) + env.Append(LIBS = [ + 'm', + 'pthread', + 'dl', + ]) + +# for debugging +#print env.Dump() + +Export('env') + + +####################################################################### +# Invoke SConscripts + +# TODO: Build several variants at the same time? +# http://www.scons.org/wiki/SimultaneousVariantBuilds + +SConscript( + 'src/SConscript', + variant_dir = env['build'], + duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html +) + +env.Default('src') + --- mesa-7.9~git20100924.orig/include/c99/inttypes.h +++ mesa-7.9~git20100924/include/c99/inttypes.h @@ -0,0 +1,305 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + + +#endif // _MSC_INTTYPES_H_ ] --- mesa-7.9~git20100924.orig/include/c99/stdint.h +++ mesa-7.9~git20100924/include/c99/stdint.h @@ -0,0 +1,247 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifdef __cplusplus +extern "C" { +#endif +# include +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] --- mesa-7.9~git20100924.orig/include/c99/stdbool.h +++ mesa-7.9~git20100924/include/c99/stdbool.h @@ -0,0 +1,46 @@ +/************************************************************************** + * + * Copyright 2007-2010 VMware, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + +#ifndef _STDBOOL_H_ +#define _STDBOOL_H_ + +#ifndef __cplusplus + +#define false 0 +#define true 1 +#define bool _Bool + +/* For compilers that don't have the builtin _Bool type. */ +#if defined(_MSC_VER) || (__STDC_VERSION__ < 199901L && __GNUC__ < 3) +typedef unsigned char _Bool; +#endif + +#endif /* !__cplusplus */ + +#define __bool_true_false_are_defined 1 + +#endif /* !_STDBOOL_H_ */ --- mesa-7.9~git20100924.orig/src/SConscript +++ mesa-7.9~git20100924/src/SConscript @@ -0,0 +1,19 @@ +Import('*') + +if 'egl' in env['statetrackers']: + SConscript('mapi/vgapi/SConscript') + SConscript('egl/main/SConscript') + +if 'mesa' in env['statetrackers']: + if platform == 'windows': + SConscript('talloc/SConscript') + + SConscript('glsl/SConscript') + SConscript('mapi/glapi/SConscript') + SConscript('mesa/SConscript') + + if platform != 'embedded': + SConscript('glut/glx/SConscript') + +SConscript('gallium/SConscript') + --- mesa-7.9~git20100924.orig/src/glut/glx/SConscript +++ mesa-7.9~git20100924/src/glut/glx/SConscript @@ -0,0 +1,112 @@ +Import('*') + +env = env.Clone() + +env.Replace(CPPDEFINES = [ + 'BUILD_GLUT32', + 'GLUT_BUILDING_LIB', + 'NDEBUG', + 'GLUT_NO_WARNING_DISABLE', +]) + +env.AppendUnique(CPPPATH = [ + '#/include', +]) + +sources = [ + 'glut_bitmap.c', + 'glut_bwidth.c', + 'glut_cindex.c', + 'glut_cmap.c', + 'glut_cursor.c', + 'glut_dials.c', + 'glut_dstr.c', + 'glut_event.c', + 'glut_ext.c', + 'glut_fullscrn.c', + 'glut_gamemode.c', + 'glut_get.c', + 'glut_init.c', + 'glut_input.c', + 'glut_joy.c', + 'glut_key.c', + 'glut_keyctrl.c', + 'glut_keyup.c', + 'glut_mesa.c', + 'glut_modifier.c', + 'glut_overlay.c', + 'glut_ppm.c', + 'glut_shapes.c', + 'glut_space.c', + 'glut_stroke.c', + 'glut_swap.c', + 'glut_swidth.c', + 'glut_tablet.c', + 'glut_teapot.c', + 'glut_util.c', + 'glut_vidresize.c', + 'glut_warp.c', + 'glut_win.c', + 'glut_winmisc.c', + + 'glut_8x13.c', + 'glut_9x15.c', + 'glut_hel10.c', + 'glut_hel12.c', + 'glut_hel18.c', + 'glut_mroman.c', + 'glut_roman.c', + 'glut_tr10.c', + 'glut_tr24.c', +] + +if env['platform'] == 'windows': + env.PrependUnique(LIBS = [ + 'winmm', + 'gdi32', + 'user32', + 'opengl32', + 'glu32', + ]) + target = 'glut32' + sources += [ + 'win32_glx.c', + 'win32_menu.c', + 'win32_util.c', + 'win32_winproc.c', + 'win32_x11.c', + 'glut.def', + ] +else: + env.Tool('x11') + env.PrependUnique(LIBS = [ + 'GLU', + 'GL', + 'X11', + 'Xext', + 'Xmu', + 'Xi', + ]) + target = 'glut' + sources += [ + 'glut_fcb.c', + 'glut_menu.c', + 'glut_menu2.c', + 'glut_glxext.c', + 'layerutil.c', + ] + + +glut = env.SharedLibrary( + target = target, + source = sources, +) + +env.InstallSharedLibrary(glut, version=(3, 7, 1)) + +if env['platform'] == 'windows': + glut = env.FindIxes(glut, 'LIBPREFIX', 'LIBSUFFIX') +else: + glut = env.FindIxes(glut, 'SHLIBPREFIX', 'SHLIBSUFFIX') + +Export('glut') --- mesa-7.9~git20100924.orig/src/talloc/talloc.c +++ mesa-7.9~git20100924/src/talloc/talloc.c @@ -0,0 +1,2034 @@ +/* + Samba Unix SMB/CIFS implementation. + + Samba trivial allocation library - new interface + + NOTE: Please read talloc_guide.txt for full documentation + + Copyright (C) Andrew Tridgell 2004 + Copyright (C) Stefan Metzmacher 2006 + + ** NOTE! The following LGPL license applies to the talloc + ** library. This does NOT imply that all of Samba is released + ** under the LGPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . +*/ + +/* + inspired by http://swapped.cc/halloc/ +*/ + +#include "talloc.h" +#include + +#define TALLOC_MIN(a,b) ((a)<(b)?(a):(b)) + +/* Visual C++ 2008 compatibility */ +#if defined(_MSC_VER) && !defined(_cplusplus) +typedef size_t ssize_t; +#define inline __inline +#endif + +/* Xcode/gcc4.0 compatibility */ +#if defined(__APPLE__) || defined(__MINGW32__) +static size_t strnlen (const char* s, size_t n) +{ + size_t i; + for (i = 0; i < n; ++i) + { + if (s[i] == '\0') + break; + } + return i; +} +#endif + +/* Visual C++ 2008 & Xcode/gcc4.0 compatibility */ +#if !defined(_cplusplus) && (defined(WIN32) || defined(__APPLE__)) +typedef int bool; +#define false 0 +#define true 1 +#endif + + +#ifdef TALLOC_BUILD_VERSION_MAJOR +#if (TALLOC_VERSION_MAJOR != TALLOC_BUILD_VERSION_MAJOR) +#error "TALLOC_VERSION_MAJOR != TALLOC_BUILD_VERSION_MAJOR" +#endif +#endif + +#ifdef TALLOC_BUILD_VERSION_MINOR +#if (TALLOC_VERSION_MINOR != TALLOC_BUILD_VERSION_MINOR) +#error "TALLOC_VERSION_MINOR != TALLOC_BUILD_VERSION_MINOR" +#endif +#endif + +/* use this to force every realloc to change the pointer, to stress test + code that might not cope */ +#define ALWAYS_REALLOC 0 + + +#define MAX_TALLOC_SIZE 0x10000000 +#define TALLOC_MAGIC_BASE 0xe814ec70 +#define TALLOC_MAGIC ( \ + TALLOC_MAGIC_BASE + \ + (TALLOC_VERSION_MAJOR << 12) + \ + (TALLOC_VERSION_MINOR << 4) \ +) + +#define TALLOC_FLAG_FREE 0x01 +#define TALLOC_FLAG_LOOP 0x02 +#define TALLOC_FLAG_POOL 0x04 /* This is a talloc pool */ +#define TALLOC_FLAG_POOLMEM 0x08 /* This is allocated in a pool */ +#define TALLOC_MAGIC_REFERENCE ((const char *)1) + +/* by default we abort when given a bad pointer (such as when talloc_free() is called + on a pointer that came from malloc() */ +#ifndef TALLOC_ABORT +#define TALLOC_ABORT(reason) abort() +#endif + +#ifndef discard_const_p +#if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T) +# define discard_const_p(type, ptr) ((type *)((intptr_t)(ptr))) +#else +# define discard_const_p(type, ptr) ((type *)(ptr)) +#endif +#endif + +/* these macros gain us a few percent of speed on gcc */ +#if (__GNUC__ >= 3) +/* the strange !! is to ensure that __builtin_expect() takes either 0 or 1 + as its first argument */ +#ifndef likely +#define likely(x) __builtin_expect(!!(x), 1) +#endif +#ifndef unlikely +#define unlikely(x) __builtin_expect(!!(x), 0) +#endif +#else +#ifndef likely +#define likely(x) (x) +#endif +#ifndef unlikely +#define unlikely(x) (x) +#endif +#endif + +/* this null_context is only used if talloc_enable_leak_report() or + talloc_enable_leak_report_full() is called, otherwise it remains + NULL +*/ +static void *null_context; +static void *autofree_context; + +struct talloc_reference_handle { + struct talloc_reference_handle *next, *prev; + void *ptr; + const char *location; +}; + +typedef int (*talloc_destructor_t)(void *); + +struct talloc_chunk { + struct talloc_chunk *next, *prev; + struct talloc_chunk *parent, *child; + struct talloc_reference_handle *refs; + talloc_destructor_t destructor; + const char *name; + size_t size; + unsigned flags; + + /* + * "pool" has dual use: + * + * For the talloc pool itself (i.e. TALLOC_FLAG_POOL is set), "pool" + * marks the end of the currently allocated area. + * + * For members of the pool (i.e. TALLOC_FLAG_POOLMEM is set), "pool" + * is a pointer to the struct talloc_chunk of the pool that it was + * allocated from. This way children can quickly find the pool to chew + * from. + */ + void *pool; +}; + +/* 16 byte alignment seems to keep everyone happy */ +#define TC_HDR_SIZE ((sizeof(struct talloc_chunk)+15)&~15) +#define TC_PTR_FROM_CHUNK(tc) ((void *)(TC_HDR_SIZE + (char*)tc)) + +int talloc_version_major(void) +{ + return TALLOC_VERSION_MAJOR; +} + +int talloc_version_minor(void) +{ + return TALLOC_VERSION_MINOR; +} + +static void (*talloc_log_fn)(const char *message); + +void talloc_set_log_fn(void (*log_fn)(const char *message)) +{ + talloc_log_fn = log_fn; +} + +static void talloc_log(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2); +static void talloc_log(const char *fmt, ...) +{ + va_list ap; + char *message; + + if (!talloc_log_fn) { + return; + } + + va_start(ap, fmt); + message = talloc_vasprintf(NULL, fmt, ap); + va_end(ap); + + talloc_log_fn(message); + talloc_free(message); +} + +static void talloc_log_stderr(const char *message) +{ + fprintf(stderr, "%s", message); +} + +void talloc_set_log_stderr(void) +{ + talloc_set_log_fn(talloc_log_stderr); +} + +static void (*talloc_abort_fn)(const char *reason); + +void talloc_set_abort_fn(void (*abort_fn)(const char *reason)) +{ + talloc_abort_fn = abort_fn; +} + +static void talloc_abort(const char *reason) +{ + talloc_log("%s\n", reason); + + if (!talloc_abort_fn) { + TALLOC_ABORT(reason); + } + + talloc_abort_fn(reason); +} + +static void talloc_abort_magic(unsigned magic) +{ + unsigned striped = magic - TALLOC_MAGIC_BASE; + unsigned major = (striped & 0xFFFFF000) >> 12; + unsigned minor = (striped & 0x00000FF0) >> 4; + talloc_log("Bad talloc magic[0x%08X/%u/%u] expected[0x%08X/%u/%u]\n", + magic, major, minor, + TALLOC_MAGIC, TALLOC_VERSION_MAJOR, TALLOC_VERSION_MINOR); + talloc_abort("Bad talloc magic value - wrong talloc version used/mixed"); +} + +static void talloc_abort_double_free(void) +{ + talloc_abort("Bad talloc magic value - double free"); +} + +static void talloc_abort_unknown_value(void) +{ + talloc_abort("Bad talloc magic value - unknown value"); +} + +/* panic if we get a bad magic value */ +static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr) +{ + const char *pp = (const char *)ptr; + struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, pp - TC_HDR_SIZE); + if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) { + if ((tc->flags & (~0xFFF)) == TALLOC_MAGIC_BASE) { + talloc_abort_magic(tc->flags & (~0xF)); + return NULL; + } + + if (tc->flags & TALLOC_FLAG_FREE) { + talloc_log("talloc: double free error - first free may be at %s\n", tc->name); + talloc_abort_double_free(); + return NULL; + } else { + talloc_abort_unknown_value(); + return NULL; + } + } + return tc; +} + +/* hook into the front of the list */ +#define _TLIST_ADD(list, p) \ +do { \ + if (!(list)) { \ + (list) = (p); \ + (p)->next = (p)->prev = NULL; \ + } else { \ + (list)->prev = (p); \ + (p)->next = (list); \ + (p)->prev = NULL; \ + (list) = (p); \ + }\ +} while (0) + +/* remove an element from a list - element doesn't have to be in list. */ +#define _TLIST_REMOVE(list, p) \ +do { \ + if ((p) == (list)) { \ + (list) = (p)->next; \ + if (list) (list)->prev = NULL; \ + } else { \ + if ((p)->prev) (p)->prev->next = (p)->next; \ + if ((p)->next) (p)->next->prev = (p)->prev; \ + } \ + if ((p) && ((p) != (list))) (p)->next = (p)->prev = NULL; \ +} while (0) + + +/* + return the parent chunk of a pointer +*/ +static inline struct talloc_chunk *talloc_parent_chunk(const void *ptr) +{ + struct talloc_chunk *tc; + + if (unlikely(ptr == NULL)) { + return NULL; + } + + tc = talloc_chunk_from_ptr(ptr); + while (tc->prev) tc=tc->prev; + + return tc->parent; +} + +void *talloc_parent(const void *ptr) +{ + struct talloc_chunk *tc = talloc_parent_chunk(ptr); + return tc? TC_PTR_FROM_CHUNK(tc) : NULL; +} + +/* + find parents name +*/ +const char *talloc_parent_name(const void *ptr) +{ + struct talloc_chunk *tc = talloc_parent_chunk(ptr); + return tc? tc->name : NULL; +} + +/* + A pool carries an in-pool object count count in the first 16 bytes. + bytes. This is done to support talloc_steal() to a parent outside of the + pool. The count includes the pool itself, so a talloc_free() on a pool will + only destroy the pool if the count has dropped to zero. A talloc_free() of a + pool member will reduce the count, and eventually also call free(3) on the + pool memory. + + The object count is not put into "struct talloc_chunk" because it is only + relevant for talloc pools and the alignment to 16 bytes would increase the + memory footprint of each talloc chunk by those 16 bytes. +*/ + +#define TALLOC_POOL_HDR_SIZE 16 + +static unsigned int *talloc_pool_objectcount(struct talloc_chunk *tc) +{ + return (unsigned int *)((char *)tc + sizeof(struct talloc_chunk)); +} + +/* + Allocate from a pool +*/ + +static struct talloc_chunk *talloc_alloc_pool(struct talloc_chunk *parent, + size_t size) +{ + struct talloc_chunk *pool_ctx = NULL; + size_t space_left; + struct talloc_chunk *result; + size_t chunk_size; + + if (parent == NULL) { + return NULL; + } + + if (parent->flags & TALLOC_FLAG_POOL) { + pool_ctx = parent; + } + else if (parent->flags & TALLOC_FLAG_POOLMEM) { + pool_ctx = (struct talloc_chunk *)parent->pool; + } + + if (pool_ctx == NULL) { + return NULL; + } + + space_left = ((char *)pool_ctx + TC_HDR_SIZE + pool_ctx->size) + - ((char *)pool_ctx->pool); + + /* + * Align size to 16 bytes + */ + chunk_size = ((size + 15) & ~15); + + if (space_left < chunk_size) { + return NULL; + } + + result = (struct talloc_chunk *)pool_ctx->pool; + +#if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_UNDEFINED) + VALGRIND_MAKE_MEM_UNDEFINED(result, size); +#endif + + pool_ctx->pool = (void *)((char *)result + chunk_size); + + result->flags = TALLOC_MAGIC | TALLOC_FLAG_POOLMEM; + result->pool = pool_ctx; + + *talloc_pool_objectcount(pool_ctx) += 1; + + return result; +} + +/* + Allocate a bit of memory as a child of an existing pointer +*/ +static inline void *__talloc(const void *context, size_t size) +{ + struct talloc_chunk *tc = NULL; + + if (unlikely(context == NULL)) { + context = null_context; + } + + if (unlikely(size >= MAX_TALLOC_SIZE)) { + return NULL; + } + + if (context != NULL) { + tc = talloc_alloc_pool(talloc_chunk_from_ptr(context), + TC_HDR_SIZE+size); + } + + if (tc == NULL) { + tc = (struct talloc_chunk *)malloc(TC_HDR_SIZE+size); + if (unlikely(tc == NULL)) return NULL; + tc->flags = TALLOC_MAGIC; + tc->pool = NULL; + } + + tc->size = size; + tc->destructor = NULL; + tc->child = NULL; + tc->name = NULL; + tc->refs = NULL; + + if (likely(context)) { + struct talloc_chunk *parent = talloc_chunk_from_ptr(context); + + if (parent->child) { + parent->child->parent = NULL; + tc->next = parent->child; + tc->next->prev = tc; + } else { + tc->next = NULL; + } + tc->parent = parent; + tc->prev = NULL; + parent->child = tc; + } else { + tc->next = tc->prev = tc->parent = NULL; + } + + return TC_PTR_FROM_CHUNK(tc); +} + +/* + * Create a talloc pool + */ + +void *talloc_pool(const void *context, size_t size) +{ + void *result = __talloc(context, size + TALLOC_POOL_HDR_SIZE); + struct talloc_chunk *tc; + + if (unlikely(result == NULL)) { + return NULL; + } + + tc = talloc_chunk_from_ptr(result); + + tc->flags |= TALLOC_FLAG_POOL; + tc->pool = (char *)result + TALLOC_POOL_HDR_SIZE; + + *talloc_pool_objectcount(tc) = 1; + +#if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_NOACCESS) + VALGRIND_MAKE_MEM_NOACCESS(tc->pool, size); +#endif + + return result; +} + +/* + setup a destructor to be called on free of a pointer + the destructor should return 0 on success, or -1 on failure. + if the destructor fails then the free is failed, and the memory can + be continued to be used +*/ +void _talloc_set_destructor(const void *ptr, int (*destructor)(void *)) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + tc->destructor = destructor; +} + +/* + increase the reference count on a piece of memory. +*/ +int talloc_increase_ref_count(const void *ptr) +{ + if (unlikely(!talloc_reference(null_context, ptr))) { + return -1; + } + return 0; +} + +/* + helper for talloc_reference() + + this is referenced by a function pointer and should not be inline +*/ +static int talloc_reference_destructor(struct talloc_reference_handle *handle) +{ + struct talloc_chunk *ptr_tc = talloc_chunk_from_ptr(handle->ptr); + _TLIST_REMOVE(ptr_tc->refs, handle); + return 0; +} + +/* + more efficient way to add a name to a pointer - the name must point to a + true string constant +*/ +static inline void _talloc_set_name_const(const void *ptr, const char *name) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + tc->name = name; +} + +/* + internal talloc_named_const() +*/ +static inline void *_talloc_named_const(const void *context, size_t size, const char *name) +{ + void *ptr; + + ptr = __talloc(context, size); + if (unlikely(ptr == NULL)) { + return NULL; + } + + _talloc_set_name_const(ptr, name); + + return ptr; +} + +/* + make a secondary reference to a pointer, hanging off the given context. + the pointer remains valid until both the original caller and this given + context are freed. + + the major use for this is when two different structures need to reference the + same underlying data, and you want to be able to free the two instances separately, + and in either order +*/ +void *_talloc_reference_loc(const void *context, const void *ptr, const char *location) +{ + struct talloc_chunk *tc; + struct talloc_reference_handle *handle; + if (unlikely(ptr == NULL)) return NULL; + + tc = talloc_chunk_from_ptr(ptr); + handle = (struct talloc_reference_handle *)_talloc_named_const(context, + sizeof(struct talloc_reference_handle), + TALLOC_MAGIC_REFERENCE); + if (unlikely(handle == NULL)) return NULL; + + /* note that we hang the destructor off the handle, not the + main context as that allows the caller to still setup their + own destructor on the context if they want to */ + talloc_set_destructor(handle, talloc_reference_destructor); + handle->ptr = discard_const_p(void, ptr); + handle->location = location; + _TLIST_ADD(tc->refs, handle); + return handle->ptr; +} + +static void *_talloc_steal_internal(const void *new_ctx, const void *ptr); + +/* + internal talloc_free call +*/ +static inline int _talloc_free_internal(void *ptr, const char *location) +{ + struct talloc_chunk *tc; + + if (unlikely(ptr == NULL)) { + return -1; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (unlikely(tc->refs)) { + int is_child; + /* check this is a reference from a child or grantchild + * back to it's parent or grantparent + * + * in that case we need to remove the reference and + * call another instance of talloc_free() on the current + * pointer. + */ + is_child = talloc_is_parent(tc->refs, ptr); + _talloc_free_internal(tc->refs, location); + if (is_child) { + return _talloc_free_internal(ptr, location); + } + return -1; + } + + if (unlikely(tc->flags & TALLOC_FLAG_LOOP)) { + /* we have a free loop - stop looping */ + return 0; + } + + if (unlikely(tc->destructor)) { + talloc_destructor_t d = tc->destructor; + if (d == (talloc_destructor_t)-1) { + return -1; + } + tc->destructor = (talloc_destructor_t)-1; + if (d(ptr) == -1) { + tc->destructor = d; + return -1; + } + tc->destructor = NULL; + } + + if (tc->parent) { + _TLIST_REMOVE(tc->parent->child, tc); + if (tc->parent->child) { + tc->parent->child->parent = tc->parent; + } + } else { + if (tc->prev) tc->prev->next = tc->next; + if (tc->next) tc->next->prev = tc->prev; + } + + tc->flags |= TALLOC_FLAG_LOOP; + + while (tc->child) { + /* we need to work out who will own an abandoned child + if it cannot be freed. In priority order, the first + choice is owner of any remaining reference to this + pointer, the second choice is our parent, and the + final choice is the null context. */ + void *child = TC_PTR_FROM_CHUNK(tc->child); + const void *new_parent = null_context; + if (unlikely(tc->child->refs)) { + struct talloc_chunk *p = talloc_parent_chunk(tc->child->refs); + if (p) new_parent = TC_PTR_FROM_CHUNK(p); + } + if (unlikely(_talloc_free_internal(child, location) == -1)) { + if (new_parent == null_context) { + struct talloc_chunk *p = talloc_parent_chunk(ptr); + if (p) new_parent = TC_PTR_FROM_CHUNK(p); + } + _talloc_steal_internal(new_parent, child); + } + } + + tc->flags |= TALLOC_FLAG_FREE; + + /* we mark the freed memory with where we called the free + * from. This means on a double free error we can report where + * the first free came from + */ + tc->name = location; + + if (tc->flags & (TALLOC_FLAG_POOL|TALLOC_FLAG_POOLMEM)) { + struct talloc_chunk *pool; + unsigned int *pool_object_count; + + pool = (tc->flags & TALLOC_FLAG_POOL) + ? tc : (struct talloc_chunk *)tc->pool; + + pool_object_count = talloc_pool_objectcount(pool); + + if (*pool_object_count == 0) { + talloc_abort("Pool object count zero!"); + return 0; + } + + *pool_object_count -= 1; + + if (*pool_object_count == 0) { + free(pool); + } + } + else { + free(tc); + } + return 0; +} + +/* + move a lump of memory from one talloc context to another return the + ptr on success, or NULL if it could not be transferred. + passing NULL as ptr will always return NULL with no side effects. +*/ +static void *_talloc_steal_internal(const void *new_ctx, const void *ptr) +{ + struct talloc_chunk *tc, *new_tc; + + if (unlikely(!ptr)) { + return NULL; + } + + if (unlikely(new_ctx == NULL)) { + new_ctx = null_context; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (unlikely(new_ctx == NULL)) { + if (tc->parent) { + _TLIST_REMOVE(tc->parent->child, tc); + if (tc->parent->child) { + tc->parent->child->parent = tc->parent; + } + } else { + if (tc->prev) tc->prev->next = tc->next; + if (tc->next) tc->next->prev = tc->prev; + } + + tc->parent = tc->next = tc->prev = NULL; + return discard_const_p(void, ptr); + } + + new_tc = talloc_chunk_from_ptr(new_ctx); + + if (unlikely(tc == new_tc || tc->parent == new_tc)) { + return discard_const_p(void, ptr); + } + + if (tc->parent) { + _TLIST_REMOVE(tc->parent->child, tc); + if (tc->parent->child) { + tc->parent->child->parent = tc->parent; + } + } else { + if (tc->prev) tc->prev->next = tc->next; + if (tc->next) tc->next->prev = tc->prev; + } + + tc->parent = new_tc; + if (new_tc->child) new_tc->child->parent = NULL; + _TLIST_ADD(new_tc->child, tc); + + return discard_const_p(void, ptr); +} + +/* + move a lump of memory from one talloc context to another return the + ptr on success, or NULL if it could not be transferred. + passing NULL as ptr will always return NULL with no side effects. +*/ +void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const char *location) +{ + struct talloc_chunk *tc; + + if (unlikely(ptr == NULL)) { + return NULL; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (unlikely(tc->refs != NULL) && talloc_parent(ptr) != new_ctx) { + struct talloc_reference_handle *h; + + talloc_log("WARNING: talloc_steal with references at %s\n", + location); + + for (h=tc->refs; h; h=h->next) { + talloc_log("\treference at %s\n", + h->location); + } + } + + return _talloc_steal_internal(new_ctx, ptr); +} + +/* + this is like a talloc_steal(), but you must supply the old + parent. This resolves the ambiguity in a talloc_steal() which is + called on a context that has more than one parent (via references) + + The old parent can be either a reference or a parent +*/ +void *talloc_reparent(const void *old_parent, const void *new_parent, const void *ptr) +{ + struct talloc_chunk *tc; + struct talloc_reference_handle *h; + + if (unlikely(ptr == NULL)) { + return NULL; + } + + if (old_parent == talloc_parent(ptr)) { + return _talloc_steal_internal(new_parent, ptr); + } + + tc = talloc_chunk_from_ptr(ptr); + for (h=tc->refs;h;h=h->next) { + if (talloc_parent(h) == old_parent) { + if (_talloc_steal_internal(new_parent, h) != h) { + return NULL; + } + return discard_const_p(void, ptr); + } + } + + /* it wasn't a parent */ + return NULL; +} + +/* + remove a secondary reference to a pointer. This undo's what + talloc_reference() has done. The context and pointer arguments + must match those given to a talloc_reference() +*/ +static inline int talloc_unreference(const void *context, const void *ptr) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + struct talloc_reference_handle *h; + + if (unlikely(context == NULL)) { + context = null_context; + } + + for (h=tc->refs;h;h=h->next) { + struct talloc_chunk *p = talloc_parent_chunk(h); + if (p == NULL) { + if (context == NULL) break; + } else if (TC_PTR_FROM_CHUNK(p) == context) { + break; + } + } + if (h == NULL) { + return -1; + } + + return _talloc_free_internal(h, __location__); +} + +/* + remove a specific parent context from a pointer. This is a more + controlled varient of talloc_free() +*/ +int talloc_unlink(const void *context, void *ptr) +{ + struct talloc_chunk *tc_p, *new_p; + void *new_parent; + + if (ptr == NULL) { + return -1; + } + + if (context == NULL) { + context = null_context; + } + + if (talloc_unreference(context, ptr) == 0) { + return 0; + } + + if (context == NULL) { + if (talloc_parent_chunk(ptr) != NULL) { + return -1; + } + } else { + if (talloc_chunk_from_ptr(context) != talloc_parent_chunk(ptr)) { + return -1; + } + } + + tc_p = talloc_chunk_from_ptr(ptr); + + if (tc_p->refs == NULL) { + return _talloc_free_internal(ptr, __location__); + } + + new_p = talloc_parent_chunk(tc_p->refs); + if (new_p) { + new_parent = TC_PTR_FROM_CHUNK(new_p); + } else { + new_parent = NULL; + } + + if (talloc_unreference(new_parent, ptr) != 0) { + return -1; + } + + _talloc_steal_internal(new_parent, ptr); + + return 0; +} + +/* + add a name to an existing pointer - va_list version +*/ +static inline const char *talloc_set_name_v(const void *ptr, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); + +static inline const char *talloc_set_name_v(const void *ptr, const char *fmt, va_list ap) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + tc->name = talloc_vasprintf(ptr, fmt, ap); + if (likely(tc->name)) { + _talloc_set_name_const(tc->name, ".name"); + } + return tc->name; +} + +/* + add a name to an existing pointer +*/ +const char *talloc_set_name(const void *ptr, const char *fmt, ...) +{ + const char *name; + va_list ap; + va_start(ap, fmt); + name = talloc_set_name_v(ptr, fmt, ap); + va_end(ap); + return name; +} + + +/* + create a named talloc pointer. Any talloc pointer can be named, and + talloc_named() operates just like talloc() except that it allows you + to name the pointer. +*/ +void *talloc_named(const void *context, size_t size, const char *fmt, ...) +{ + va_list ap; + void *ptr; + const char *name; + + ptr = __talloc(context, size); + if (unlikely(ptr == NULL)) return NULL; + + va_start(ap, fmt); + name = talloc_set_name_v(ptr, fmt, ap); + va_end(ap); + + if (unlikely(name == NULL)) { + _talloc_free_internal(ptr, __location__); + return NULL; + } + + return ptr; +} + +/* + return the name of a talloc ptr, or "UNNAMED" +*/ +const char *talloc_get_name(const void *ptr) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + if (unlikely(tc->name == TALLOC_MAGIC_REFERENCE)) { + return ".reference"; + } + if (likely(tc->name)) { + return tc->name; + } + return "UNNAMED"; +} + + +/* + check if a pointer has the given name. If it does, return the pointer, + otherwise return NULL +*/ +void *talloc_check_name(const void *ptr, const char *name) +{ + const char *pname; + if (unlikely(ptr == NULL)) return NULL; + pname = talloc_get_name(ptr); + if (likely(pname == name || strcmp(pname, name) == 0)) { + return discard_const_p(void, ptr); + } + return NULL; +} + +static void talloc_abort_type_missmatch(const char *location, + const char *name, + const char *expected) +{ + const char *reason; + + reason = talloc_asprintf(NULL, + "%s: Type mismatch: name[%s] expected[%s]", + location, + name?name:"NULL", + expected); + if (!reason) { + reason = "Type mismatch"; + } + + talloc_abort(reason); +} + +void *_talloc_get_type_abort(const void *ptr, const char *name, const char *location) +{ + const char *pname; + + if (unlikely(ptr == NULL)) { + talloc_abort_type_missmatch(location, NULL, name); + return NULL; + } + + pname = talloc_get_name(ptr); + if (likely(pname == name || strcmp(pname, name) == 0)) { + return discard_const_p(void, ptr); + } + + talloc_abort_type_missmatch(location, pname, name); + return NULL; +} + +/* + this is for compatibility with older versions of talloc +*/ +void *talloc_init(const char *fmt, ...) +{ + va_list ap; + void *ptr; + const char *name; + + /* + * samba3 expects talloc_report_depth_cb(NULL, ...) + * reports all talloc'ed memory, so we need to enable + * null_tracking + */ + talloc_enable_null_tracking(); + + ptr = __talloc(NULL, 0); + if (unlikely(ptr == NULL)) return NULL; + + va_start(ap, fmt); + name = talloc_set_name_v(ptr, fmt, ap); + va_end(ap); + + if (unlikely(name == NULL)) { + _talloc_free_internal(ptr, __location__); + return NULL; + } + + return ptr; +} + +/* + this is a replacement for the Samba3 talloc_destroy_pool functionality. It + should probably not be used in new code. It's in here to keep the talloc + code consistent across Samba 3 and 4. +*/ +void talloc_free_children(void *ptr) +{ + struct talloc_chunk *tc; + + if (unlikely(ptr == NULL)) { + return; + } + + tc = talloc_chunk_from_ptr(ptr); + + while (tc->child) { + /* we need to work out who will own an abandoned child + if it cannot be freed. In priority order, the first + choice is owner of any remaining reference to this + pointer, the second choice is our parent, and the + final choice is the null context. */ + void *child = TC_PTR_FROM_CHUNK(tc->child); + const void *new_parent = null_context; + if (unlikely(tc->child->refs)) { + struct talloc_chunk *p = talloc_parent_chunk(tc->child->refs); + if (p) new_parent = TC_PTR_FROM_CHUNK(p); + } + if (unlikely(talloc_free(child) == -1)) { + if (new_parent == null_context) { + struct talloc_chunk *p = talloc_parent_chunk(ptr); + if (p) new_parent = TC_PTR_FROM_CHUNK(p); + } + _talloc_steal_internal(new_parent, child); + } + } + + if ((tc->flags & TALLOC_FLAG_POOL) + && (*talloc_pool_objectcount(tc) == 1)) { + tc->pool = ((char *)tc + TC_HDR_SIZE + TALLOC_POOL_HDR_SIZE); +#if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_NOACCESS) + VALGRIND_MAKE_MEM_NOACCESS( + tc->pool, tc->size - TALLOC_POOL_HDR_SIZE); +#endif + } +} + +/* + Allocate a bit of memory as a child of an existing pointer +*/ +void *_talloc(const void *context, size_t size) +{ + return __talloc(context, size); +} + +/* + externally callable talloc_set_name_const() +*/ +void talloc_set_name_const(const void *ptr, const char *name) +{ + _talloc_set_name_const(ptr, name); +} + +/* + create a named talloc pointer. Any talloc pointer can be named, and + talloc_named() operates just like talloc() except that it allows you + to name the pointer. +*/ +void *talloc_named_const(const void *context, size_t size, const char *name) +{ + return _talloc_named_const(context, size, name); +} + +/* + free a talloc pointer. This also frees all child pointers of this + pointer recursively + + return 0 if the memory is actually freed, otherwise -1. The memory + will not be freed if the ref_count is > 1 or the destructor (if + any) returns non-zero +*/ +int _talloc_free(void *ptr, const char *location) +{ + struct talloc_chunk *tc; + + if (unlikely(ptr == NULL)) { + return -1; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (unlikely(tc->refs != NULL)) { + struct talloc_reference_handle *h; + + talloc_log("ERROR: talloc_free with references at %s\n", + location); + + for (h=tc->refs; h; h=h->next) { + talloc_log("\treference at %s\n", + h->location); + } + return -1; + } + + return _talloc_free_internal(ptr, location); +} + + + +/* + A talloc version of realloc. The context argument is only used if + ptr is NULL +*/ +void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name) +{ + struct talloc_chunk *tc; + void *new_ptr; + bool malloced = false; + + /* size zero is equivalent to free() */ + if (unlikely(size == 0)) { + talloc_unlink(context, ptr); + return NULL; + } + + if (unlikely(size >= MAX_TALLOC_SIZE)) { + return NULL; + } + + /* realloc(NULL) is equivalent to malloc() */ + if (ptr == NULL) { + return _talloc_named_const(context, size, name); + } + + tc = talloc_chunk_from_ptr(ptr); + + /* don't allow realloc on referenced pointers */ + if (unlikely(tc->refs)) { + return NULL; + } + + /* don't let anybody try to realloc a talloc_pool */ + if (unlikely(tc->flags & TALLOC_FLAG_POOL)) { + return NULL; + } + + /* don't shrink if we have less than 1k to gain */ + if ((size < tc->size) && ((tc->size - size) < 1024)) { + tc->size = size; + return ptr; + } + + /* by resetting magic we catch users of the old memory */ + tc->flags |= TALLOC_FLAG_FREE; + +#if ALWAYS_REALLOC + new_ptr = malloc(size + TC_HDR_SIZE); + if (new_ptr) { + memcpy(new_ptr, tc, tc->size + TC_HDR_SIZE); + free(tc); + } +#else + if (tc->flags & TALLOC_FLAG_POOLMEM) { + + new_ptr = talloc_alloc_pool(tc, size + TC_HDR_SIZE); + *talloc_pool_objectcount((struct talloc_chunk *) + (tc->pool)) -= 1; + + if (new_ptr == NULL) { + new_ptr = malloc(TC_HDR_SIZE+size); + malloced = true; + } + + if (new_ptr) { + memcpy(new_ptr, tc, TALLOC_MIN(tc->size,size) + TC_HDR_SIZE); + } + } + else { + new_ptr = realloc(tc, size + TC_HDR_SIZE); + } +#endif + if (unlikely(!new_ptr)) { + tc->flags &= ~TALLOC_FLAG_FREE; + return NULL; + } + + tc = (struct talloc_chunk *)new_ptr; + tc->flags &= ~TALLOC_FLAG_FREE; + if (malloced) { + tc->flags &= ~TALLOC_FLAG_POOLMEM; + } + if (tc->parent) { + tc->parent->child = tc; + } + if (tc->child) { + tc->child->parent = tc; + } + + if (tc->prev) { + tc->prev->next = tc; + } + if (tc->next) { + tc->next->prev = tc; + } + + tc->size = size; + _talloc_set_name_const(TC_PTR_FROM_CHUNK(tc), name); + + return TC_PTR_FROM_CHUNK(tc); +} + +/* + a wrapper around talloc_steal() for situations where you are moving a pointer + between two structures, and want the old pointer to be set to NULL +*/ +void *_talloc_move(const void *new_ctx, const void *_pptr) +{ + const void **pptr = discard_const_p(const void *,_pptr); + void *ret = talloc_steal(new_ctx, discard_const_p(void, *pptr)); + (*pptr) = NULL; + return ret; +} + +/* + return the total size of a talloc pool (subtree) +*/ +size_t talloc_total_size(const void *ptr) +{ + size_t total = 0; + struct talloc_chunk *c, *tc; + + if (ptr == NULL) { + ptr = null_context; + } + if (ptr == NULL) { + return 0; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (tc->flags & TALLOC_FLAG_LOOP) { + return 0; + } + + tc->flags |= TALLOC_FLAG_LOOP; + + if (likely(tc->name != TALLOC_MAGIC_REFERENCE)) { + total = tc->size; + } + for (c=tc->child;c;c=c->next) { + total += talloc_total_size(TC_PTR_FROM_CHUNK(c)); + } + + tc->flags &= ~TALLOC_FLAG_LOOP; + + return total; +} + +/* + return the total number of blocks in a talloc pool (subtree) +*/ +size_t talloc_total_blocks(const void *ptr) +{ + size_t total = 0; + struct talloc_chunk *c, *tc; + + if (ptr == NULL) { + ptr = null_context; + } + if (ptr == NULL) { + return 0; + } + + tc = talloc_chunk_from_ptr(ptr); + + if (tc->flags & TALLOC_FLAG_LOOP) { + return 0; + } + + tc->flags |= TALLOC_FLAG_LOOP; + + total++; + for (c=tc->child;c;c=c->next) { + total += talloc_total_blocks(TC_PTR_FROM_CHUNK(c)); + } + + tc->flags &= ~TALLOC_FLAG_LOOP; + + return total; +} + +/* + return the number of external references to a pointer +*/ +size_t talloc_reference_count(const void *ptr) +{ + struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr); + struct talloc_reference_handle *h; + size_t ret = 0; + + for (h=tc->refs;h;h=h->next) { + ret++; + } + return ret; +} + +/* + report on memory usage by all children of a pointer, giving a full tree view +*/ +void talloc_report_depth_cb(const void *ptr, int depth, int max_depth, + void (*callback)(const void *ptr, + int depth, int max_depth, + int is_ref, + void *private_data), + void *private_data) +{ + struct talloc_chunk *c, *tc; + + if (ptr == NULL) { + ptr = null_context; + } + if (ptr == NULL) return; + + tc = talloc_chunk_from_ptr(ptr); + + if (tc->flags & TALLOC_FLAG_LOOP) { + return; + } + + callback(ptr, depth, max_depth, 0, private_data); + + if (max_depth >= 0 && depth >= max_depth) { + return; + } + + tc->flags |= TALLOC_FLAG_LOOP; + for (c=tc->child;c;c=c->next) { + if (c->name == TALLOC_MAGIC_REFERENCE) { + struct talloc_reference_handle *h = (struct talloc_reference_handle *)TC_PTR_FROM_CHUNK(c); + callback(h->ptr, depth + 1, max_depth, 1, private_data); + } else { + talloc_report_depth_cb(TC_PTR_FROM_CHUNK(c), depth + 1, max_depth, callback, private_data); + } + } + tc->flags &= ~TALLOC_FLAG_LOOP; +} + +static void talloc_report_depth_FILE_helper(const void *ptr, int depth, int max_depth, int is_ref, void *_f) +{ + const char *name = talloc_get_name(ptr); + FILE *f = (FILE *)_f; + + if (is_ref) { + fprintf(f, "%*sreference to: %s\n", depth*4, "", name); + return; + } + + if (depth == 0) { + fprintf(f,"%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", + (max_depth < 0 ? "full " :""), name, + (unsigned long)talloc_total_size(ptr), + (unsigned long)talloc_total_blocks(ptr)); + return; + } + + fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d) %p\n", + depth*4, "", + name, + (unsigned long)talloc_total_size(ptr), + (unsigned long)talloc_total_blocks(ptr), + (int)talloc_reference_count(ptr), ptr); + +#if 0 + fprintf(f, "content: "); + if (talloc_total_size(ptr)) { + int tot = talloc_total_size(ptr); + int i; + + for (i = 0; i < tot; i++) { + if ((((char *)ptr)[i] > 31) && (((char *)ptr)[i] < 126)) { + fprintf(f, "%c", ((char *)ptr)[i]); + } else { + fprintf(f, "~%02x", ((char *)ptr)[i]); + } + } + } + fprintf(f, "\n"); +#endif +} + +/* + report on memory usage by all children of a pointer, giving a full tree view +*/ +void talloc_report_depth_file(const void *ptr, int depth, int max_depth, FILE *f) +{ + if (f) { + talloc_report_depth_cb(ptr, depth, max_depth, talloc_report_depth_FILE_helper, f); + fflush(f); + } +} + +/* + report on memory usage by all children of a pointer, giving a full tree view +*/ +void talloc_report_full(const void *ptr, FILE *f) +{ + talloc_report_depth_file(ptr, 0, -1, f); +} + +/* + report on memory usage by all children of a pointer +*/ +void talloc_report(const void *ptr, FILE *f) +{ + talloc_report_depth_file(ptr, 0, 1, f); +} + +/* + report on any memory hanging off the null context +*/ +static void talloc_report_null(void) +{ + if (talloc_total_size(null_context) != 0) { + talloc_report(null_context, stderr); + } +} + +/* + report on any memory hanging off the null context +*/ +static void talloc_report_null_full(void) +{ + if (talloc_total_size(null_context) != 0) { + talloc_report_full(null_context, stderr); + } +} + +/* + enable tracking of the NULL context +*/ +void talloc_enable_null_tracking(void) +{ + if (null_context == NULL) { + null_context = _talloc_named_const(NULL, 0, "null_context"); + if (autofree_context != NULL) { + talloc_reparent(NULL, null_context, autofree_context); + } + } +} + +/* + enable tracking of the NULL context, not moving the autofree context + into the NULL context. This is needed for the talloc testsuite +*/ +void talloc_enable_null_tracking_no_autofree(void) +{ + if (null_context == NULL) { + null_context = _talloc_named_const(NULL, 0, "null_context"); + } +} + +/* + disable tracking of the NULL context +*/ +void talloc_disable_null_tracking(void) +{ + if (null_context != NULL) { + /* we have to move any children onto the real NULL + context */ + struct talloc_chunk *tc, *tc2; + tc = talloc_chunk_from_ptr(null_context); + for (tc2 = tc->child; tc2; tc2=tc2->next) { + if (tc2->parent == tc) tc2->parent = NULL; + if (tc2->prev == tc) tc2->prev = NULL; + } + for (tc2 = tc->next; tc2; tc2=tc2->next) { + if (tc2->parent == tc) tc2->parent = NULL; + if (tc2->prev == tc) tc2->prev = NULL; + } + tc->child = NULL; + tc->next = NULL; + } + talloc_free(null_context); + null_context = NULL; +} + +/* + enable leak reporting on exit +*/ +void talloc_enable_leak_report(void) +{ + talloc_enable_null_tracking(); + atexit(talloc_report_null); +} + +/* + enable full leak reporting on exit +*/ +void talloc_enable_leak_report_full(void) +{ + talloc_enable_null_tracking(); + atexit(talloc_report_null_full); +} + +/* + talloc and zero memory. +*/ +void *_talloc_zero(const void *ctx, size_t size, const char *name) +{ + void *p = _talloc_named_const(ctx, size, name); + + if (p) { + memset(p, '\0', size); + } + + return p; +} + +/* + memdup with a talloc. +*/ +void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name) +{ + void *newp = _talloc_named_const(t, size, name); + + if (likely(newp)) { + memcpy(newp, p, size); + } + + return newp; +} + +static inline char *__talloc_strlendup(const void *t, const char *p, size_t len) +{ + char *ret; + + ret = (char *)__talloc(t, len + 1); + if (unlikely(!ret)) return NULL; + + memcpy(ret, p, len); + ret[len] = 0; + + _talloc_set_name_const(ret, ret); + return ret; +} + +/* + strdup with a talloc +*/ +char *talloc_strdup(const void *t, const char *p) +{ + if (unlikely(!p)) return NULL; + return __talloc_strlendup(t, p, strlen(p)); +} + +/* + strndup with a talloc +*/ +char *talloc_strndup(const void *t, const char *p, size_t n) +{ + if (unlikely(!p)) return NULL; + return __talloc_strlendup(t, p, strnlen(p, n)); +} + +static inline char *__talloc_strlendup_append(char *s, size_t slen, + const char *a, size_t alen) +{ + char *ret; + + ret = talloc_realloc(NULL, s, char, slen + alen + 1); + if (unlikely(!ret)) return NULL; + + /* append the string and the trailing \0 */ + memcpy(&ret[slen], a, alen); + ret[slen+alen] = 0; + + _talloc_set_name_const(ret, ret); + return ret; +} + +/* + * Appends at the end of the string. + */ +char *talloc_strdup_append(char *s, const char *a) +{ + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + return __talloc_strlendup_append(s, strlen(s), a, strlen(a)); +} + +/* + * Appends at the end of the talloc'ed buffer, + * not the end of the string. + */ +char *talloc_strdup_append_buffer(char *s, const char *a) +{ + size_t slen; + + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + slen = talloc_get_size(s); + if (likely(slen > 0)) { + slen--; + } + + return __talloc_strlendup_append(s, slen, a, strlen(a)); +} + +/* + * Appends at the end of the string. + */ +char *talloc_strndup_append(char *s, const char *a, size_t n) +{ + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + return __talloc_strlendup_append(s, strlen(s), a, strnlen(a, n)); +} + +/* + * Appends at the end of the talloc'ed buffer, + * not the end of the string. + */ +char *talloc_strndup_append_buffer(char *s, const char *a, size_t n) +{ + size_t slen; + + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + slen = talloc_get_size(s); + if (likely(slen > 0)) { + slen--; + } + + return __talloc_strlendup_append(s, slen, a, strnlen(a, n)); +} + +#ifndef va_copy +#ifdef HAVE___VA_COPY +#define va_copy(dest, src) __va_copy(dest, src) +#else +#define va_copy(dest, src) (dest) = (src) +#endif +#endif + +char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) +{ + int len; + char *ret; + va_list ap2; + char c; + + /* this call looks strange, but it makes it work on older solaris boxes */ + va_copy(ap2, ap); + #ifdef _MSC_VER + /* MSVC runtime needs to use _vcsprintf to return buffer size; vsnprintf would return -1 */ + len = _vscprintf(fmt, ap2); + #else + len = vsnprintf(&c, 1, fmt, ap2); + #endif + va_end(ap2); + if (unlikely(len < 0)) { + return NULL; + } + + ret = (char *)__talloc(t, len+1); + if (unlikely(!ret)) return NULL; + + va_copy(ap2, ap); + vsnprintf(ret, len+1, fmt, ap2); + va_end(ap2); + + _talloc_set_name_const(ret, ret); + return ret; +} + + +/* + Perform string formatting, and return a pointer to newly allocated + memory holding the result, inside a memory pool. + */ +char *talloc_asprintf(const void *t, const char *fmt, ...) +{ + va_list ap; + char *ret; + + va_start(ap, fmt); + ret = talloc_vasprintf(t, fmt, ap); + va_end(ap); + return ret; +} + +static inline char *__talloc_vaslenprintf_append(char *s, size_t slen, + const char *fmt, va_list ap) + PRINTF_ATTRIBUTE(3,0); + +static inline char *__talloc_vaslenprintf_append(char *s, size_t slen, + const char *fmt, va_list ap) +{ + ssize_t alen; + va_list ap2; + char c; + + va_copy(ap2, ap); + #ifdef _MSC_VER + /* MSVC runtime needs to use _vcsprintf to return buffer size; vsnprintf would return -1 */ + alen = _vscprintf(fmt, ap2); + #else + alen = vsnprintf(&c, 1, fmt, ap2); + #endif + va_end(ap2); + + if (alen <= 0) { + /* Either the vsnprintf failed or the format resulted in + * no characters being formatted. In the former case, we + * ought to return NULL, in the latter we ought to return + * the original string. Most current callers of this + * function expect it to never return NULL. + */ + return s; + } + + s = talloc_realloc(NULL, s, char, slen + alen + 1); + if (!s) return NULL; + + va_copy(ap2, ap); + vsnprintf(s + slen, alen + 1, fmt, ap2); + va_end(ap2); + + _talloc_set_name_const(s, s); + return s; +} + +/** + * Realloc @p s to append the formatted result of @p fmt and @p ap, + * and return @p s, which may have moved. Good for gradually + * accumulating output into a string buffer. Appends at the end + * of the string. + **/ +char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) +{ + if (unlikely(!s)) { + return talloc_vasprintf(NULL, fmt, ap); + } + + return __talloc_vaslenprintf_append(s, strlen(s), fmt, ap); +} + +/** + * Realloc @p s to append the formatted result of @p fmt and @p ap, + * and return @p s, which may have moved. Always appends at the + * end of the talloc'ed buffer, not the end of the string. + **/ +char *talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) +{ + size_t slen; + + if (unlikely(!s)) { + return talloc_vasprintf(NULL, fmt, ap); + } + + slen = talloc_get_size(s); + if (likely(slen > 0)) { + slen--; + } + + return __talloc_vaslenprintf_append(s, slen, fmt, ap); +} + +/* + Realloc @p s to append the formatted result of @p fmt and return @p + s, which may have moved. Good for gradually accumulating output + into a string buffer. + */ +char *talloc_asprintf_append(char *s, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + s = talloc_vasprintf_append(s, fmt, ap); + va_end(ap); + return s; +} + +/* + Realloc @p s to append the formatted result of @p fmt and return @p + s, which may have moved. Good for gradually accumulating output + into a buffer. + */ +char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + s = talloc_vasprintf_append_buffer(s, fmt, ap); + va_end(ap); + return s; +} + +/* + alloc an array, checking for integer overflow in the array size +*/ +void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name) +{ + if (count >= MAX_TALLOC_SIZE/el_size) { + return NULL; + } + return _talloc_named_const(ctx, el_size * count, name); +} + +/* + alloc an zero array, checking for integer overflow in the array size +*/ +void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name) +{ + if (count >= MAX_TALLOC_SIZE/el_size) { + return NULL; + } + return _talloc_zero(ctx, el_size * count, name); +} + +/* + realloc an array, checking for integer overflow in the array size +*/ +void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name) +{ + if (count >= MAX_TALLOC_SIZE/el_size) { + return NULL; + } + return _talloc_realloc(ctx, ptr, el_size * count, name); +} + +/* + a function version of talloc_realloc(), so it can be passed as a function pointer + to libraries that want a realloc function (a realloc function encapsulates + all the basic capabilities of an allocation library, which is why this is useful) +*/ +void *talloc_realloc_fn(const void *context, void *ptr, size_t size) +{ + return _talloc_realloc(context, ptr, size, NULL); +} + + +static int talloc_autofree_destructor(void *ptr) +{ + autofree_context = NULL; + return 0; +} + +static void talloc_autofree(void) +{ + talloc_free(autofree_context); +} + +/* + return a context which will be auto-freed on exit + this is useful for reducing the noise in leak reports +*/ +void *talloc_autofree_context(void) +{ + if (autofree_context == NULL) { + autofree_context = _talloc_named_const(NULL, 0, "autofree_context"); + talloc_set_destructor(autofree_context, talloc_autofree_destructor); + atexit(talloc_autofree); + } + return autofree_context; +} + +size_t talloc_get_size(const void *context) +{ + struct talloc_chunk *tc; + + if (context == NULL) { + context = null_context; + } + if (context == NULL) { + return 0; + } + + tc = talloc_chunk_from_ptr(context); + + return tc->size; +} + +/* + find a parent of this context that has the given name, if any +*/ +void *talloc_find_parent_byname(const void *context, const char *name) +{ + struct talloc_chunk *tc; + + if (context == NULL) { + return NULL; + } + + tc = talloc_chunk_from_ptr(context); + while (tc) { + if (tc->name && strcmp(tc->name, name) == 0) { + return TC_PTR_FROM_CHUNK(tc); + } + while (tc && tc->prev) tc = tc->prev; + if (tc) { + tc = tc->parent; + } + } + return NULL; +} + +/* + show the parentage of a context +*/ +void talloc_show_parents(const void *context, FILE *file) +{ + struct talloc_chunk *tc; + + if (context == NULL) { + fprintf(file, "talloc no parents for NULL\n"); + return; + } + + tc = talloc_chunk_from_ptr(context); + fprintf(file, "talloc parents of '%s'\n", talloc_get_name(context)); + while (tc) { + fprintf(file, "\t'%s'\n", talloc_get_name(TC_PTR_FROM_CHUNK(tc))); + while (tc && tc->prev) tc = tc->prev; + if (tc) { + tc = tc->parent; + } + } + fflush(file); +} + +/* + return 1 if ptr is a parent of context +*/ +int talloc_is_parent(const void *context, const void *ptr) +{ + struct talloc_chunk *tc; + + if (context == NULL) { + return 0; + } + + tc = talloc_chunk_from_ptr(context); + while (tc) { + if (TC_PTR_FROM_CHUNK(tc) == ptr) return 1; + while (tc && tc->prev) tc = tc->prev; + if (tc) { + tc = tc->parent; + } + } + return 0; +} --- mesa-7.9~git20100924.orig/src/talloc/talloc.h +++ mesa-7.9~git20100924/src/talloc/talloc.h @@ -0,0 +1,202 @@ +#ifndef _TALLOC_H_ +#define _TALLOC_H_ +/* + Unix SMB/CIFS implementation. + Samba temporary memory allocation functions + + Copyright (C) Andrew Tridgell 2004-2005 + Copyright (C) Stefan Metzmacher 2006 + + ** NOTE! The following LGPL license applies to the talloc + ** library. This does NOT imply that all of Samba is released + ** under the LGPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . +*/ + +#include +#include +#include + +#define TALLOC_VERSION_MAJOR 2 +#define TALLOC_VERSION_MINOR 0 + +int talloc_version_major(void); +int talloc_version_minor(void); + +/* this is only needed for compatibility with the old talloc */ +typedef void TALLOC_CTX; + +/* + this uses a little trick to allow __LINE__ to be stringified +*/ +#ifndef __location__ +#define __TALLOC_STRING_LINE1__(s) #s +#define __TALLOC_STRING_LINE2__(s) __TALLOC_STRING_LINE1__(s) +#define __TALLOC_STRING_LINE3__ __TALLOC_STRING_LINE2__(__LINE__) +#define __location__ __FILE__ ":" __TALLOC_STRING_LINE3__ +#endif + +#ifndef TALLOC_DEPRECATED +#define TALLOC_DEPRECATED 0 +#endif + +#ifndef PRINTF_ATTRIBUTE +#if (__GNUC__ >= 3) +/** Use gcc attribute to check printf fns. a1 is the 1-based index of + * the parameter containing the format, and a2 the index of the first + * argument. Note that some gcc 2.x versions don't handle this + * properly **/ +#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) +#else +#define PRINTF_ATTRIBUTE(a1, a2) +#endif +#endif + +/* try to make talloc_set_destructor() and talloc_steal() type safe, + if we have a recent gcc */ +#if (__GNUC__ >= 3) +#define _TALLOC_TYPEOF(ptr) __typeof__(ptr) +#define talloc_set_destructor(ptr, function) \ + do { \ + int (*_talloc_destructor_fn)(_TALLOC_TYPEOF(ptr)) = (function); \ + _talloc_set_destructor((ptr), (int (*)(void *))_talloc_destructor_fn); \ + } while(0) +/* this extremely strange macro is to avoid some braindamaged warning + stupidity in gcc 4.1.x */ +#define talloc_steal(ctx, ptr) ({ _TALLOC_TYPEOF(ptr) __talloc_steal_ret = (_TALLOC_TYPEOF(ptr))_talloc_steal_loc((ctx),(ptr), __location__); __talloc_steal_ret; }) +#else +#define talloc_set_destructor(ptr, function) \ + _talloc_set_destructor((ptr), (int (*)(void *))(function)) +#define _TALLOC_TYPEOF(ptr) void * +#define talloc_steal(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_steal_loc((ctx),(ptr), __location__) +#endif + +#define talloc_reference(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_reference_loc((ctx),(ptr), __location__) +#define talloc_move(ctx, ptr) (_TALLOC_TYPEOF(*(ptr)))_talloc_move((ctx),(void *)(ptr)) + +/* useful macros for creating type checked pointers */ +#define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) +#define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__) +#define talloc_ptrtype(ctx, ptr) (_TALLOC_TYPEOF(ptr))talloc_size(ctx, sizeof(*(ptr))) + +#define talloc_new(ctx) talloc_named_const(ctx, 0, "talloc_new: " __location__) + +#define talloc_zero(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) +#define talloc_zero_size(ctx, size) _talloc_zero(ctx, size, __location__) + +#define talloc_zero_array(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) +#define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) +#define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__) +#define talloc_array_ptrtype(ctx, ptr, count) (_TALLOC_TYPEOF(ptr))talloc_array_size(ctx, sizeof(*(ptr)), count) +#define talloc_array_length(ctx) (talloc_get_size(ctx)/sizeof(*ctx)) + +#define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type) +#define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__) + +#define talloc_memdup(t, p, size) _talloc_memdup(t, p, size, __location__) + +#define talloc_set_type(ptr, type) talloc_set_name_const(ptr, #type) +#define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type) +#define talloc_get_type_abort(ptr, type) (type *)_talloc_get_type_abort(ptr, #type, __location__) + +#define talloc_find_parent_bytype(ptr, type) (type *)talloc_find_parent_byname(ptr, #type) +#define talloc_free(ctx) _talloc_free(ctx, __location__) + + +#if TALLOC_DEPRECATED +#define talloc_zero_p(ctx, type) talloc_zero(ctx, type) +#define talloc_p(ctx, type) talloc(ctx, type) +#define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count) +#define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count) +#define talloc_destroy(ctx) talloc_free(ctx) +#define talloc_append_string(c, s, a) (s?talloc_strdup_append(s,a):talloc_strdup(c, a)) +#endif + +#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) + +/* The following definitions come from talloc.c */ +void *_talloc(const void *context, size_t size); +void *talloc_pool(const void *context, size_t size); +void _talloc_set_destructor(const void *ptr, int (*_destructor)(void *)); +int talloc_increase_ref_count(const void *ptr); +size_t talloc_reference_count(const void *ptr); +void *_talloc_reference_loc(const void *context, const void *ptr, const char *location); +int talloc_unlink(const void *context, void *ptr); +const char *talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); +void talloc_set_name_const(const void *ptr, const char *name); +void *talloc_named(const void *context, size_t size, + const char *fmt, ...) PRINTF_ATTRIBUTE(3,4); +void *talloc_named_const(const void *context, size_t size, const char *name); +const char *talloc_get_name(const void *ptr); +void *talloc_check_name(const void *ptr, const char *name); +void *_talloc_get_type_abort(const void *ptr, const char *name, const char *location); +void *talloc_parent(const void *ptr); +const char *talloc_parent_name(const void *ptr); +void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2); +int _talloc_free(void *ptr, const char *location); +void talloc_free_children(void *ptr); +void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name); +void *_talloc_steal_loc(const void *new_ctx, const void *ptr, const char *location); +void *talloc_reparent(const void *old_parent, const void *new_parent, const void *ptr); +void *_talloc_move(const void *new_ctx, const void *pptr); +size_t talloc_total_size(const void *ptr); +size_t talloc_total_blocks(const void *ptr); +void talloc_report_depth_cb(const void *ptr, int depth, int max_depth, + void (*callback)(const void *ptr, + int depth, int max_depth, + int is_ref, + void *private_data), + void *private_data); +void talloc_report_depth_file(const void *ptr, int depth, int max_depth, FILE *f); +void talloc_report_full(const void *ptr, FILE *f); +void talloc_report(const void *ptr, FILE *f); +void talloc_enable_null_tracking(void); +void talloc_enable_null_tracking_no_autofree(void); +void talloc_disable_null_tracking(void); +void talloc_enable_leak_report(void); +void talloc_enable_leak_report_full(void); +void *_talloc_zero(const void *ctx, size_t size, const char *name); +void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name); +void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name); +void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name); +void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name); +void *talloc_realloc_fn(const void *context, void *ptr, size_t size); +void *talloc_autofree_context(void); +size_t talloc_get_size(const void *ctx); +void *talloc_find_parent_byname(const void *ctx, const char *name); +void talloc_show_parents(const void *context, FILE *file); +int talloc_is_parent(const void *context, const void *ptr); + +char *talloc_strdup(const void *t, const char *p); +char *talloc_strdup_append(char *s, const char *a); +char *talloc_strdup_append_buffer(char *s, const char *a); + +char *talloc_strndup(const void *t, const char *p, size_t n); +char *talloc_strndup_append(char *s, const char *a, size_t n); +char *talloc_strndup_append_buffer(char *s, const char *a, size_t n); + +char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); +char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); +char *talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); + +char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); +char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); +char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); + +void talloc_set_abort_fn(void (*abort_fn)(const char *reason)); +void talloc_set_log_fn(void (*log_fn)(const char *message)); +void talloc_set_log_stderr(void); + +#endif --- mesa-7.9~git20100924.orig/src/talloc/talloc.def +++ mesa-7.9~git20100924/src/talloc/talloc.def @@ -0,0 +1,63 @@ +EXPORTS + _talloc + _talloc_array + _talloc_free + _talloc_get_type_abort + _talloc_memdup + _talloc_move + _talloc_realloc + _talloc_realloc_array + _talloc_reference_loc + _talloc_set_destructor + _talloc_steal_loc + _talloc_zero + _talloc_zero_array + talloc_asprintf + talloc_asprintf_append + talloc_asprintf_append_buffer + talloc_autofree_context + talloc_check_name + talloc_disable_null_tracking + talloc_enable_leak_report + talloc_enable_leak_report_full + talloc_enable_null_tracking + talloc_enable_null_tracking_no_autofree + talloc_find_parent_byname + talloc_free_children + talloc_get_name + talloc_get_size + talloc_increase_ref_count + talloc_init + talloc_is_parent + talloc_named + talloc_named_const + talloc_parent + talloc_parent_name + talloc_pool + talloc_realloc_fn + talloc_reference_count + talloc_reparent + talloc_report + talloc_report_depth_cb + talloc_report_depth_file + talloc_report_full + talloc_set_abort_fn + talloc_set_log_fn + talloc_set_log_stderr + talloc_set_name + talloc_set_name_const + talloc_show_parents + talloc_strdup + talloc_strdup_append + talloc_strdup_append_buffer + talloc_strndup + talloc_strndup_append + talloc_strndup_append_buffer + talloc_total_blocks + talloc_total_size + talloc_unlink + talloc_vasprintf + talloc_vasprintf_append + talloc_vasprintf_append_buffer + talloc_version_major + talloc_version_minor --- mesa-7.9~git20100924.orig/src/talloc/SConscript +++ mesa-7.9~git20100924/src/talloc/SConscript @@ -0,0 +1,20 @@ +Import('*') + +if env['platform'] != 'windows': + Return() + +env = env.Clone() + +talloc = env.SharedLibrary( + target = 'talloc', + source = ['talloc.c', 'talloc.def'], +) + +env.InstallSharedLibrary(talloc) + +if env['platform'] == 'windows': + talloc = env.FindIxes(talloc, 'LIBPREFIX', 'LIBSUFFIX') +else: + talloc = env.FindIxes(talloc, 'SHLIBPREFIX', 'SHLIBSUFFIX') + +Export('talloc') --- mesa-7.9~git20100924.orig/src/talloc/gpl-3.0.txt +++ mesa-7.9~git20100924/src/talloc/gpl-3.0.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. --- mesa-7.9~git20100924.orig/src/talloc/lgpl-3.0.txt +++ mesa-7.9~git20100924/src/talloc/lgpl-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. --- mesa-7.9~git20100924.orig/src/talloc/talloc_guide.txt +++ mesa-7.9~git20100924/src/talloc/talloc_guide.txt @@ -0,0 +1,757 @@ +Using talloc in Samba4 +====================== + +.. contents:: + +Andrew Tridgell +August 2009 + +The most current version of this document is available at + http://samba.org/ftp/unpacked/talloc/talloc_guide.txt + +If you are used to the "old" talloc from Samba3 before 3.0.20 then please read +this carefully, as talloc has changed a lot. With 3.0.20 (or 3.0.14?) the +Samba4 talloc has been ported back to Samba3, so this guide applies to both. + +The new talloc is a hierarchical, reference counted memory pool system +with destructors. Quite a mouthful really, but not too bad once you +get used to it. + +Perhaps the biggest change from Samba3 is that there is no distinction +between a "talloc context" and a "talloc pointer". Any pointer +returned from talloc() is itself a valid talloc context. This means +you can do this:: + + struct foo *X = talloc(mem_ctx, struct foo); + X->name = talloc_strdup(X, "foo"); + +and the pointer X->name would be a "child" of the talloc context "X" +which is itself a child of mem_ctx. So if you do talloc_free(mem_ctx) +then it is all destroyed, whereas if you do talloc_free(X) then just X +and X->name are destroyed, and if you do talloc_free(X->name) then +just the name element of X is destroyed. + +If you think about this, then what this effectively gives you is an +n-ary tree, where you can free any part of the tree with +talloc_free(). + +If you find this confusing, then I suggest you run the testsuite to +watch talloc in action. You may also like to add your own tests to +testsuite.c to clarify how some particular situation is handled. + + +Performance +----------- + +All the additional features of talloc() over malloc() do come at a +price. We have a simple performance test in Samba4 that measures +talloc() versus malloc() performance, and it seems that talloc() is +about 4% slower than malloc() on my x86 Debian Linux box. For Samba, +the great reduction in code complexity that we get by using talloc +makes this worthwhile, especially as the total overhead of +talloc/malloc in Samba is already quite small. + + +talloc API +---------- + +The following is a complete guide to the talloc API. Read it all at +least twice. + +Multi-threading +--------------- + +talloc itself does not deal with threads. It is thread-safe (assuming +the underlying "malloc" is), as long as each thread uses different +memory contexts. +If two threads uses the same context then they need to synchronize in +order to be safe. In particular: +- when using talloc_enable_leak_report(), giving directly NULL as a +parent context implicitly refers to a hidden "null context" global +variable, so this should not be used in a multi-threaded environment +without proper synchronization ; +- the context returned by talloc_autofree_context() is also global so +shouldn't be used by several threads simultaneously without +synchronization. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(type *)talloc(const void *context, type); + +The talloc() macro is the core of the talloc library. It takes a +memory context and a type, and returns a pointer to a new area of +memory of the given type. + +The returned pointer is itself a talloc context, so you can use it as +the context argument to more calls to talloc if you wish. + +The returned pointer is a "child" of the supplied context. This means +that if you talloc_free() the context then the new child disappears as +well. Alternatively you can free just the child. + +The context argument to talloc() can be NULL, in which case a new top +level context is created. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_size(const void *context, size_t size); + +The function talloc_size() should be used when you don't have a +convenient type to pass to talloc(). Unlike talloc(), it is not type +safe (as it returns a void *), so you are on your own for type checking. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(typeof(ptr)) talloc_ptrtype(const void *ctx, ptr); + +The talloc_ptrtype() macro should be used when you have a pointer and +want to allocate memory to point at with this pointer. When compiling +with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_size() +and talloc_get_name() will return the current location in the source file. +and not the type. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +int talloc_free(void *ptr); + +The talloc_free() function frees a piece of talloc memory, and all its +children. You can call talloc_free() on any pointer returned by +talloc(). + +The return value of talloc_free() indicates success or failure, with 0 +returned for success and -1 for failure. The only possible failure +condition is if the pointer had a destructor attached to it and the +destructor returned -1. See talloc_set_destructor() for details on +destructors. + +If this pointer has an additional parent when talloc_free() is called +then the memory is not actually released, but instead the most +recently established parent is destroyed. See talloc_reference() for +details on establishing additional parents. + +For more control on which parent is removed, see talloc_unlink() + +talloc_free() operates recursively on its children. + +From the 2.0 version of talloc, as a special case, talloc_free() is +refused on pointers that have more than one parent, as talloc would +have no way of knowing which parent should be removed. To free a +pointer that has more than one parent please use talloc_unlink(). + +To help you find problems in your code caused by this behaviour, if +you do try and free a pointer with more than one parent then the +talloc logging function will be called to give output like this: + + ERROR: talloc_free with references at some_dir/source/foo.c:123 + reference at some_dir/source/other.c:325 + reference at some_dir/source/third.c:121 + +Please see the documentation for talloc_set_log_fn() and +talloc_set_log_stderr() for more information on talloc logging +functions. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +int talloc_free_children(void *ptr); + +The talloc_free_children() walks along the list of all children of a +talloc context and talloc_free()s only the children, not the context +itself. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_reference(const void *context, const void *ptr); + +The talloc_reference() function makes "context" an additional parent +of "ptr". + +The return value of talloc_reference() is always the original pointer +"ptr", unless talloc ran out of memory in creating the reference in +which case it will return NULL (each additional reference consumes +around 48 bytes of memory on intel x86 platforms). + +If "ptr" is NULL, then the function is a no-op, and simply returns NULL. + +After creating a reference you can free it in one of the following +ways: + + - you can talloc_free() any parent of the original pointer. That + will reduce the number of parents of this pointer by 1, and will + cause this pointer to be freed if it runs out of parents. + + - you can talloc_free() the pointer itself. That will destroy the + most recently established parent to the pointer and leave the + pointer as a child of its current parent. + +For more control on which parent to remove, see talloc_unlink() + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +int talloc_unlink(const void *context, const void *ptr); + +The talloc_unlink() function removes a specific parent from ptr. The +context passed must either be a context used in talloc_reference() +with this pointer, or must be a direct parent of ptr. + +Note that if the parent has already been removed using talloc_free() +then this function will fail and will return -1. Likewise, if "ptr" +is NULL, then the function will make no modifications and return -1. + +Usually you can just use talloc_free() instead of talloc_unlink(), but +sometimes it is useful to have the additional control on which parent +is removed. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_set_destructor(const void *ptr, int (*destructor)(void *)); + +The function talloc_set_destructor() sets the "destructor" for the +pointer "ptr". A destructor is a function that is called when the +memory used by a pointer is about to be released. The destructor +receives the pointer as an argument, and should return 0 for success +and -1 for failure. + +The destructor can do anything it wants to, including freeing other +pieces of memory. A common use for destructors is to clean up +operating system resources (such as open file descriptors) contained +in the structure the destructor is placed on. + +You can only place one destructor on a pointer. If you need more than +one destructor then you can create a zero-length child of the pointer +and place an additional destructor on that. + +To remove a destructor call talloc_set_destructor() with NULL for the +destructor. + +If your destructor attempts to talloc_free() the pointer that it is +the destructor for then talloc_free() will return -1 and the free will +be ignored. This would be a pointless operation anyway, as the +destructor is only called when the memory is just about to go away. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +int talloc_increase_ref_count(const void *ptr); + +The talloc_increase_ref_count(ptr) function is exactly equivalent to: + + talloc_reference(NULL, ptr); + +You can use either syntax, depending on which you think is clearer in +your code. + +It returns 0 on success and -1 on failure. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +size_t talloc_reference_count(const void *ptr); + +Return the number of references to the pointer. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_set_name(const void *ptr, const char *fmt, ...); + +Each talloc pointer has a "name". The name is used principally for +debugging purposes, although it is also possible to set and get the +name on a pointer in as a way of "marking" pointers in your code. + +The main use for names on pointer is for "talloc reports". See +talloc_report() and talloc_report_full() for details. Also see +talloc_enable_leak_report() and talloc_enable_leak_report_full(). + +The talloc_set_name() function allocates memory as a child of the +pointer. It is logically equivalent to: + talloc_set_name_const(ptr, talloc_asprintf(ptr, fmt, ...)); + +Note that multiple calls to talloc_set_name() will allocate more +memory without releasing the name. All of the memory is released when +the ptr is freed using talloc_free(). + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_set_name_const(const void *ptr, const char *name); + +The function talloc_set_name_const() is just like talloc_set_name(), +but it takes a string constant, and is much faster. It is extensively +used by the "auto naming" macros, such as talloc_p(). + +This function does not allocate any memory. It just copies the +supplied pointer into the internal representation of the talloc +ptr. This means you must not pass a name pointer to memory that will +disappear before the ptr is freed with talloc_free(). + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_named(const void *context, size_t size, const char *fmt, ...); + +The talloc_named() function creates a named talloc pointer. It is +equivalent to: + + ptr = talloc_size(context, size); + talloc_set_name(ptr, fmt, ....); + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_named_const(const void *context, size_t size, const char *name); + +This is equivalent to:: + + ptr = talloc_size(context, size); + talloc_set_name_const(ptr, name); + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +const char *talloc_get_name(const void *ptr); + +This returns the current name for the given talloc pointer. See +talloc_set_name() for details. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_init(const char *fmt, ...); + +This function creates a zero length named talloc context as a top +level context. It is equivalent to:: + + talloc_named(NULL, 0, fmt, ...); + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_new(void *ctx); + +This is a utility macro that creates a new memory context hanging +off an exiting context, automatically naming it "talloc_new: __location__" +where __location__ is the source line it is called from. It is +particularly useful for creating a new temporary working context. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(type *)talloc_realloc(const void *context, void *ptr, type, count); + +The talloc_realloc() macro changes the size of a talloc +pointer. The "count" argument is the number of elements of type "type" +that you want the resulting pointer to hold. + +talloc_realloc() has the following equivalences:: + + talloc_realloc(context, NULL, type, 1) ==> talloc(context, type); + talloc_realloc(context, NULL, type, N) ==> talloc_array(context, type, N); + talloc_realloc(context, ptr, type, 0) ==> talloc_free(ptr); + +The "context" argument is only used if "ptr" is NULL, otherwise it is +ignored. + +talloc_realloc() returns the new pointer, or NULL on failure. The call +will fail either due to a lack of memory, or because the pointer has +more than one parent (see talloc_reference()). + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_realloc_size(const void *context, void *ptr, size_t size); + +the talloc_realloc_size() function is useful when the type is not +known so the typesafe talloc_realloc() cannot be used. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_steal(const void *new_ctx, const void *ptr); + +The talloc_steal() function changes the parent context of a talloc +pointer. It is typically used when the context that the pointer is +currently a child of is going to be freed and you wish to keep the +memory for a longer time. + +The talloc_steal() function returns the pointer that you pass it. It +does not have any failure modes. + +NOTE: It is possible to produce loops in the parent/child relationship +if you are not careful with talloc_steal(). No guarantees are provided +as to your sanity or the safety of your data if you do this. + +talloc_steal (new_ctx, NULL) will return NULL with no sideeffects. + +Note that if you try and call talloc_steal() on a pointer that has +more than one parent then the result is ambiguous. Talloc will choose +to remove the parent that is currently indicated by talloc_parent() +and replace it with the chosen parent. You will also get a message +like this via the talloc logging functions: + + WARNING: talloc_steal with references at some_dir/source/foo.c:123 + reference at some_dir/source/other.c:325 + reference at some_dir/source/third.c:121 + +To unambiguously change the parent of a pointer please see the +function talloc_reparent(). See the talloc_set_log_fn() documentation +for more information on talloc logging. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_reparent(const void *old_parent, const void *new_parent, const void *ptr); + +The talloc_reparent() function changes the parent context of a talloc +pointer. It is typically used when the context that the pointer is +currently a child of is going to be freed and you wish to keep the +memory for a longer time. + +The talloc_reparent() function returns the pointer that you pass it. It +does not have any failure modes. + +The difference between talloc_reparent() and talloc_steal() is that +talloc_reparent() can specify which parent you wish to change. This is +useful when a pointer has multiple parents via references. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_parent(const void *ptr); + +The talloc_parent() function returns the current talloc parent. This +is usually the pointer under which this memory was originally created, +but it may have changed due to a talloc_steal() or talloc_reparent() + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +size_t talloc_total_size(const void *ptr); + +The talloc_total_size() function returns the total size in bytes used +by this pointer and all child pointers. Mostly useful for debugging. + +Passing NULL is allowed, but it will only give a meaningful result if +talloc_enable_leak_report() or talloc_enable_leak_report_full() has +been called. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +size_t talloc_total_blocks(const void *ptr); + +The talloc_total_blocks() function returns the total memory block +count used by this pointer and all child pointers. Mostly useful for +debugging. + +Passing NULL is allowed, but it will only give a meaningful result if +talloc_enable_leak_report() or talloc_enable_leak_report_full() has +been called. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_report_depth_cb(const void *ptr, int depth, int max_depth, + void (*callback)(const void *ptr, + int depth, int max_depth, + int is_ref, + void *priv), + void *priv); + +This provides a more flexible reports than talloc_report(). It +will recursively call the callback for the entire tree of memory +referenced by the pointer. References in the tree are passed with +is_ref = 1 and the pointer that is referenced. + +You can pass NULL for the pointer, in which case a report is +printed for the top level memory context, but only if +talloc_enable_leak_report() or talloc_enable_leak_report_full() +has been called. + +The recursion is stopped when depth >= max_depth. +max_depth = -1 means only stop at leaf nodes. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_report_depth_file(const void *ptr, int depth, int max_depth, FILE *f); + +This provides a more flexible reports than talloc_report(). It +will let you specify the depth and max_depth. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_report(const void *ptr, FILE *f); + +The talloc_report() function prints a summary report of all memory +used by ptr. One line of report is printed for each immediate child of +ptr, showing the total memory and number of blocks used by that child. + +You can pass NULL for the pointer, in which case a report is printed +for the top level memory context, but only if +talloc_enable_leak_report() or talloc_enable_leak_report_full() has +been called. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_report_full(const void *ptr, FILE *f); + +This provides a more detailed report than talloc_report(). It will +recursively print the ensire tree of memory referenced by the +pointer. References in the tree are shown by giving the name of the +pointer that is referenced. + +You can pass NULL for the pointer, in which case a report is printed +for the top level memory context, but only if +talloc_enable_leak_report() or talloc_enable_leak_report_full() has +been called. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_enable_leak_report(void); + +This enables calling of talloc_report(NULL, stderr) when the program +exits. In Samba4 this is enabled by using the --leak-report command +line option. + +For it to be useful, this function must be called before any other +talloc function as it establishes a "null context" that acts as the +top of the tree. If you don't call this function first then passing +NULL to talloc_report() or talloc_report_full() won't give you the +full tree printout. + +Here is a typical talloc report: + +talloc report on 'null_context' (total 267 bytes in 15 blocks) + libcli/auth/spnego_parse.c:55 contains 31 bytes in 2 blocks + libcli/auth/spnego_parse.c:55 contains 31 bytes in 2 blocks + iconv(UTF8,CP850) contains 42 bytes in 2 blocks + libcli/auth/spnego_parse.c:55 contains 31 bytes in 2 blocks + iconv(CP850,UTF8) contains 42 bytes in 2 blocks + iconv(UTF8,UTF-16LE) contains 45 bytes in 2 blocks + iconv(UTF-16LE,UTF8) contains 45 bytes in 2 blocks + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_enable_leak_report_full(void); + +This enables calling of talloc_report_full(NULL, stderr) when the +program exits. In Samba4 this is enabled by using the +--leak-report-full command line option. + +For it to be useful, this function must be called before any other +talloc function as it establishes a "null context" that acts as the +top of the tree. If you don't call this function first then passing +NULL to talloc_report() or talloc_report_full() won't give you the +full tree printout. + +Here is a typical full report: + +full talloc report on 'root' (total 18 bytes in 8 blocks) + p1 contains 18 bytes in 7 blocks (ref 0) + r1 contains 13 bytes in 2 blocks (ref 0) + reference to: p2 + p2 contains 1 bytes in 1 blocks (ref 1) + x3 contains 1 bytes in 1 blocks (ref 0) + x2 contains 1 bytes in 1 blocks (ref 0) + x1 contains 1 bytes in 1 blocks (ref 0) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_enable_null_tracking(void); + +This enables tracking of the NULL memory context without enabling leak +reporting on exit. Useful for when you want to do your own leak +reporting call via talloc_report_null_full(); + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_disable_null_tracking(void); + +This disables tracking of the NULL memory context. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(type *)talloc_zero(const void *ctx, type); + +The talloc_zero() macro is equivalent to:: + + ptr = talloc(ctx, type); + if (ptr) memset(ptr, 0, sizeof(type)); + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_zero_size(const void *ctx, size_t size) + +The talloc_zero_size() function is useful when you don't have a known type + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_memdup(const void *ctx, const void *p, size_t size); + +The talloc_memdup() function is equivalent to:: + + ptr = talloc_size(ctx, size); + if (ptr) memcpy(ptr, p, size); + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_strdup(const void *ctx, const char *p); + +The talloc_strdup() function is equivalent to:: + + ptr = talloc_size(ctx, strlen(p)+1); + if (ptr) memcpy(ptr, p, strlen(p)+1); + +This functions sets the name of the new pointer to the passed +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_strndup(const void *t, const char *p, size_t n); + +The talloc_strndup() function is the talloc equivalent of the C +library function strndup() + +This functions sets the name of the new pointer to the passed +string. This is equivalent to: + talloc_set_name_const(ptr, ptr) + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_append_string(const void *t, char *orig, const char *append); + +The talloc_append_string() function appends the given formatted +string to the given string. + +This function sets the name of the new pointer to the new +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_vasprintf(const void *t, const char *fmt, va_list ap); + +The talloc_vasprintf() function is the talloc equivalent of the C +library function vasprintf() + +This functions sets the name of the new pointer to the new +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_asprintf(const void *t, const char *fmt, ...); + +The talloc_asprintf() function is the talloc equivalent of the C +library function asprintf() + +This functions sets the name of the new pointer to the new +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_asprintf_append(char *s, const char *fmt, ...); + +The talloc_asprintf_append() function appends the given formatted +string to the given string. +Use this varient when the string in the current talloc buffer may +have been truncated in length. + +This functions sets the name of the new pointer to the new +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...); + +The talloc_asprintf_append() function appends the given formatted +string to the end of the currently allocated talloc buffer. +Use this varient when the string in the current talloc buffer has +not been changed. + +This functions sets the name of the new pointer to the new +string. This is equivalent to:: + + talloc_set_name_const(ptr, ptr) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +((type *)talloc_array(const void *ctx, type, uint_t count); + +The talloc_array() macro is equivalent to:: + + (type *)talloc_size(ctx, sizeof(type) * count); + +except that it provides integer overflow protection for the multiply, +returning NULL if the multiply overflows. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_array_size(const void *ctx, size_t size, uint_t count); + +The talloc_array_size() function is useful when the type is not +known. It operates in the same way as talloc_array(), but takes a size +instead of a type. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, uint_t count); + +The talloc_ptrtype() macro should be used when you have a pointer to an array +and want to allocate memory of an array to point at with this pointer. When compiling +with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_array_size() +and talloc_get_name() will return the current location in the source file. +and not the type. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_realloc_fn(const void *ctx, void *ptr, size_t size); + +This is a non-macro version of talloc_realloc(), which is useful +as libraries sometimes want a ralloc function pointer. A realloc() +implementation encapsulates the functionality of malloc(), free() and +realloc() in one call, which is why it is useful to be able to pass +around a single function pointer. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_autofree_context(void); + +This is a handy utility function that returns a talloc context +which will be automatically freed on program exit. This can be used +to reduce the noise in memory leak reports. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_check_name(const void *ptr, const char *name); + +This function checks if a pointer has the specified name. If it does +then the pointer is returned. It it doesn't then NULL is returned. + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(type *)talloc_get_type(const void *ptr, type); + +This macro allows you to do type checking on talloc pointers. It is +particularly useful for void* private pointers. It is equivalent to +this:: + + (type *)talloc_check_name(ptr, #type) + + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +talloc_set_type(const void *ptr, type); + +This macro allows you to force the name of a pointer to be a +particular type. This can be used in conjunction with +talloc_get_type() to do type checking on void* pointers. + +It is equivalent to this:: + + talloc_set_name_const(ptr, #type) + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +talloc_get_size(const void *ctx); + +This function lets you know the amount of memory alloced so far by +this context. It does NOT account for subcontext memory. +This can be used to calculate the size of an array. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void *talloc_find_parent_byname(const void *ctx, const char *name); + +Find a parent memory context of the current context that has the given +name. This can be very useful in complex programs where it may be +difficult to pass all information down to the level you need, but you +know the structure you want is a parent of another context. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +(type *)talloc_find_parent_bytype(ctx, type); + +Like talloc_find_parent_byname() but takes a type, making it typesafe. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_set_log_fn(void (*log_fn)(const char *message)); + +This function sets a logging function that talloc will use for +warnings and errors. By default talloc will not print any warnings or +errors. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +void talloc_set_log_stderr(void) + +This sets the talloc log function to write log messages to stderr --- mesa-7.9~git20100924.orig/src/mesa/SConscript +++ mesa-7.9~git20100924/src/mesa/SConscript @@ -0,0 +1,322 @@ +####################################################################### +# SConscript for Mesa + + +Import('*') + +if env['platform'] != 'winddk': + + env = env.Clone() + + env.Append(CPPPATH = [ + '#/src/mapi', + '#/src/glsl', + '#/src/mesa', + ]) + + if env['platform'] == 'windows': + env.Append(CPPDEFINES = [ + '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers + 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers + 'WIN32_THREADS', # use Win32 thread API + ]) + env.Prepend(CPPPATH = ['#src/talloc']) + + # + # Source files + # + + main_sources = [ + 'main/api_arrayelt.c', + 'main/api_exec.c', + 'main/api_loopback.c', + 'main/api_noop.c', + 'main/api_validate.c', + 'main/accum.c', + 'main/arbprogram.c', + 'main/atifragshader.c', + 'main/attrib.c', + 'main/arrayobj.c', + 'main/blend.c', + 'main/bufferobj.c', + 'main/buffers.c', + 'main/clear.c', + 'main/clip.c', + 'main/colortab.c', + 'main/condrender.c', + 'main/context.c', + 'main/convolve.c', + 'main/cpuinfo.c', + 'main/debug.c', + 'main/depth.c', + 'main/depthstencil.c', + 'main/dlist.c', + 'main/dlopen.c', + 'main/drawpix.c', + 'main/drawtex.c', + 'main/enable.c', + 'main/enums.c', + 'main/eval.c', + 'main/execmem.c', + 'main/extensions.c', + 'main/fbobject.c', + 'main/feedback.c', + 'main/ffvertex_prog.c', + 'main/fog.c', + 'main/formats.c', + 'main/framebuffer.c', + 'main/get.c', + 'main/getstring.c', + 'main/hash.c', + 'main/hint.c', + 'main/histogram.c', + 'main/image.c', + 'main/imports.c', + 'main/light.c', + 'main/lines.c', + 'main/matrix.c', + 'main/mipmap.c', + 'main/mm.c', + 'main/multisample.c', + 'main/nvprogram.c', + 'main/pixel.c', + 'main/pixelstore.c', + 'main/points.c', + 'main/polygon.c', + 'main/querymatrix.c', + 'main/queryobj.c', + 'main/rastpos.c', + 'main/readpix.c', + 'main/remap.c', + 'main/renderbuffer.c', + 'main/scissor.c', + 'main/shaderapi.c', + 'main/shaderobj.c', + 'main/shared.c', + 'main/state.c', + 'main/stencil.c', + 'main/syncobj.c', + 'main/texcompress.c', + 'main/texcompress_s3tc.c', + 'main/texcompress_fxt1.c', + 'main/texenv.c', + 'main/texenvprogram.c', + 'main/texfetch.c', + 'main/texformat.c', + 'main/texgen.c', + 'main/texgetimage.c', + 'main/teximage.c', + 'main/texobj.c', + 'main/texpal.c', + 'main/texparam.c', + 'main/texrender.c', + 'main/texstate.c', + 'main/texstore.c', + 'main/transformfeedback.c', + 'main/uniforms.c', + 'main/varray.c', + 'main/version.c', + 'main/viewport.c', + 'main/vtxfmt.c', + ] + + math_sources = [ + 'math/m_debug_clip.c', + 'math/m_debug_norm.c', + 'math/m_debug_xform.c', + 'math/m_eval.c', + 'math/m_matrix.c', + 'math/m_translate.c', + 'math/m_vector.c', + 'math/m_xform.c', + ] + + vbo_sources = [ + 'vbo/vbo_context.c', + 'vbo/vbo_exec.c', + 'vbo/vbo_exec_api.c', + 'vbo/vbo_exec_array.c', + 'vbo/vbo_exec_draw.c', + 'vbo/vbo_exec_eval.c', + 'vbo/vbo_rebase.c', + 'vbo/vbo_split.c', + 'vbo/vbo_split_copy.c', + 'vbo/vbo_split_inplace.c', + 'vbo/vbo_save.c', + 'vbo/vbo_save_api.c', + 'vbo/vbo_save_draw.c', + 'vbo/vbo_save_loopback.c', + ] + + vf_sources = [ + 'vf/vf.c', + 'vf/vf_generic.c', + 'vf/vf_sse.c', + ] + + statetracker_sources = [ + 'state_tracker/st_atom.c', + 'state_tracker/st_atom_blend.c', + 'state_tracker/st_atom_clip.c', + 'state_tracker/st_atom_constbuf.c', + 'state_tracker/st_atom_depth.c', + 'state_tracker/st_atom_framebuffer.c', + 'state_tracker/st_atom_msaa.c', + 'state_tracker/st_atom_pixeltransfer.c', + 'state_tracker/st_atom_sampler.c', + 'state_tracker/st_atom_scissor.c', + 'state_tracker/st_atom_shader.c', + 'state_tracker/st_atom_rasterizer.c', + 'state_tracker/st_atom_stipple.c', + 'state_tracker/st_atom_texture.c', + 'state_tracker/st_atom_viewport.c', + 'state_tracker/st_cb_accum.c', + 'state_tracker/st_cb_bitmap.c', + 'state_tracker/st_cb_blit.c', + 'state_tracker/st_cb_bufferobjects.c', + 'state_tracker/st_cb_clear.c', + 'state_tracker/st_cb_condrender.c', + 'state_tracker/st_cb_flush.c', + 'state_tracker/st_cb_drawpixels.c', + 'state_tracker/st_cb_drawtex.c', + 'state_tracker/st_cb_eglimage.c', + 'state_tracker/st_cb_fbo.c', + 'state_tracker/st_cb_feedback.c', + 'state_tracker/st_cb_program.c', + 'state_tracker/st_cb_queryobj.c', + 'state_tracker/st_cb_rasterpos.c', + 'state_tracker/st_cb_readpixels.c', + 'state_tracker/st_cb_strings.c', + 'state_tracker/st_cb_texture.c', + 'state_tracker/st_cb_viewport.c', + 'state_tracker/st_cb_xformfb.c', + 'state_tracker/st_context.c', + 'state_tracker/st_debug.c', + 'state_tracker/st_draw.c', + 'state_tracker/st_draw_feedback.c', + 'state_tracker/st_extensions.c', + 'state_tracker/st_format.c', + 'state_tracker/st_gen_mipmap.c', + 'state_tracker/st_manager.c', + 'state_tracker/st_mesa_to_tgsi.c', + 'state_tracker/st_program.c', + 'state_tracker/st_texture.c', + ] + + program_sources = [ + 'program/arbprogparse.c', + 'program/hash_table.c', + 'program/ir_to_mesa.cpp', + 'program/lex.yy.c', + 'program/nvfragparse.c', + 'program/nvvertparse.c', + 'program/program.c', + 'program/program_parse.tab.c', + 'program/program_parse_extra.c', + 'program/prog_cache.c', + 'program/prog_execute.c', + 'program/prog_instruction.c', + 'program/prog_noise.c', + 'program/prog_optimize.c', + 'program/prog_parameter.c', + 'program/prog_parameter_layout.c', + 'program/prog_print.c', + 'program/prog_statevars.c', + 'program/prog_uniform.c', + 'program/programopt.c', + 'program/symbol_table.c', + ] + + mesa_sources = ( + main_sources + + math_sources + + program_sources + + vbo_sources + + vf_sources + + statetracker_sources + ) + + # + # Assembly sources + # + if gcc and env['machine'] == 'x86': + env.Append(CPPDEFINES = [ + 'USE_X86_ASM', + 'USE_MMX_ASM', + 'USE_3DNOW_ASM', + 'USE_SSE_ASM', + ]) + mesa_sources += [ + 'x86/common_x86.c', + 'x86/x86_xform.c', + 'x86/3dnow.c', + 'x86/sse.c', + 'x86/common_x86_asm.S', + 'x86/x86_xform2.S', + 'x86/x86_xform3.S', + 'x86/x86_xform4.S', + 'x86/x86_cliptest.S', + 'x86/mmx_blend.S', + 'x86/3dnow_xform1.S', + 'x86/3dnow_xform2.S', + 'x86/3dnow_xform3.S', + 'x86/3dnow_xform4.S', + 'x86/3dnow_normal.S', + 'x86/sse_xform1.S', + 'x86/sse_xform2.S', + 'x86/sse_xform3.S', + 'x86/sse_xform4.S', + 'x86/sse_normal.S', + 'x86/read_rgba_span_x86.S', + ] + elif gcc and env['machine'] == 'x86_64': + env.Append(CPPDEFINES = [ + 'USE_X86_64_ASM', + ]) + mesa_sources += [ + 'x86-64/x86-64.c', + 'x86-64/xform4.S', + ] + elif gcc and env['machine'] == 'ppc': + env.Append(CPPDEFINES = [ + 'USE_PPC_ASM', + 'USE_VMX_ASM', + ]) + mesa_sources += [ + 'ppc/common_ppc.c', + ] + elif gcc and env['machine'] == 'sparc': + mesa_sources += [ + 'sparc/sparc.c', + 'sparc/clip.S', + 'sparc/norm.S', + 'sparc/xform.S', + ] + else: + pass + + # Generate matypes.h + if gcc and env['machine'] in ('x86', 'x86_64'): + # See http://www.scons.org/wiki/UsingCodeGenerators + gen_matypes = env.Program( + target = 'gen_matypes', + source = 'x86/gen_matypes.c', + ) + matypes = env.Command( + 'matypes.h', + gen_matypes, + gen_matypes[0].abspath + ' > $TARGET', + ) + # Add the dir containing the generated header (somewhere inside the + # build dir) to the include path + env.Append(CPPPATH = [matypes[0].dir]) + + # + # Libraries + # + + mesa = env.ConvenienceLibrary( + target = 'mesa', + source = mesa_sources, + ) + Export('mesa') --- mesa-7.9~git20100924.orig/src/mesa/swrast_setup/NOTES +++ mesa-7.9~git20100924/src/mesa/swrast_setup/NOTES @@ -0,0 +1,65 @@ +INTRODUCTION + +A helper module which provides glue to bind the software rasterizer to +the software t&l module. The main task of this module is to build +swrast vertices from the t&l vertex_buffer structs, and to use them to +perform triangle setup functions not implemented in the software +rasterizer. + +The module implements a full set of functions to plug into the +t_vb_render.c driver interface (tnl->Driver.Render.*). + +There are strong advantages to decoupling the software rasterizer from +the t&l module, primarily allowing hardware drivers better control +over fallbacks, the removal of implicit knowledge about the software +rasterizer in the t&l module, allowing the two modules to evolve +independently and allowing either to be substituted with equivalent +functionality from another codebase. + +This module implements triangle/quad setup for offset, unfilled and +twoside-lit triangles. The software rasterizer doesn't handle these +primitives directly. + +Hardware rasterization drivers typically use this module in situations +where no hardware rasterization is possible, ie during total +fallbacks. + +STATE + +To create and destroy the module: + + GLboolean _swsetup_CreateContext( GLcontext *ctx ); + void _swsetup_DestroyContext( GLcontext *ctx ); + +The module is not active by default, and must be installed by calling +_swrast_Wakeup(). This function installs internal swrast_setup +functions into all the tnl->Driver.Render driver hooks, thus taking +over the task of rasterization entirely: + + void _swrast_Wakeup( GLcontext *ctx ); + + +This module tracks state changes internally and maintains derived +values based on the current state. For this to work, the driver +ensure the following funciton is called whenever the state changes and +the swsetup module is 'awake': + + void _swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ); + +There is no explicit call to put the swsetup module to sleep. Simply +install other function pointers into all the tnl->Driver.Render.* +hooks, and (optionally) cease calling _swsetup_InvalidateState(). + +DRIVER INTERFACE + +The module offers a minimal driver interface: + + void (*Start)( GLcontext *ctx ); + void (*Finish)( GLcontext *ctx ); + +These are called before and after the completion of all swrast drawing +activity. As swrast doesn't call callbacks during triangle, line or +point rasterization, these are necessary to provide locking hooks for +some drivers. They may otherwise be left null. + + --- mesa-7.9~git20100924.orig/src/mesa/swrast/NOTES +++ mesa-7.9~git20100924/src/mesa/swrast/NOTES @@ -0,0 +1,55 @@ +INTRODUCTION + +Mesa's native software rasterizer. This module provides the fallback +paths for rasterization operations and states that aren't accelerated +in hardware drivers, and as the full rasterization engine in software +drivers. + +The swrast module 'stands alone', relying only on interfaces to core +mesa and it's own driver interface. It knows nothing about the tnl or +other modules, allowing it to be used for fallback paths in future tnl +schemes without modification. + +As well as providing triangle/line/point rasterization functionality, +the module provides implementations of the pixel operations +(ReadPixels, etc), and texture operations (CopyTexSubImage) which may +be plugged in to the core Mesa driver interface where accelerated +versions of these operations are unavailable. + + +STATE + +To create and destroy the module: + + GLboolean _swrast_CreateContext( GLcontext *ctx ); + void _swrast_DestroyContext( GLcontext *ctx ); + +This module tracks state changes internally and maintains derived +values based on the current state. For this to work, the driver +ensure the following funciton is called whenever the state changes and +the swsetup module is 'awake': + + void _swrast_InvalidateState( GLcontext *ctx, GLuint new_state ); + +There is no explicit call to put the swrast module to sleep. + + +CUSTOMIZATION + + void (*choose_point)( GLcontext * ); + void (*choose_line)( GLcontext * ); + void (*choose_triangle)( GLcontext * ); + +Drivers may add additional triangle/line/point functions to swrast by +overriding these functions. It is necessary for the driver to be very +careful that it doesn't return an inappropriate function, eg a +rasterization function in feedback mode. See the X11 driver for +examples. + +DRIVER INTERFACE + +The swrast device driver provides swrast primarily with span- and +pixel- level interfaces to a framebuffer, with a few additional hooks +for locking and setting the read buffer. + +See the definition of struct swrast_device_driver in swrast.h. \ No newline at end of file --- mesa-7.9~git20100924.orig/src/mesa/tnl/NOTES +++ mesa-7.9~git20100924/src/mesa/tnl/NOTES @@ -0,0 +1,102 @@ +INTRODUCTION + +A generic, configurable software implementation of GL transformation & +lighting. + +This module provides an implementation of the routines required by the +'vtxfmt' mechanism of core mesa for tnl functionality in all +combinations of compile and execute modes. + +Most current drivers use the tnl module exclusively to provide this +functionality, though there is an experimental alternate +implementation provided by the tnl_dd/t_dd_imm_* files which can +handle a small subset of GL states in execute mode only. + + +STATE + +To create and destroy the module: + + GLboolean _tnl_CreateContext( GLcontext *ctx ); + void _tnl_DestroyContext( GLcontext *ctx ); + +The module is not active by default, and must be installed by calling +_tnl_Wakeup(). This function installs internal tnl functions into all +the vtxfmt dispatch hooks, thus taking over the task of transformation +and lighting entirely: + + void _tnl_wakeup_exec( GLcontext *ctx ); + void _tnl_wakeup_save_exec( GLcontext *ctx ); + + +This module tracks state changes internally and maintains derived +values based on the current state. For this to work, the driver +ensure the following funciton is called whenever the state changes and +the swsetup module is 'awake': + + void _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ); + +There is no explicit call to put the tnl module to sleep. Simply +install other function pointers into all the vtxfmt dispatch slots, +and (optionally) cease calling _tnl_InvalidateState(). + +CUSTOMIZATION + +The module provides customizability through several mechanisms. The +most important is by allowing drivers to specify the pipeline through +which vertex data is passed, including its eventual transfer to +rasterization hardware (or software). + +The default pipeline is specified in t_pipeline.c, and is usually a +starting point for driver pipelines. Some drivers will remove a stage +where hardware provides support for the implemented operation (for +instance fog where per-pixel hardware fog is available, as in the dri +tdfx driver), or add stages to shortcircuit latter operations (for +example taking advantage of hardware support for strips and other +higher-level primitives (for example the radeon driver). + +In addition, the following functions provide further tweaks: + +extern void +_tnl_need_projected_coords( GLcontext *ctx, GLboolean flag ); + + - Direct the default vertex transformation stage to + produce/not produce projected clip coordinates. + +extern void +_tnl_need_dlist_loopback( GLcontext *ctx, GLboolean flag ); + + - Direct the display list component of the tnl module to + replay display lists as 'glVertex' type calls, rather than + passing the display list data directly into the tnl pipeline + mechanism. + + This allows display lists to be replayed by the tnl module + even when the module is not strictly active. + + +extern void +_tnl_need_dlist_norm_lengths( GLcontext *ctx, GLboolean flag ); + + - Direct the display list component to enable/disable caching + 1/length values for display list normals. Doing so is + ususally helpful when lighting is performed in software, but + wasteful otherwise. + + +DRIVER INTERFACE + +The module itself offers a minimal driver interface: + + void (*RunPipeline)( GLcontext *ctx ); + +Normally this is set to _tnl_RunPipeline(), however the driver can use +this hook to wrap checks or other code around this call. + +In addition, the driver interface for the default render pipeline +stage is housed in the tnl context struct (this could be cleaner). + + +RENDER DRIVER INTERFACE + +See t_context.h for the definition and explanation of this. \ No newline at end of file --- mesa-7.9~git20100924.orig/src/mesa/x86-64/calling_convention.txt +++ mesa-7.9~git20100924/src/mesa/x86-64/calling_convention.txt @@ -0,0 +1,50 @@ +Register Usage +rax temporary register; with variable arguments passes information + about the number of SSE registers used; 1st return register + +rbx* callee-saved register; optionally used as base pointer + +rcx used to pass 4th integer argument to functions + +rdx used to pass 3rd argument to functions 2nd return register + +rsp* stack pointer + +rbp* callee-saved register; optionally used as frame pointer + +rsi used to pass 2nd argument to functions + +rdi used to pass 1st argument to functions + +r8 used to pass 5th argument to functions + +r9 used to pass 6th argument to functions + +r10 temporary register, used for passing a function's static chain pointer + +r11 temporary register + +r12-15* callee-saved registers + +xmm0­1 used to pass and return floating point arguments + +xmm2­7 used to pass floating point arguments + +xmm8­15 temporary registers + +mmx0­7 temporary registers + +st0 temporary register; used to return long double arguments + +st1 temporary registers; used to return long double arguments + +st2­7 temporary registers + +fs Reserved for system use (as thread specific data register) + + + +*) must be preserved across function calls + +Integer arguments from list: rdi,rsi,rdx,rcx,r8,r9,stack +Floating point arguments from list: xmm0-xmm7 \ No newline at end of file --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/gdi/InitCritSections.cpp +++ mesa-7.9~git20100924/src/mesa/drivers/windows/gdi/InitCritSections.cpp @@ -0,0 +1,32 @@ +#include "glapi.h" +#include "glThread.h" + +#ifdef WIN32_THREADS +extern "C" _glthread_Mutex OneTimeLock; +extern "C" _glthread_Mutex GenTexturesLock; + +extern "C" void FreeAllTSD(void); + +class _CriticalSectionInit +{ +public: + static _CriticalSectionInit m_inst; + + _CriticalSectionInit() + { + _glthread_INIT_MUTEX(OneTimeLock); + _glthread_INIT_MUTEX(GenTexturesLock); + } + + ~_CriticalSectionInit() + { + _glthread_DESTROY_MUTEX(OneTimeLock); + _glthread_DESTROY_MUTEX(GenTexturesLock); + FreeAllTSD(); + } +}; + +_CriticalSectionInit _CriticalSectionInit::m_inst; + + +#endif --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/gldirect/opengl32.ref +++ mesa-7.9~git20100924/src/mesa/drivers/windows/gldirect/opengl32.ref @@ -0,0 +1,495 @@ +;**************************************************************************** +;* +;* Mesa 3-D graphics library +;* Direct3D Driver Interface +;* +;* ======================================================================== +;* +;* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +;* +;* 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 +;* SCITECH SOFTWARE INC 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. +;* +;* ====================================================================== +;* +;* Language: ANSI C +;* Environment: Windows 9x/2000/XP/XBox (Win32) +;* +;* Description: DLL Module definition file +;* +;****************************************************************************/ + +DESCRIPTION 'GLDirect' + +VERSION 3.0 + +EXPORTS + glAccum + glAlphaFunc + glAreTexturesResident + glArrayElement + glBegin + glBindTexture + glBitmap + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearIndex + glClearColor + glClearDepth + glClearStencil + glClipPlane + glColor3b + glColor3d + glColor3f + glColor3i + glColor3s + glColor3ub + glColor3ui + glColor3us + glColor4b + glColor4d + glColor4f + glColor4i + glColor4s + glColor4ub + glColor4ui + glColor4us + glColor3bv + glColor3dv + glColor3fv + glColor3iv + glColor3sv + glColor3ubv + glColor3uiv + glColor3usv + glColor4bv + glColor4dv + glColor4fv + glColor4iv + glColor4sv + glColor4ubv + glColor4uiv + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorTableEXT + glColorSubTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCullFace + glDepthFunc + glDepthMask + glDepthRange + glDeleteLists + glDeleteTextures + glDisable + glDisableClientState + glDrawArrays + glDrawBuffer + glDrawElements + glDrawPixels + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1f + glEvalCoord1dv + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2f + glEvalCoord2dv + glEvalCoord2fv + glEvalPoint1 + glEvalPoint2 + glEvalMesh1 + glEdgeFlag + glEdgeFlagv + glEdgeFlagPointer + glEvalMesh2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogi + glFogfv + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterivEXT + glGetColorTableParameterfvEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGeniv + glGetTexGendv + glGetTexGenfv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexf + glIndexi + glIndexs + glIndexub + glIndexdv + glIndexfv + glIndexiv + glIndexsv + glIndexubv + glIndexMask + glIndexPointer + glInterleavedArrays + glInitNames + glIsList + glIsTexture + glLightf + glLighti + glLightfv + glLightiv + glLightModelf + glLightModeli + glLightModelfv + glLightModeliv + glLineWidth + glLineStipple + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMateriali + glMaterialfv + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3d + glNormal3f + glNormal3i + glNormal3s + glNormal3bv + glNormal3dv + glNormal3fv + glNormal3iv + glNormal3sv + glNormalPointer + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPushMatrix + glRasterPos2d + glRasterPos2f + glRasterPos2i + glRasterPos2s + glRasterPos3d + glRasterPos3f + glRasterPos3i + glRasterPos3s + glRasterPos4d + glRasterPos4f + glRasterPos4i + glRasterPos4s + glRasterPos2dv + glRasterPos2fv + glRasterPos2iv + glRasterPos2sv + glRasterPos3dv + glRasterPos3fv + glRasterPos3iv + glRasterPos3sv + glRasterPos4dv + glRasterPos4fv + glRasterPos4iv + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectf + glRecti + glRects + glRectdv + glRectfv + glRectiv + glRectsv + glScissor + glIsEnabled + glPushAttrib + glPushClientAttrib + glPushName + glRenderMode + glRotated + glRotatef + glSelectBuffer + glScaled + glScalef + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1f + glTexCoord1i + glTexCoord1s + glTexCoord2d + glTexCoord2f + glTexCoord2i + glTexCoord2s + glTexCoord3d + glTexCoord3f + glTexCoord3i + glTexCoord3s + glTexCoord4d + glTexCoord4f + glTexCoord4i + glTexCoord4s + glTexCoord1dv + glTexCoord1fv + glTexCoord1iv + glTexCoord1sv + glTexCoord2dv + glTexCoord2fv + glTexCoord2iv + glTexCoord2sv + glTexCoord3dv + glTexCoord3fv + glTexCoord3iv + glTexCoord3sv + glTexCoord4dv + glTexCoord4fv + glTexCoord4iv + glTexCoord4sv + glTexCoordPointer + glTexGend + glTexGenf + glTexGeni + glTexGendv + glTexGeniv + glTexGenfv + glTexEnvf + glTexEnvi + glTexEnvfv + glTexEnviv + glTexImage1D + glTexImage2D + glTexParameterf + glTexParameteri + glTexParameterfv + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTranslated + glTranslatef + glVertex2d + glVertex2f + glVertex2i + glVertex2s + glVertex3d + glVertex3f + glVertex3i + glVertex3s + glVertex4d + glVertex4f + glVertex4i + glVertex4s + glVertex2dv + glVertex2fv + glVertex2iv + glVertex2sv + glVertex3dv + glVertex3fv + glVertex3iv + glVertex3sv + glVertex4dv + glVertex4fv + glVertex4iv + glVertex4sv + glVertexPointer + glViewport + + glBlendEquationEXT + glBlendColorEXT + glVertexPointerEXT + glNormalPointerEXT + glColorPointerEXT + glIndexPointerEXT + glTexCoordPointerEXT + glEdgeFlagPointerEXT + glGetPointervEXT + glArrayElementEXT + glDrawArraysEXT + glBindTextureEXT + glDeleteTexturesEXT + glGenTexturesEXT + glPrioritizeTexturesEXT + glCopyTexSubImage3DEXT + glTexImage3DEXT + glTexSubImage3DEXT + + glWindowPos4fMESA + glWindowPos2iMESA + glWindowPos2sMESA + glWindowPos2fMESA + glWindowPos2dMESA + glWindowPos2ivMESA + glWindowPos2svMESA + glWindowPos2fvMESA + glWindowPos2dvMESA + glWindowPos3iMESA + glWindowPos3sMESA + glWindowPos3fMESA + glWindowPos3dMESA + glWindowPos3ivMESA + glWindowPos3svMESA + glWindowPos3fvMESA + glWindowPos3dvMESA + glWindowPos4iMESA + glWindowPos4sMESA + glWindowPos4dMESA + glWindowPos4ivMESA + glWindowPos4svMESA + glWindowPos4fvMESA + glWindowPos4dvMESA + glResizeBuffersMESA + + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext + wglDescribeLayerPlane + wglGetCurrentContext + wglGetCurrentDC + wglGetLayerPaletteEntries + wglGetProcAddress + wglMakeCurrent + wglRealizeLayerPalette + wglSetLayerPaletteEntries + wglShareLists + wglSwapLayerBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + +;These functions are identical and therefore share the same addresses + ChoosePixelFormat = wglChoosePixelFormat + DescribePixelFormat = wglDescribePixelFormat + GetPixelFormat = wglGetPixelFormat + SetPixelFormat = wglSetPixelFormat + SwapBuffers = wglSwapBuffers + + wglChoosePixelFormat + wglDescribePixelFormat + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers + + glActiveTextureARB + glClientActiveTextureARB + glMultiTexCoord1dARB + glMultiTexCoord1dvARB + glMultiTexCoord1fARB + glMultiTexCoord1fvARB + glMultiTexCoord1iARB + glMultiTexCoord1ivARB + glMultiTexCoord1sARB + glMultiTexCoord1svARB + glMultiTexCoord2dARB + glMultiTexCoord2dvARB + glMultiTexCoord2fARB + glMultiTexCoord2fvARB + glMultiTexCoord2iARB + glMultiTexCoord2ivARB + glMultiTexCoord2sARB + glMultiTexCoord2svARB + glMultiTexCoord3dARB + glMultiTexCoord3dvARB + glMultiTexCoord3fARB + glMultiTexCoord3fvARB + glMultiTexCoord3iARB + glMultiTexCoord3ivARB + glMultiTexCoord3sARB + glMultiTexCoord3svARB + glMultiTexCoord4dARB + glMultiTexCoord4dvARB + glMultiTexCoord4fARB + glMultiTexCoord4fvARB + glMultiTexCoord4iARB + glMultiTexCoord4ivARB + glMultiTexCoord4sARB + glMultiTexCoord4svARB --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/gldirect/gldirect.rc +++ mesa-7.9~git20100924/src/mesa/drivers/windows/gldirect/gldirect.rc @@ -0,0 +1,43 @@ +/**************************************************************************** +* +* Mesa 3-D graphics library +* Direct3D Driver Interface +* +* ======================================================================== +* +* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +* +* 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 +* SCITECH SOFTWARE INC 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. +* +* ====================================================================== +* +* Language: Windows Resource Compiler +* Environment: Windows 95 +* +****************************************************************************/ + +#ifndef WORKSHOP_INVOKED + #include +#endif + +#define FILE_DESCRIPTION "SciTech GLDirect" +#define ORIG_FILENAME "opengl32.dll" +#define FILE_TYPE VFT_DLL + +#include "gldirect/gldver.ver" --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ mesa-7.9~git20100924/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -0,0 +1,1682 @@ +/**************************************************************************** +* +* Mesa 3-D graphics library +* Direct3D Driver Interface +* +* ======================================================================== +* +* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. +* +* 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 +* SCITECH SOFTWARE INC 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. +* +* ====================================================================== +* +* Language: ANSI C +* Environment: Windows 9x/2000/XP/XBox (Win32) +* +* Description: Mesa Software WGL (WindowsGL) +* +****************************************************************************/ + +#include +#define GL_GLEXT_PROTOTYPES +#include +#include + +#include "glheader.h" +#include "colors.h" +#include "context.h" +#include "colormac.h" +#include "dd.h" +#include "depth.h" +#include "extensions.h" +#include "macros.h" +#include "matrix.h" +// #include "mem.h" +//#include "mmath.h" +#include "mtypes.h" +#include "texformat.h" +#include "texstore.h" +#include "teximage.h" +#include "vbo/vbo.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_lines.h" +#include "swrast/s_triangle.h" +#include "swrast/s_trispan.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +#include "dglcontext.h" +#include "gld_driver.h" + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- + +DGL_pixelFormat pfTemplateMesaSW = +{ + { + sizeof(PIXELFORMATDESCRIPTOR), // Size of the data structure + 1, // Structure version - should be 1 + // Flags: + PFD_DRAW_TO_WINDOW | // The buffer can draw to a window or device surface. + PFD_DRAW_TO_BITMAP | // The buffer can draw to a bitmap. (DaveM) + PFD_SUPPORT_GDI | // The buffer supports GDI drawing. (DaveM) + PFD_SUPPORT_OPENGL | // The buffer supports OpenGL drawing. + PFD_DOUBLEBUFFER | // The buffer is double-buffered. + 0, // Placeholder for easy commenting of above flags + PFD_TYPE_RGBA, // Pixel type RGBA. + 32, // Total colour bitplanes (excluding alpha bitplanes) + 8, 0, // Red bits, shift + 8, 8, // Green bits, shift + 8, 16, // Blue bits, shift + 8, 24, // Alpha bits, shift (destination alpha) + 64, // Accumulator bits (total) + 16, 16, 16, 16, // Accumulator bits: Red, Green, Blue, Alpha + 16, // Depth bits + 8, // Stencil bits + 0, // Number of auxiliary buffers + 0, // Layer type + 0, // Specifies the number of overlay and underlay planes. + 0, // Layer mask + 0, // Specifies the transparent color or index of an underlay plane. + 0 // Damage mask + }, + 0, // Unused +}; + +//--------------------------------------------------------------------------- +// Extensions +//--------------------------------------------------------------------------- + +typedef struct { + PROC proc; + char *name; +} GLD_extension; + +static GLD_extension GLD_extList[] = { +#ifdef GL_EXT_polygon_offset + { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, +#endif + { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, + { (PROC)glBlendColorEXT, "glBlendColorExt" }, + { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, + { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, + { (PROC)glColorPointerEXT, "glColorPointerEXT" }, + { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, + { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, + { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, + { (PROC)glGetPointervEXT, "glGetPointervEXT" }, + { (PROC)glArrayElementEXT, "glArrayElementEXT" }, + { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, + { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, + { (PROC)glBindTextureEXT, "glBindTextureEXT" }, + { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, + { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, + { (PROC)glIsTextureEXT, "glIsTextureEXT" }, + { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, + { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, + { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, + { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, + { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, + { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, + { (PROC)glLockArraysEXT, "glLockArraysEXT" }, + { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" }, + { NULL, "\0" } +}; + +//--------------------------------------------------------------------------- +// WMesa Internal Functions +//--------------------------------------------------------------------------- + +#define PAGE_FILE 0xffffffff + +#define REDBITS 0x03 +#define REDSHIFT 0x00 +#define GREENBITS 0x03 +#define GREENSHIFT 0x03 +#define BLUEBITS 0x02 +#define BLUESHIFT 0x06 + +typedef struct _dibSection { + HDC hDC; + HANDLE hFileMap; + BOOL fFlushed; + LPVOID base; +} WMDIBSECTION, *PWMDIBSECTION; + +typedef struct wmesa_context { + HWND Window; + HDC hDC; + HPALETTE hPalette; + HPALETTE hOldPalette; + HPEN hPen; + HPEN hOldPen; + HCURSOR hOldCursor; + COLORREF crColor; + // 3D projection stuff + RECT drawRect; + UINT uiDIBoffset; + // OpenGL stuff + HPALETTE hGLPalette; + GLuint width; + GLuint height; + GLuint ScanWidth; + GLboolean db_flag; //* double buffered? + GLboolean rgb_flag; //* RGB mode? + GLboolean dither_flag; //* use dither when 256 color mode for RGB? + GLuint depth; //* bits per pixel (1, 8, 24, etc) + ULONG pixel; // current color index or RGBA pixel value + ULONG clearpixel; //* pixel for clearing the color buffers + PBYTE ScreenMem; // WinG memory + BITMAPINFO *IndexFormat; + HPALETTE hPal; // Current Palette + HPALETTE hPalHalfTone; + + + WMDIBSECTION dib; + BITMAPINFO bmi; + HBITMAP hbmDIB; + HBITMAP hOldBitmap; + HBITMAP Old_Compat_BM; + HBITMAP Compat_BM; // Bitmap for double buffering + PBYTE pbPixels; + int nColors; + BYTE cColorBits; + int pixelformat; + + RECT rectOffScreen; + RECT rectSurface; +// HWND hwnd; + DWORD pitch; + PBYTE addrOffScreen; + + // We always double-buffer, for performance reasons, but + // we need to know which of SwapBuffers() or glFlush() to + // handle. If we're emulating, then we update on Flush(), + // otherwise we update on SwapBufers(). KeithH + BOOL bEmulateSingleBuffer; +} WMesaContext, *PWMC; + +#define GLD_GET_WMESA_DRIVER(c) (WMesaContext*)(c)->glPriv + +// TODO: +GLint stereo_flag = 0 ; + +/* If we are double-buffering, we want to get the DC for the + * off-screen DIB, otherwise the DC for the window. + */ +#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) +#define DD_RELEASEDC + +#define FLIP(Y) (Current->height-(Y)-1) + +struct DISPLAY_OPTIONS { + int stereo; + int fullScreen; + int mode; + int bpp; +}; + +struct DISPLAY_OPTIONS displayOptions; + +//--------------------------------------------------------------------------- + +static unsigned char threeto8[8] = { + 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 +}; + +static unsigned char twoto8[4] = { + 0, 0x55, 0xaa, 0xff +}; + +static unsigned char oneto8[2] = { + 0, 255 +}; + +//--------------------------------------------------------------------------- + +BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) +{ + char unsigned redtemp, greentemp, bluetemp, paletteindex; + + //*** now, look up each value in the halftone matrix + //*** using an 8x8 ordered dither. + redtemp = aDividedBy51[red] + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 + + scanline%8]); + greentemp = aDividedBy51[(char unsigned)green] + + (aModulo51[green] > aHalftone8x8[ + (pixel%8)*8 + scanline%8]); + bluetemp = aDividedBy51[(char unsigned)blue] + + (aModulo51[blue] > aHalftone8x8[ + (pixel%8)*8 +scanline%8]); + + //*** recombine the halftoned rgb values into a palette index + paletteindex = + redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; + + //*** and translate through the wing halftone palette + //*** translation vector to give the correct value. + return aWinGHalftoneTranslation[paletteindex]; +} + +//--------------------------------------------------------------------------- + +static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) +{ + unsigned char val; + + val = i >> shift; + switch (nbits) { + + case 1: + val &= 0x1; + return oneto8[val]; + + case 2: + val &= 0x3; + return twoto8[val]; + + case 3: + val &= 0x7; + return threeto8[val]; + + default: + return 0; + } +} + +//--------------------------------------------------------------------------- + + +void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) +{ + WMesaContext *Current = pwc; + + // Test for invalid scanline parameter. KeithH + if ((iScanLine < 0) || (iScanLine >= pwc->height)) + return; + + if (Current->db_flag) { + LPBYTE lpb = pwc->pbPixels; + UINT nBypp = pwc->cColorBits >> 3; + UINT nOffset = iPixel % nBypp; + + lpb += pwc->ScanWidth * iScanLine; + lpb += iPixel * nBypp; + + if(nBypp == 1){ + if(pwc->dither_flag) + *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); + else + *lpb = BGR8(r,g,b); + } + else if(nBypp == 2) + *((LPWORD)lpb) = BGR16(r,g,b); + else if (nBypp == 3) + *((LPDWORD)lpb) = BGR24(r,g,b); + else if (nBypp == 4) + *((LPDWORD)lpb) = BGR32(r,g,b); + } + else{ + SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); + } +} + +//--------------------------------------------------------------------------- + +void wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ) +{ + DWORD dwSize = 0; + DWORD dwScanWidth; + UINT nBypp = pwc->cColorBits / 8; + HDC hic; + + dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); + + pwc->ScanWidth =pwc->pitch = dwScanWidth; + + if (stereo_flag) + pwc->ScanWidth = 2* pwc->pitch; + + dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); + + pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, + NULL, + PAGE_READWRITE | SEC_COMMIT, + 0, + dwSize, + NULL); + + if (!pwc->dib.hFileMap) + return; + + pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, + FILE_MAP_ALL_ACCESS, + 0, + 0, + 0); + + if(!pwc->dib.base){ + CloseHandle(pwc->dib.hFileMap); + return; + } + + + CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); + + hic = CreateIC("display", NULL, NULL, NULL); + pwc->dib.hDC = CreateCompatibleDC(hic); + + + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; + pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); + + DeleteDC(hic); + + return; + +} + +//--------------------------------------------------------------------------- + +void wmCreatePalette( PWMC pwdc ) +{ + /* Create a compressed and re-expanded 3:3:2 palette */ + int i; + LOGPALETTE *pPal; + BYTE rb, rs, gb, gs, bb, bs; + + pwdc->nColors = 0x100; + + pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + + pwdc->nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); + + pPal->palVersion = 0x300; + + rb = REDBITS; + rs = REDSHIFT; + gb = GREENBITS; + gs = GREENSHIFT; + bb = BLUEBITS; + bs = BLUESHIFT; + + if (pwdc->db_flag) { + + /* Need to make two palettes: one for the screen DC and one for the DIB. */ + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + pwdc->hPalette = CreatePalette( pPal ); + } + + else { + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + } + + free(pPal); + +} + +//--------------------------------------------------------------------------- + +/* This function sets the color table of a DIB section + * to match that of the destination DC + */ +BOOL wmSetDibColors(PWMC pwc) +{ + RGBQUAD *pColTab, *pRGB; + PALETTEENTRY *pPal, *pPE; + int i, nColors; + BOOL bRet=TRUE; + DWORD dwErr=0; + + /* Build a color table in the DIB that maps to the + * selected palette in the DC. + */ + nColors = 1 << pwc->cColorBits; + pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); + GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); + pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); + for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { + pRGB->rgbRed = pPE->peRed; + pRGB->rgbGreen = pPE->peGreen; + pRGB->rgbBlue = pPE->peBlue; + } + if(pwc->db_flag) + bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); + + if(!bRet) + dwErr = GetLastError(); + + free( pColTab ); + free( pPal ); + + return bRet; +} + +//--------------------------------------------------------------------------- + +static void wmSetPixelFormat( PWMC wc, HDC hDC) +{ + if(wc->rgb_flag) + wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); + else + wc->cColorBits = 8; + switch(wc->cColorBits){ + case 8: + if(wc->dither_flag != GL_TRUE) + wc->pixelformat = PF_INDEX8; + else + wc->pixelformat = PF_DITHER8; + break; + case 16: + wc->pixelformat = PF_5R6G5B; + break; + case 32: + wc->pixelformat = PF_8R8G8B; + break; + default: + wc->pixelformat = PF_BADFORMAT; + } +} + +//--------------------------------------------------------------------------- + +/* + * This function creates the DIB section that is used for combined + * GL and GDI calls + */ +BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) +{ + HDC hdc = pwc->hDC; + LPBITMAPINFO pbmi = &(pwc->bmi); + int iUsage; + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = lxSize; + pbmi->bmiHeader.biHeight= -lySize; + pbmi->bmiHeader.biPlanes = 1; + if(pwc->rgb_flag) + pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); + else + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 0; + pbmi->bmiHeader.biYPelsPerMeter = 0; + pbmi->bmiHeader.biClrUsed = 0; + pbmi->bmiHeader.biClrImportant = 0; + + iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; + + pwc->cColorBits = pbmi->bmiHeader.biBitCount; + pwc->ScanWidth = pwc->pitch = lxSize; + pwc->width = lxSize; + pwc->height = lySize; + + wmCreateDIBSection(hdc, pwc, pbmi, iUsage); + + if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { + wmCreatePalette( pwc ); + wmSetDibColors( pwc ); + } + wmSetPixelFormat(pwc, pwc->hDC); + return TRUE; +} + +//--------------------------------------------------------------------------- + +/* + * Free up the dib section that was created + */ +BOOL wmDeleteBackingStore(PWMC pwc) +{ + SelectObject(pwc->dib.hDC, pwc->hOldBitmap); + DeleteDC(pwc->dib.hDC); + DeleteObject(pwc->hbmDIB); + UnmapViewOfFile(pwc->dib.base); + CloseHandle(pwc->dib.hFileMap); + return TRUE; +} + +//--------------------------------------------------------------------------- + +/* + * Blit memory DC to screen DC + */ +BOOL wmFlush(PWMC pwc, HDC hDC) +{ + BOOL bRet = 0; + DWORD dwErr = 0; + +// Now using bEmulateSingleBuffer in the calling function. KeithH + +// if(pwc->db_flag){ + bRet = BitBlt(hDC, 0, 0, pwc->width, pwc->height, + pwc->dib.hDC, 0, 0, SRCCOPY); +// } + + return bRet; + +} + +//--------------------------------------------------------------------------- +// Support Functions +//--------------------------------------------------------------------------- + +static void flush(GLcontext* ctx) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); +/* + if((Current->rgb_flag &&!(Current->db_flag)) + ||(!Current->rgb_flag)) + { + wmFlush(Current, Current->hDC); + } +*/ + // Only flush if we're not in double-buffer mode. KeithH + // The demo fractal.c calls glutSwapBuffers() then glFlush()! + if (Current->bEmulateSingleBuffer) { + wmFlush(Current, Current->hDC); + } +} + + +//--------------------------------------------------------------------------- + +/* + * Set the color used to clear the color buffer. + */ +//static void clear_color( GLcontext* ctx, const GLchan color[4] ) +// Changed for Mesa 5.x. KeithH +static void clear_color( + GLcontext* ctx, + const GLfloat color[4]) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLubyte col[4]; + CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); + Current->clearpixel = RGB(col[0], col[1], col[2]); +} + + +//--------------------------------------------------------------------------- + + +/* + * Clear the specified region of the color buffer using the clear color + * or index as specified by one of the two functions above. + * + * This procedure clears either the front and/or the back COLOR buffers. + * Only the "left" buffer is cleared since we are not stereo. + * Clearing of the other non-color buffers is left to the swrast. + * We also only clear the color buffers if the color masks are all 1's. + * Otherwise, we let swrast do it. + */ + +static clear(GLcontext* ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, GLint width, GLint height) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + DWORD dwColor; + WORD wColor; + BYTE bColor; + LPDWORD lpdw = (LPDWORD)Current->pbPixels; + LPWORD lpw = (LPWORD)Current->pbPixels; + LPBYTE lpb = Current->pbPixels; + int lines; + const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; + + if (all){ + x=y=0; + width=Current->width; + height=Current->height; + } + + + /* sanity check - can't have right(stereo) buffers */ + assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0); + + /* clear alpha */ + if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) && + ctx->DrawBuffer->UseSoftwareAlphaBuffers && + ctx->Color.ColorMask[ACOMP]) { + _swrast_clear_alpha_buffers( ctx ); + } + + if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { + if (mask & DD_BACK_LEFT_BIT) { + /* Double-buffering - clear back buffer */ + UINT nBypp = Current->cColorBits / 8; + int i = 0; + int iSize = 0; + + assert(Current->db_flag==GL_TRUE); /* we'd better be double buffer */ + if(nBypp ==1 ){ + iSize = Current->width/4; + bColor = BGR8(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + wColor = MAKEWORD(bColor,bColor); + dwColor = MAKELONG(wColor, wColor); + } + if(nBypp == 2){ + iSize = Current->width / 2; + wColor = BGR16(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + dwColor = MAKELONG(wColor, wColor); + } + else if(nBypp == 4){ + iSize = Current->width; + dwColor = BGR32(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + } + + /* clear a line */ + while(i < iSize){ + *lpdw = dwColor; + lpdw++; + i++; + } + + /* This is the 24bit case */ + if (nBypp == 3) { + iSize = Current->width *3/4; + dwColor = BGR24(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + while(i < iSize){ + *lpdw = dwColor; + lpb += nBypp; + lpdw = (LPDWORD)lpb; + i++; + } + } + + i = 0; + if (stereo_flag) + lines = height /2; + else + lines = height; + /* copy cleared line to other lines in buffer */ + do { + memcpy(lpb, Current->pbPixels, iSize*4); + lpb += Current->ScanWidth; + i++; + } + while (iclearpixel); + HBRUSH Brush=CreateSolidBrush(Current->clearpixel); + HPEN Old_Pen=SelectObject(DC,Pen); + HBRUSH Old_Brush=SelectObject(DC,Brush); + Rectangle(DC,x,y,x+width,y+height); + SelectObject(DC,Old_Pen); + SelectObject(DC,Old_Brush); + DeleteObject(Pen); + DeleteObject(Brush); + DD_RELEASEDC; + mask &= ~DD_FRONT_LEFT_BIT; + } /* single-buffer */ + } /* if masks are all 1's */ + + /* Call swrast if there is anything left to clear (like DEPTH) */ + if (mask) + _swrast_Clear( ctx, mask, all, x, y, width, height ); +} + + +//--------------------------------------------------------------------------- + + +static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + + if (!Current) + return; + + if (pname == GL_DITHER) { + if(enable == GL_FALSE){ + Current->dither_flag = GL_FALSE; + if(Current->cColorBits == 8) + Current->pixelformat = PF_INDEX8; + } + else{ + if (Current->rgb_flag && Current->cColorBits == 8){ + Current->pixelformat = PF_DITHER8; + Current->dither_flag = GL_TRUE; + } + else + Current->dither_flag = GL_FALSE; + } + } +} + +//--------------------------------------------------------------------------- + +static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) +{ + /* TODO: this could be better */ + if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + +//--------------------------------------------------------------------------- + + +static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum buffer ) +{ + /* XXX todo */ + return; +} + + +//--------------------------------------------------------------------------- + + +/* Return characteristics of the output buffer. */ +//static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) +// Altered for Mesa 5.x. KeithH +static void buffer_size( + GLframebuffer *buffer, + GLuint *width, + GLuint *height) +{ + // For some reason the context is not passed into this function. + // Therefore we have to explicitly retrieve it. + GET_CURRENT_CONTEXT(ctx); + + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + int New_Size; + RECT CR; + + GetClientRect(Current->Window,&CR); + + *width=CR.right; + *height=CR.bottom; + + New_Size=((*width)!=Current->width) || ((*height)!=Current->height); + + if (New_Size){ + Current->width=*width; + Current->height=*height; + Current->ScanWidth=Current->width; + if ((Current->ScanWidth%sizeof(long))!=0) + Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); + + if (Current->db_flag){ + if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ + wmDeleteBackingStore(Current); + wmCreateBackingStore(Current, Current->width, Current->height); + } + } + + } +} + + + +/**********************************************************************/ +/***** Accelerated point, line, polygon rendering *****/ +/**********************************************************************/ + +/* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ + +static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) +{ +} + +//--------------------------------------------------------------------------- + +/* Return pointer to accelerated points function */ +extern tnl_points_func choose_points_function( GLcontext* ctx ) +{ + return NULL; +} + +//--------------------------------------------------------------------------- + +static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, + GLuint v1, GLuint pv ) +{ +} + +//--------------------------------------------------------------------------- + +static tnl_line_func choose_line_function( GLcontext* ctx ) +{ +} + + +/**********************************************************************/ +/***** Span-based pixel drawing *****/ +/**********************************************************************/ + + +/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ +static void write_ci32_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLuint index[], + const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal, + RGB(rgba[i][RCOMP], + rgba[i][GCOMP], + rgba[i][BCOMP])); + } + else { + for (i=0; ihPal, + RGB(rgba[i][RCOMP], + rgba[i][GCOMP], + rgba[i][BCOMP])); + } + } +} + +//--------------------------------------------------------------------------- + +/* Write a horizontal span of RGB color pixels with a boolean mask. */ +static void write_rgb_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + PWMC pwc = Current; + + if (pwc->rgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal, + RGB(rgb[i][RCOMP], + rgb[i][GCOMP], + rgb[i][BCOMP])); + } + else { + for (i=0; ihPal, + RGB(rgb[i][RCOMP], + rgb[i][GCOMP], + rgb[i][BCOMP])); + } + } +} + +//--------------------------------------------------------------------------- + +/* + * Write a horizontal span of pixels with a boolean mask. The current color + * is used for all pixels. + */ +static void write_mono_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); + GLuint i; + HDC DC=DD_GETDC; + PWMC pwc = Current; + assert(Current->rgb_flag==GL_TRUE); + y=FLIP(y); + if(Current->rgb_flag==GL_TRUE){ + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = index[i]; + } + } +} + + +//--------------------------------------------------------------------------- + + +/* + * Write an array of pixels with a boolean mask. The current color + * index is used for all pixels. + */ +static void write_mono_ci_pixels( const GLcontext* ctx, + GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = colorIndex; + } + } +} + + +//--------------------------------------------------------------------------- + + +/* Write an array of RGBA pixels with a boolean mask. */ +static void write_rgba_pixels( const GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte rgba[][4], const GLubyte mask[] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + GLuint i; + PWMC pwc = Current; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); + } + } +} + +//--------------------------------------------------------------------------- + +/* Read a horizontal span of color pixels. */ +static void read_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); + WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); + UINT i; + COLORREF Color; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + y = Current->height - y - 1; + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iheight - y[i] - 1; + Color=GetPixel(DC,x[i],y2); + rgba[i][RCOMP] = GetRValue(Color); + rgba[i][GCOMP] = GetGValue(Color); + rgba[i][BCOMP] = GetBValue(Color); + rgba[i][ACOMP] = 255; + } + } + DD_RELEASEDC; +} + +//--------------------------------------------------------------------------- + +static void wmesa_update_state( + GLcontext *ctx, + GLuint new_state) +{ + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _vbo_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); +} + +//--------------------------------------------------------------------------- + +static void wmesa_viewport( + GLcontext *ctx, + GLint x, + GLint y, + GLsizei w, + GLsizei h) +{ +// ctx->Driver.ResizeBuffersMESA(ctx); +} + +//--------------------------------------------------------------------------- + +static void wmesa_update_state_first_time( + GLcontext *ctx, + GLuint new_state) +{ + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); + TNLcontext *tnl = TNL_CONTEXT(ctx); + + _mesa_init_driver_functions(&ctx->Driver); + + /* + * XXX these function pointers could be initialized just once during + * context creation since they don't depend on any state changes. + * kws - This is true - this function gets called a lot and it + * would be good to minimize setting all this when not needed. + */ + // Good idea, so I'll do it. KeithH. :-) + + ctx->Driver.GetString = _gldGetStringGeneric; + ctx->Driver.UpdateState = wmesa_update_state; + ctx->Driver.DrawBuffer = set_draw_buffer; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.GetBufferSize = buffer_size; + + ctx->Driver.Viewport = wmesa_viewport; + + ctx->Driver.Clear = clear; + + ctx->Driver.Flush = flush; + ctx->Driver.ClearColor = clear_color; + ctx->Driver.Enable = enable; + + + // Does not apply for Mesa 5.x + //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; + //ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; + //ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; + + swdd->SetBuffer = set_read_buffer; + + + /* Pixel/span writing functions: */ + swdd->WriteRGBASpan = write_rgba_span; + swdd->WriteRGBSpan = write_rgb_span; + swdd->WriteMonoRGBASpan = write_mono_rgba_span; + swdd->WriteRGBAPixels = write_rgba_pixels; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels; + swdd->WriteCI32Span = write_ci32_span; + swdd->WriteCI8Span = write_ci8_span; + swdd->WriteMonoCISpan = write_mono_ci_span; + swdd->WriteCI32Pixels = write_ci32_pixels; + swdd->WriteMonoCIPixels = write_mono_ci_pixels; + + swdd->ReadCI32Span = read_ci32_span; + swdd->ReadRGBASpan = read_rgba_span; + swdd->ReadCI32Pixels = read_ci32_pixels; + swdd->ReadRGBAPixels = read_rgba_pixels; + + + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + wmesa_update_state(ctx, new_state); +} + +//--------------------------------------------------------------------------- +// Driver interface functions +//--------------------------------------------------------------------------- + +BOOL gldCreateDrawable_MesaSW( + DGL_ctx *pCtx, + BOOL bPersistantInterface, + BOOL bPersistantBuffers) +{ + WMesaContext *c; + GLboolean true_color_flag; + GLboolean rgb_flag = GL_TRUE; + GLboolean db_flag = GL_TRUE; + + if (pCtx == NULL) + return FALSE; + + c = (struct wmesa_context * ) calloc(1,sizeof(struct wmesa_context)); + if (!c) + return FALSE; + + pCtx->glPriv = c; + + c->hDC = pCtx->hDC; + c->Window = pCtx->hWnd; + + true_color_flag = GetDeviceCaps(pCtx->hDC, BITSPIXEL) > 8; + + +#ifdef DITHER + if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ + c->dither_flag = GL_TRUE; + c->hPalHalfTone = WinGCreateHalftonePalette(); + } + else + c->dither_flag = GL_FALSE; +#else + c->dither_flag = GL_FALSE; +#endif + + + if (rgb_flag==GL_FALSE) + { + c->rgb_flag = GL_FALSE; +#if 0 + /* Old WinG stuff???? */ + c->db_flag = db_flag =GL_TRUE; /* WinG requires double buffering */ + printf("Single buffer is not supported in color index mode, ", + "setting to double buffer.\n"); +#endif + } + else + { + c->rgb_flag = GL_TRUE; + } + +// db_flag = pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER ? GL_TRUE : GL_FALSE; + db_flag = GL_TRUE; // Force double-buffer + if (db_flag) { + c->db_flag = 1; + /* Double buffered */ + { + wmCreateBackingStore(c, pCtx->dwWidth, pCtx->dwHeight); + + } + } else { + /* Single Buffered */ + if (c->rgb_flag) + c->db_flag = 0; + } + + c->bEmulateSingleBuffer = (pCtx->lpPF->pfd.dwFlags & PFD_DOUBLEBUFFER) + ? FALSE : TRUE; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldResizeDrawable_MesaSW( + DGL_ctx *ctx, + BOOL bDefaultDriver, + BOOL bPersistantInterface, + BOOL bPersistantBuffers) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + c->hDC = ctx->hDC; + c->Window = ctx->hWnd; +// c->width = ctx->dwWidth; +// c->height = ctx->dwHeight; + + if (c->db_flag) { + wmDeleteBackingStore(c); + wmCreateBackingStore(c, ctx->dwWidth, ctx->dwHeight); + } + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldDestroyDrawable_MesaSW( + DGL_ctx *ctx) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + if (c->hPalHalfTone != NULL) + DeleteObject(c->hPalHalfTone); + + if (c->db_flag) + wmDeleteBackingStore(c); + + free(c); + + ctx->glPriv = NULL; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldCreatePrivateGlobals_MesaSW(void) +{ + // Mesa Software driver needs no private globals + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldDestroyPrivateGlobals_MesaSW(void) +{ + // Mesa Software driver needs no private globals + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldBuildPixelformatList_MesaSW(void) +{ + // Release any existing pixelformat list + if (glb.lpPF) { + free(glb.lpPF); + } + + glb.nPixelFormatCount = 0; + glb.lpPF = NULL; + + glb.lpPF = (DGL_pixelFormat *)calloc(2, sizeof(DGL_pixelFormat)); + if (glb.lpPF == NULL) + return FALSE; + // Single-buffered + memcpy(&glb.lpPF[0], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); + glb.lpPF[0].pfd.dwFlags &= ~PFD_DOUBLEBUFFER; // Remove doublebuffer flag + // Double-buffered + memcpy(&glb.lpPF[1], &pfTemplateMesaSW, sizeof(DGL_pixelFormat)); + glb.nPixelFormatCount = 2; + + // Mark list as 'current' + glb.bPixelformatsDirty = FALSE; + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldInitialiseMesa_MesaSW( + DGL_ctx *gld) +{ + GLcontext *ctx; + + if (gld == NULL) + return FALSE; + + ctx = gld->glCtx; + + // Set max texture size to 256 + ctx->Const.MaxTextureLevels = 8; + + // Multitexture enable/disable + ctx->Const.MaxTextureUnits = (glb.bMultitexture) ? MAX_TEXTURE_UNITS : 1; + + /* Initialize the software rasterizer and helper modules.*/ + + // Added this to force max texture diminsion to 256. KeithH + ctx->Const.MaxTextureLevels = 8; + ctx->Const.MaxDrawBuffers = 1; + + _mesa_enable_sw_extensions(ctx); + _mesa_enable_imaging_extensions(ctx); + _mesa_enable_1_3_extensions(ctx); + +// _swrast_CreateContext( ctx ); +// _vbo_CreateContext( ctx ); +// _tnl_CreateContext( ctx ); +// _swsetup_CreateContext( ctx ); + + _swsetup_Wakeup( ctx ); + + wmesa_update_state_first_time(ctx, ~0); + + return TRUE; +} + +//--------------------------------------------------------------------------- + +BOOL gldSwapBuffers_MesaSW( + DGL_ctx *ctx, + HDC hDC, + HWND hWnd) +{ + WMesaContext *c; + + if (ctx == NULL) + return FALSE; + + c = ctx->glPriv; + if (c == NULL) + return FALSE; + + /* If we're swapping the buffer associated with the current context + * we have to flush any pending rendering commands first. + */ + + // Altered to respect bEmulateSingleBuffer. KeithH +// if (c->db_flag) + if (!c->bEmulateSingleBuffer) + wmFlush(c, hDC); + + return TRUE; +} + +//--------------------------------------------------------------------------- + +PROC gldGetProcAddress_MesaSW( + LPCSTR a) +{ + int i; + PROC proc = NULL; + + for (i=0; GLD_extList[i].proc; i++) { + if (!strcmp(a, GLD_extList[i].name)) { + proc = GLD_extList[i].proc; + break; + } + } + + gldLogPrintf(GLDLOG_INFO, "GetProcAddress: %s (%s)", a, proc ? "OK" : "Failed"); + + return proc; +} + +//--------------------------------------------------------------------------- + +BOOL gldGetDisplayMode_MesaSW( + DGL_ctx *ctx, + GLD_displayMode *glddm) +{ + HDC hdcDesktop; + + if (glddm == NULL) + return FALSE; + + // + // A bit hacky... KeithH + // + + hdcDesktop = GetDC(NULL); + glddm->Width = GetDeviceCaps(hdcDesktop, HORZRES); + glddm->Height = GetDeviceCaps(hdcDesktop, VERTRES); + glddm->BPP = GetDeviceCaps(hdcDesktop, BITSPIXEL); + glddm->Refresh = 0; + ReleaseDC(0, hdcDesktop); + + return TRUE; +} + +//--------------------------------------------------------------------------- + --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/gldirect/mesasw/colors.h +++ mesa-7.9~git20100924/src/mesa/drivers/windows/gldirect/mesasw/colors.h @@ -0,0 +1,520 @@ +/* File name : colors.h + * Version : 2.3 + * + * Header file for display driver for Mesa 2.3 under + * Windows95 and WindowsNT + * This file defines macros and global variables needed + * for converting color format + * + * Copyright (C) 1996- Li Wei + * Address : Institute of Artificial Intelligence + * : & Robotics + * : Xi'an Jiaotong University + * Email : liwei@aiar.xjtu.edu.cn + * Web page : http://sun.aiar.xjtu.edu.cn + * + * This file and its associations are partially based on the + * Windows NT driver for Mesa, written by Mark Leaming + * (mark@rsinc.com). + */ + +/* + * Macros for pixel format defined + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Add LUTs need for dithering + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Add BGR8 Macro + */ + +/* + * Revision 1.1 2004/04/20 11:13:11 alanh + * add SciTech's GLDirect driver for Windows. + * + * This code is donated to Mesa which allows the usage of + * a Direct3D layer (DX7, DX8, DX9 or complete software fallback). + * + * No build system exists for this code yet, that will come..... + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1999/01/03 03:08:57 brianp + * Ted Jump's changes + * + * Revision 1.1 1999/01/03 03:08:12 brianp + * Initial revision + * + * Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn) + * Initial revision + */ +/* Values for wmesa->pixelformat: */ + +#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */ +#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */ +#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */ +#define PF_DITHER8 6 /* Dithered RGB using a lookup table */ +#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */ +#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */ +#define PF_BADFORMAT 11 +#define PF_INDEX8 12 + +char ColorMap16[] = { +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04, +0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05, +0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06, +0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, +0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, +0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09, +0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A, +0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B, +0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, +0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D, +0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E, +0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, +0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, +0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, +0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, +0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13, +0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14, +0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, +0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, +0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19, +0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A, +0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B, +0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C, +0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D, +0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E, +0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; + +#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5))) +#ifdef DDRAW +#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11))) +#else +#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10))) +#endif +#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8) +#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) + + + +/* + * If pixelformat==PF_8A8B8G8R: + */ +#define PACK_8A8B8G8R( R, G, B, A ) \ + ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) ) + + +/* + * If pixelformat==PF_8R8G8B: + */ +#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) ) + + +/* + * If pixelformat==PF_5R6G5B: + */ + + +#ifdef DDRAW +#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11))) +#else +#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10))) +#endif +/*---------------------------------------------------------------------------- + +Division lookup tables. These tables compute 0-255 divided by 51 and +modulo 51. These tables could approximate gamma correction. + +*/ + +char unsigned const aDividedBy51Rounded[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, +}; + +char unsigned const aDividedBy51[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, +}; + +char unsigned const aModulo51[256] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, +}; + +/*---------------------------------------------------------------------------- + +Multiplication LUTs. These compute 0-5 times 6 and 36. + +*/ + +char unsigned const aTimes6[6] = +{ + 0, 6, 12, 18, 24, 30 +}; + +char unsigned const aTimes36[6] = +{ + 0, 36, 72, 108, 144, 180 +}; + + +/*---------------------------------------------------------------------------- + +Dither matrices for 8 bit to 2.6 bit halftones. + +*/ + +char unsigned const aHalftone16x16[256] = +{ + 0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43, + 34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21, + 38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6, + 22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34, + 2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42, + 37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20, + 40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4, + 24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32, + 2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41, + 37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19, + 40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3, + 24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31, + 1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43, + 36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21, + 39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5, + 23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33, +}; + +char unsigned const aHalftone8x8[64] = +{ + 0, 38, 9, 47, 2, 40, 11, 50, + 25, 12, 35, 22, 27, 15, 37, 24, + 6, 44, 3, 41, 8, 47, 5, 43, + 31, 19, 28, 15, 34, 21, 31, 18, + 1, 39, 11, 49, 0, 39, 10, 48, + 27, 14, 36, 23, 26, 13, 35, 23, + 7, 46, 4, 43, 7, 45, 3, 42, + 33, 20, 30, 17, 32, 19, 29, 16, +}; + +char unsigned const aHalftone4x4_1[16] = +{ + 0, 25, 6, 31, + 38, 12, 44, 19, + 9, 35, 3, 28, + 47, 22, 41, 15 +}; + +char unsigned const aHalftone4x4_2[16] = +{ + 41, 3, 9, 28, + 35, 15, 22, 47, + 6, 25, 38, 0, + 19, 44, 31, 12 +}; + +/*************************************************************************** + aWinGHalftoneTranslation + + Translates a 2.6 bit-per-pixel halftoned representation into the + slightly rearranged WinG Halftone Palette. +*/ + +char unsigned const aWinGHalftoneTranslation[216] = +{ + 0, + 29, + 30, + 31, + 32, + 249, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 250, + 250, + 57, + 58, + 59, + 251, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 250, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 227, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 151, + 120, + 121, + 122, + 123, + 124, + 228, + 125, + 126, + 229, + 133, + 162, + 135, + 131, + 132, + 137, + 166, + 134, + 140, + 130, + 136, + 143, + 138, + 139, + 174, + 141, + 142, + 177, + 129, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 157, + 152, + 153, + 154, + 155, + 156, + 192, + 158, + 159, + 160, + 161, + 196, + 163, + 164, + 165, + 127, + 199, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 207, + 175, + 176, + 210, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 224, + 193, + 194, + 195, + 252, + 252, + 197, + 198, + 128, + 253, + 252, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 230, + 208, + 209, + 231, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 254, + 223, + 232, + 225, + 226, + 255, +}; --- mesa-7.9~git20100924.orig/src/mesa/drivers/windows/fx/fx.rc +++ mesa-7.9~git20100924/src/mesa/drivers/windows/fx/fx.rc @@ -0,0 +1,39 @@ +#include + +#define PRODNAME "Mesa 6.x" +#define CONTACTSTR "http://www.mesa3d.org" +#define HWSTR "3dfx Voodoo Graphics, Voodoo Rush, Voodoo^2, Voodoo Banshee, Velocity 100/200, Voodoo3, Voodoo4, Voodoo5" +#define COPYRIGHTSTR "Copyright \251 Brian E. Paul" + +#define VERSIONSTR "6.3.0.1" +#define MANVERSION 6 +#define MANREVISION 3 +#define BUILD_NUMBER 1 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER + PRODUCTVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER + FILEFLAGSMASK 0x0030003FL + + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DRV + FILESUBTYPE VFT2_DRV_INSTALLABLE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileDescription", PRODNAME + VALUE "FileVersion", VERSIONSTR + VALUE "LegalCopyright", COPYRIGHTSTR + VALUE "ProductName", PRODNAME + VALUE "Graphics Subsystem", HWSTR + VALUE "Contact", CONTACTSTR + END + END + BLOCK "VarFileInfo" + BEGIN + /* the following line should be extended for localized versions */ + VALUE "Translation", 0x409, 1252 + END +END --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/r300/Lindent +++ mesa-7.9~git20100924/src/mesa/drivers/dri/r300/Lindent @@ -0,0 +1,2 @@ +#!/bin/sh +indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/r300/compiler/SConscript +++ mesa-7.9~git20100924/src/mesa/drivers/dri/r300/compiler/SConscript @@ -0,0 +1,43 @@ +Import('*') + +env = env.Clone() +env.Append(CPPPATH = '#/include') +env.Append(CPPPATH = '#/src/mesa') + +# temporary fix +env['CFLAGS'] = str(env['CFLAGS']).replace('-Werror=declaration-after-statement', '') + +r300compiler = env.ConvenienceLibrary( + target = 'r300compiler', + source = [ + 'radeon_code.c', + 'radeon_compiler.c', + 'radeon_program.c', + 'radeon_program_print.c', + 'radeon_opcodes.c', + 'radeon_program_alu.c', + 'radeon_program_pair.c', + 'radeon_program_tex.c', + 'radeon_pair_translate.c', + 'radeon_pair_schedule.c', + 'radeon_pair_regalloc.c', + 'radeon_optimize.c', + 'radeon_remove_constants.c', + 'radeon_rename_regs.c', + 'radeon_emulate_branches.c', + 'radeon_emulate_loops.c', + 'radeon_dataflow.c', + 'radeon_dataflow_deadcode.c', + 'radeon_dataflow_swizzles.c', + 'r3xx_fragprog.c', + 'r300_fragprog.c', + 'r300_fragprog_swizzle.c', + 'r300_fragprog_emit.c', + 'r500_fragprog.c', + 'r500_fragprog_emit.c', + 'r3xx_vertprog.c', + 'r3xx_vertprog_dump.c', + 'memory_pool.c', + ]) + +Return('r300compiler') --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/r600/Lindent +++ mesa-7.9~git20100924/src/mesa/drivers/dri/r600/Lindent @@ -0,0 +1,2 @@ +#!/bin/sh +indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/i965/brw_fs.cpp +++ mesa-7.9~git20100924/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -0,0 +1,1929 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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: + * Eric Anholt + * + */ + +extern "C" { + +#include + +#include "main/macros.h" +#include "main/shaderobj.h" +#include "program/prog_parameter.h" +#include "program/prog_print.h" +#include "program/prog_optimize.h" +#include "program/hash_table.h" +#include "brw_context.h" +#include "brw_eu.h" +#include "brw_wm.h" +#include "talloc.h" +} +#include "../glsl/glsl_types.h" +#include "../glsl/ir_optimization.h" +#include "../glsl/ir_print_visitor.h" + +enum register_file { + ARF = BRW_ARCHITECTURE_REGISTER_FILE, + GRF = BRW_GENERAL_REGISTER_FILE, + MRF = BRW_MESSAGE_REGISTER_FILE, + IMM = BRW_IMMEDIATE_VALUE, + FIXED_HW_REG, /* a struct brw_reg */ + UNIFORM, /* prog_data->params[hw_reg] */ + BAD_FILE +}; + +enum fs_opcodes { + FS_OPCODE_FB_WRITE = 256, + FS_OPCODE_RCP, + FS_OPCODE_RSQ, + FS_OPCODE_SQRT, + FS_OPCODE_EXP2, + FS_OPCODE_LOG2, + FS_OPCODE_POW, + FS_OPCODE_SIN, + FS_OPCODE_COS, + FS_OPCODE_DDX, + FS_OPCODE_DDY, + FS_OPCODE_LINTERP, + FS_OPCODE_TEX, + FS_OPCODE_TXB, + FS_OPCODE_TXL, + FS_OPCODE_DISCARD, +}; + +static int using_new_fs = -1; + +struct gl_shader * +brw_new_shader(GLcontext *ctx, GLuint name, GLuint type) +{ + struct brw_shader *shader; + + shader = talloc_zero(NULL, struct brw_shader); + if (shader) { + shader->base.Type = type; + shader->base.Name = name; + _mesa_init_shader(ctx, &shader->base); + } + + return &shader->base; +} + +struct gl_shader_program * +brw_new_shader_program(GLcontext *ctx, GLuint name) +{ + struct brw_shader_program *prog; + prog = talloc_zero(NULL, struct brw_shader_program); + if (prog) { + prog->base.Name = name; + _mesa_init_shader_program(ctx, &prog->base); + } + return &prog->base; +} + +GLboolean +brw_compile_shader(GLcontext *ctx, struct gl_shader *shader) +{ + if (!_mesa_ir_compile_shader(ctx, shader)) + return GL_FALSE; + + return GL_TRUE; +} + +GLboolean +brw_link_shader(GLcontext *ctx, struct gl_shader_program *prog) +{ + if (using_new_fs == -1) + using_new_fs = getenv("INTEL_NEW_FS") != NULL; + + for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) { + struct brw_shader *shader = (struct brw_shader *)prog->_LinkedShaders[i]; + + if (using_new_fs && shader->base.Type == GL_FRAGMENT_SHADER) { + void *mem_ctx = talloc_new(NULL); + bool progress; + + if (shader->ir) + talloc_free(shader->ir); + shader->ir = new(shader) exec_list; + clone_ir_list(mem_ctx, shader->ir, shader->base.ir); + + do_mat_op_to_vec(shader->ir); + do_mod_to_fract(shader->ir); + do_div_to_mul_rcp(shader->ir); + do_sub_to_add_neg(shader->ir); + do_explog_to_explog2(shader->ir); + + brw_do_channel_expressions(shader->ir); + brw_do_vector_splitting(shader->ir); + + do { + progress = false; + + progress = do_common_optimization(shader->ir, true, 32) || progress; + } while (progress); + + validate_ir_tree(shader->ir); + + reparent_ir(shader->ir, shader->ir); + talloc_free(mem_ctx); + } + } + + if (!_mesa_ir_link_shader(ctx, prog)) + return GL_FALSE; + + return GL_TRUE; +} + +static int +type_size(const struct glsl_type *type) +{ + unsigned int size, i; + + switch (type->base_type) { + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + case GLSL_TYPE_FLOAT: + case GLSL_TYPE_BOOL: + return type->components(); + case GLSL_TYPE_ARRAY: + /* FINISHME: uniform/varying arrays. */ + return type_size(type->fields.array) * type->length; + case GLSL_TYPE_STRUCT: + size = 0; + for (i = 0; i < type->length; i++) { + size += type_size(type->fields.structure[i].type); + } + return size; + case GLSL_TYPE_SAMPLER: + /* Samplers take up no register space, since they're baked in at + * link time. + */ + return 0; + default: + assert(!"not reached"); + return 0; + } +} + +class fs_reg { +public: + /* Callers of this talloc-based new need not call delete. It's + * easier to just talloc_free 'ctx' (or any of its ancestors). */ + static void* operator new(size_t size, void *ctx) + { + void *node; + + node = talloc_size(ctx, size); + assert(node != NULL); + + return node; + } + + void init() + { + this->reg = 0; + this->reg_offset = 0; + this->negate = 0; + this->abs = 0; + this->hw_reg = -1; + } + + /** Generic unset register constructor. */ + fs_reg() + { + init(); + this->file = BAD_FILE; + } + + /** Immediate value constructor. */ + fs_reg(float f) + { + init(); + this->file = IMM; + this->type = BRW_REGISTER_TYPE_F; + this->imm.f = f; + } + + /** Immediate value constructor. */ + fs_reg(int32_t i) + { + init(); + this->file = IMM; + this->type = BRW_REGISTER_TYPE_D; + this->imm.i = i; + } + + /** Immediate value constructor. */ + fs_reg(uint32_t u) + { + init(); + this->file = IMM; + this->type = BRW_REGISTER_TYPE_UD; + this->imm.u = u; + } + + /** Fixed brw_reg Immediate value constructor. */ + fs_reg(struct brw_reg fixed_hw_reg) + { + init(); + this->file = FIXED_HW_REG; + this->fixed_hw_reg = fixed_hw_reg; + this->type = fixed_hw_reg.type; + } + + fs_reg(enum register_file file, int hw_reg); + fs_reg(class fs_visitor *v, const struct glsl_type *type); + + /** Register file: ARF, GRF, MRF, IMM. */ + enum register_file file; + /** Abstract register number. 0 = fixed hw reg */ + int reg; + /** Offset within the abstract register. */ + int reg_offset; + /** HW register number. Generally unset until register allocation. */ + int hw_reg; + /** Register type. BRW_REGISTER_TYPE_* */ + int type; + bool negate; + bool abs; + struct brw_reg fixed_hw_reg; + + /** Value for file == BRW_IMMMEDIATE_FILE */ + union { + int32_t i; + uint32_t u; + float f; + } imm; +}; + +static const fs_reg reg_undef; +static const fs_reg reg_null(ARF, BRW_ARF_NULL); + +class fs_inst : public exec_node { +public: + /* Callers of this talloc-based new need not call delete. It's + * easier to just talloc_free 'ctx' (or any of its ancestors). */ + static void* operator new(size_t size, void *ctx) + { + void *node; + + node = talloc_zero_size(ctx, size); + assert(node != NULL); + + return node; + } + + void init() + { + this->opcode = BRW_OPCODE_NOP; + this->saturate = false; + this->conditional_mod = BRW_CONDITIONAL_NONE; + this->predicated = false; + this->sampler = 0; + this->shadow_compare = false; + } + + fs_inst() + { + init(); + } + + fs_inst(int opcode) + { + init(); + this->opcode = opcode; + } + + fs_inst(int opcode, fs_reg dst, fs_reg src0) + { + init(); + this->opcode = opcode; + this->dst = dst; + this->src[0] = src0; + } + + fs_inst(int opcode, fs_reg dst, fs_reg src0, fs_reg src1) + { + init(); + this->opcode = opcode; + this->dst = dst; + this->src[0] = src0; + this->src[1] = src1; + } + + fs_inst(int opcode, fs_reg dst, fs_reg src0, fs_reg src1, fs_reg src2) + { + init(); + this->opcode = opcode; + this->dst = dst; + this->src[0] = src0; + this->src[1] = src1; + this->src[2] = src2; + } + + int opcode; /* BRW_OPCODE_* or FS_OPCODE_* */ + fs_reg dst; + fs_reg src[3]; + bool saturate; + bool predicated; + int conditional_mod; /**< BRW_CONDITIONAL_* */ + + int mlen; /** SEND message length */ + int sampler; + bool shadow_compare; + + /** @{ + * Annotation for the generated IR. One of the two can be set. + */ + ir_instruction *ir; + const char *annotation; + /** @} */ +}; + +class fs_visitor : public ir_visitor +{ +public: + + fs_visitor(struct brw_wm_compile *c, struct brw_shader *shader) + { + this->c = c; + this->p = &c->func; + this->brw = p->brw; + this->intel = &brw->intel; + this->ctx = &intel->ctx; + this->mem_ctx = talloc_new(NULL); + this->shader = shader; + this->fail = false; + this->next_abstract_grf = 1; + this->variable_ht = hash_table_ctor(0, + hash_table_pointer_hash, + hash_table_pointer_compare); + + this->frag_color = NULL; + this->frag_data = NULL; + this->frag_depth = NULL; + this->first_non_payload_grf = 0; + + this->current_annotation = NULL; + this->annotation_string = NULL; + this->annotation_ir = NULL; + } + ~fs_visitor() + { + talloc_free(this->mem_ctx); + hash_table_dtor(this->variable_ht); + } + + fs_reg *variable_storage(ir_variable *var); + + void visit(ir_variable *ir); + void visit(ir_assignment *ir); + void visit(ir_dereference_variable *ir); + void visit(ir_dereference_record *ir); + void visit(ir_dereference_array *ir); + void visit(ir_expression *ir); + void visit(ir_texture *ir); + void visit(ir_if *ir); + void visit(ir_constant *ir); + void visit(ir_swizzle *ir); + void visit(ir_return *ir); + void visit(ir_loop *ir); + void visit(ir_loop_jump *ir); + void visit(ir_discard *ir); + void visit(ir_call *ir); + void visit(ir_function *ir); + void visit(ir_function_signature *ir); + + fs_inst *emit(fs_inst inst); + void assign_curb_setup(); + void assign_urb_setup(); + void assign_regs(); + void generate_code(); + void generate_fb_write(fs_inst *inst); + void generate_linterp(fs_inst *inst, struct brw_reg dst, + struct brw_reg *src); + void generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src); + void generate_math(fs_inst *inst, struct brw_reg dst, struct brw_reg *src); + void generate_discard(fs_inst *inst); + + void emit_dummy_fs(); + void emit_interpolation(); + void emit_pinterp(int location); + void emit_fb_writes(); + + struct brw_reg interp_reg(int location, int channel); + + struct brw_context *brw; + struct intel_context *intel; + GLcontext *ctx; + struct brw_wm_compile *c; + struct brw_compile *p; + struct brw_shader *shader; + void *mem_ctx; + exec_list instructions; + int next_abstract_grf; + struct hash_table *variable_ht; + ir_variable *frag_color, *frag_data, *frag_depth; + int first_non_payload_grf; + + /** @{ debug annotation info */ + const char *current_annotation; + ir_instruction *base_ir; + const char **annotation_string; + ir_instruction **annotation_ir; + /** @} */ + + bool fail; + + /* Result of last visit() method. */ + fs_reg result; + + fs_reg pixel_x; + fs_reg pixel_y; + fs_reg pixel_w; + fs_reg delta_x; + fs_reg delta_y; + fs_reg interp_attrs[64]; + + int grf_used; + +}; + +/** Fixed HW reg constructor. */ +fs_reg::fs_reg(enum register_file file, int hw_reg) +{ + init(); + this->file = file; + this->hw_reg = hw_reg; + this->type = BRW_REGISTER_TYPE_F; +} + +/** Automatic reg constructor. */ +fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) +{ + init(); + + this->file = GRF; + this->reg = v->next_abstract_grf; + this->reg_offset = 0; + v->next_abstract_grf += type_size(type); + + switch (type->base_type) { + case GLSL_TYPE_FLOAT: + this->type = BRW_REGISTER_TYPE_F; + break; + case GLSL_TYPE_INT: + case GLSL_TYPE_BOOL: + this->type = BRW_REGISTER_TYPE_D; + break; + case GLSL_TYPE_UINT: + this->type = BRW_REGISTER_TYPE_UD; + break; + default: + assert(!"not reached"); + this->type = BRW_REGISTER_TYPE_F; + break; + } +} + +fs_reg * +fs_visitor::variable_storage(ir_variable *var) +{ + return (fs_reg *)hash_table_find(this->variable_ht, var); +} + +void +fs_visitor::visit(ir_variable *ir) +{ + fs_reg *reg = NULL; + + if (strcmp(ir->name, "gl_FragColor") == 0) { + this->frag_color = ir; + } else if (strcmp(ir->name, "gl_FragData") == 0) { + this->frag_data = ir; + } else if (strcmp(ir->name, "gl_FragDepth") == 0) { + this->frag_depth = ir; + assert(!"FINISHME: this hangs currently."); + } + + if (ir->mode == ir_var_in) { + reg = &this->interp_attrs[ir->location]; + } + + if (ir->mode == ir_var_uniform) { + const float *vec_values; + int param_index = c->prog_data.nr_params; + + /* FINISHME: This is wildly incomplete. */ + assert(ir->type->is_scalar() || ir->type->is_vector() || + ir->type->is_sampler()); + + const struct gl_program *fp = &this->brw->fragment_program->Base; + /* Our support for uniforms is piggy-backed on the struct + * gl_fragment_program, because that's where the values actually + * get stored, rather than in some global gl_shader_program uniform + * store. + */ + vec_values = fp->Parameters->ParameterValues[ir->location]; + for (unsigned int i = 0; i < ir->type->vector_elements; i++) { + c->prog_data.param[c->prog_data.nr_params++] = &vec_values[i]; + } + + reg = new(this->mem_ctx) fs_reg(UNIFORM, param_index); + } + + if (!reg) + reg = new(this->mem_ctx) fs_reg(this, ir->type); + + hash_table_insert(this->variable_ht, reg, ir); +} + +void +fs_visitor::visit(ir_dereference_variable *ir) +{ + fs_reg *reg = variable_storage(ir->var); + this->result = *reg; +} + +void +fs_visitor::visit(ir_dereference_record *ir) +{ + assert(!"FINISHME"); +} + +void +fs_visitor::visit(ir_dereference_array *ir) +{ + ir_constant *index; + int element_size; + + ir->array->accept(this); + index = ir->array_index->as_constant(); + + if (ir->type->is_matrix()) { + element_size = ir->type->vector_elements; + } else { + element_size = type_size(ir->type); + } + + if (index) { + assert(this->result.file == UNIFORM || + (this->result.file == GRF && + this->result.reg != 0)); + this->result.reg_offset += index->value.i[0] * element_size; + } else { + assert(!"FINISHME: non-constant matrix column"); + } +} + +void +fs_visitor::visit(ir_expression *ir) +{ + unsigned int operand; + fs_reg op[2], temp; + fs_reg result; + fs_inst *inst; + + for (operand = 0; operand < ir->get_num_operands(); operand++) { + ir->operands[operand]->accept(this); + if (this->result.file == BAD_FILE) { + ir_print_visitor v; + printf("Failed to get tree for expression operand:\n"); + ir->operands[operand]->accept(&v); + this->fail = true; + } + op[operand] = this->result; + + /* Matrix expression operands should have been broken down to vector + * operations already. + */ + assert(!ir->operands[operand]->type->is_matrix()); + /* And then those vector operands should have been broken down to scalar. + */ + assert(!ir->operands[operand]->type->is_vector()); + } + + /* Storage for our result. If our result goes into an assignment, it will + * just get copy-propagated out, so no worries. + */ + this->result = fs_reg(this, ir->type); + + switch (ir->operation) { + case ir_unop_logic_not: + emit(fs_inst(BRW_OPCODE_ADD, this->result, op[0], fs_reg(-1))); + break; + case ir_unop_neg: + op[0].negate = ~op[0].negate; + this->result = op[0]; + break; + case ir_unop_abs: + op[0].abs = true; + this->result = op[0]; + break; + case ir_unop_sign: + temp = fs_reg(this, ir->type); + + emit(fs_inst(BRW_OPCODE_MOV, this->result, fs_reg(0.0f))); + + inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null, op[0], fs_reg(0.0f))); + inst->conditional_mod = BRW_CONDITIONAL_G; + inst = emit(fs_inst(BRW_OPCODE_MOV, this->result, fs_reg(1.0f))); + inst->predicated = true; + + inst = emit(fs_inst(BRW_OPCODE_CMP, reg_null, op[0], fs_reg(0.0f))); + inst->conditional_mod = BRW_CONDITIONAL_L; + inst = emit(fs_inst(BRW_OPCODE_MOV, this->result, fs_reg(-1.0f))); + inst->predicated = true; + + break; + case ir_unop_rcp: + emit(fs_inst(FS_OPCODE_RCP, this->result, op[0])); + break; + + case ir_unop_exp2: + emit(fs_inst(FS_OPCODE_EXP2, this->result, op[0])); + break; + case ir_unop_log2: + emit(fs_inst(FS_OPCODE_LOG2, this->result, op[0])); + break; + case ir_unop_exp: + case ir_unop_log: + assert(!"not reached: should be handled by ir_explog_to_explog2"); + break; + case ir_unop_sin: + emit(fs_inst(FS_OPCODE_SIN, this->result, op[0])); + break; + case ir_unop_cos: + emit(fs_inst(FS_OPCODE_COS, this->result, op[0])); + break; + + case ir_unop_dFdx: + emit(fs_inst(FS_OPCODE_DDX, this->result, op[0])); + break; + case ir_unop_dFdy: + emit(fs_inst(FS_OPCODE_DDY, this->result, op[0])); + break; + + case ir_binop_add: + emit(fs_inst(BRW_OPCODE_ADD, this->result, op[0], op[1])); + break; + case ir_binop_sub: + assert(!"not reached: should be handled by ir_sub_to_add_neg"); + break; + + case ir_binop_mul: + emit(fs_inst(BRW_OPCODE_MUL, this->result, op[0], op[1])); + break; + case ir_binop_div: + assert(!"not reached: should be handled by ir_div_to_mul_rcp"); + break; + case ir_binop_mod: + assert(!"ir_binop_mod should have been converted to b * fract(a/b)"); + break; + + case ir_binop_less: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_L; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + case ir_binop_greater: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_G; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + case ir_binop_lequal: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_LE; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + case ir_binop_gequal: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_GE; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + case ir_binop_equal: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_Z; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + case ir_binop_nequal: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_NZ; + emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1))); + break; + + case ir_binop_logic_xor: + emit(fs_inst(BRW_OPCODE_XOR, this->result, op[0], op[1])); + break; + + case ir_binop_logic_or: + emit(fs_inst(BRW_OPCODE_OR, this->result, op[0], op[1])); + break; + + case ir_binop_logic_and: + emit(fs_inst(BRW_OPCODE_AND, this->result, op[0], op[1])); + break; + + case ir_binop_dot: + case ir_binop_cross: + case ir_unop_any: + assert(!"not reached: should be handled by brw_channel_expressions"); + break; + + case ir_unop_noise: + assert(!"not reached: should be handled by lower_noise"); + break; + + case ir_unop_sqrt: + emit(fs_inst(FS_OPCODE_SQRT, this->result, op[0])); + break; + + case ir_unop_rsq: + emit(fs_inst(FS_OPCODE_RSQ, this->result, op[0])); + break; + + case ir_unop_i2f: + case ir_unop_b2f: + case ir_unop_b2i: + emit(fs_inst(BRW_OPCODE_MOV, this->result, op[0])); + break; + case ir_unop_f2i: + emit(fs_inst(BRW_OPCODE_MOV, this->result, op[0])); + break; + case ir_unop_f2b: + case ir_unop_i2b: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], fs_reg(0.0f))); + inst->conditional_mod = BRW_CONDITIONAL_NZ; + + case ir_unop_trunc: + emit(fs_inst(BRW_OPCODE_RNDD, this->result, op[0])); + break; + case ir_unop_ceil: + op[0].negate = ~op[0].negate; + inst = emit(fs_inst(BRW_OPCODE_RNDD, this->result, op[0])); + this->result.negate = true; + break; + case ir_unop_floor: + inst = emit(fs_inst(BRW_OPCODE_RNDD, this->result, op[0])); + break; + case ir_unop_fract: + inst = emit(fs_inst(BRW_OPCODE_FRC, this->result, op[0])); + break; + + case ir_binop_min: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_L; + + inst = emit(fs_inst(BRW_OPCODE_SEL, this->result, op[0], op[1])); + inst->predicated = true; + break; + case ir_binop_max: + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1])); + inst->conditional_mod = BRW_CONDITIONAL_G; + + inst = emit(fs_inst(BRW_OPCODE_SEL, this->result, op[0], op[1])); + inst->predicated = true; + break; + + case ir_binop_pow: + inst = emit(fs_inst(FS_OPCODE_POW, this->result, op[0], op[1])); + break; + + case ir_unop_bit_not: + case ir_unop_u2f: + case ir_binop_lshift: + case ir_binop_rshift: + case ir_binop_bit_and: + case ir_binop_bit_xor: + case ir_binop_bit_or: + assert(!"GLSL 1.30 features unsupported"); + break; + } +} + +void +fs_visitor::visit(ir_assignment *ir) +{ + struct fs_reg l, r; + int i; + int write_mask; + fs_inst *inst; + + /* FINISHME: arrays on the lhs */ + ir->lhs->accept(this); + l = this->result; + + ir->rhs->accept(this); + r = this->result; + + /* FINISHME: This should really set to the correct maximal writemask for each + * FINISHME: component written (in the loops below). This case can only + * FINISHME: occur for matrices, arrays, and structures. + */ + if (ir->write_mask == 0) { + assert(!ir->lhs->type->is_scalar() && !ir->lhs->type->is_vector()); + write_mask = WRITEMASK_XYZW; + } else { + assert(ir->lhs->type->is_vector() || ir->lhs->type->is_scalar()); + write_mask = ir->write_mask; + } + + assert(l.file != BAD_FILE); + assert(r.file != BAD_FILE); + + if (ir->condition) { + /* Get the condition bool into the predicate. */ + ir->condition->accept(this); + inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, fs_reg(0))); + inst->conditional_mod = BRW_CONDITIONAL_NZ; + } + + for (i = 0; i < type_size(ir->lhs->type); i++) { + if (i >= 4 || (write_mask & (1 << i))) { + inst = emit(fs_inst(BRW_OPCODE_MOV, l, r)); + if (ir->condition) + inst->predicated = true; + } + l.reg_offset++; + r.reg_offset++; + } +} + +void +fs_visitor::visit(ir_texture *ir) +{ + int base_mrf = 2; + fs_inst *inst = NULL; + unsigned int mlen = 0; + + ir->coordinate->accept(this); + fs_reg coordinate = this->result; + + if (ir->projector) { + fs_reg inv_proj = fs_reg(this, glsl_type::float_type); + + ir->projector->accept(this); + emit(fs_inst(FS_OPCODE_RCP, inv_proj, this->result)); + + fs_reg proj_coordinate = fs_reg(this, ir->coordinate->type); + for (unsigned int i = 0; i < ir->coordinate->type->vector_elements; i++) { + emit(fs_inst(BRW_OPCODE_MUL, proj_coordinate, coordinate, inv_proj)); + coordinate.reg_offset++; + proj_coordinate.reg_offset++; + } + proj_coordinate.reg_offset = 0; + + coordinate = proj_coordinate; + } + + for (mlen = 0; mlen < ir->coordinate->type->vector_elements; mlen++) { + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), coordinate)); + coordinate.reg_offset++; + } + + /* Pre-Ironlake, the 8-wide sampler always took u,v,r. */ + if (intel->gen < 5) + mlen = 3; + + if (ir->shadow_comparitor) { + /* For shadow comparisons, we have to supply u,v,r. */ + mlen = 3; + + ir->shadow_comparitor->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); + mlen++; + } + + /* Do we ever want to handle writemasking on texture samples? Is it + * performance relevant? + */ + fs_reg dst = fs_reg(this, glsl_type::vec4_type); + + switch (ir->op) { + case ir_tex: + inst = emit(fs_inst(FS_OPCODE_TEX, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txb: + ir->lod_info.bias->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); + mlen++; + + inst = emit(fs_inst(FS_OPCODE_TXB, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txl: + ir->lod_info.lod->accept(this); + emit(fs_inst(BRW_OPCODE_MOV, fs_reg(MRF, base_mrf + mlen), this->result)); + mlen++; + + inst = emit(fs_inst(FS_OPCODE_TXL, dst, fs_reg(MRF, base_mrf))); + break; + case ir_txd: + case ir_txf: + assert(!"GLSL 1.30 features unsupported"); + break; + } + + this->result = dst; + + if (ir->shadow_comparitor) + inst->shadow_compare = true; + inst->mlen = mlen; +} + +void +fs_visitor::visit(ir_swizzle *ir) +{ + ir->val->accept(this); + fs_reg val = this->result; + + fs_reg result = fs_reg(this, ir->type); + this->result = result; + + for (unsigned int i = 0; i < ir->type->vector_elements; i++) { + fs_reg channel = val; + int swiz = 0; + + switch (i) { + case 0: + swiz = ir->mask.x; + break; + case 1: + swiz = ir->mask.y; + break; + case 2: + swiz = ir->mask.z; + break; + case 3: + swiz = ir->mask.w; + break; + } + + channel.reg_offset += swiz; + emit(fs_inst(BRW_OPCODE_MOV, result, channel)); + result.reg_offset++; + } +} + +void +fs_visitor::visit(ir_discard *ir) +{ + assert(ir->condition == NULL); /* FINISHME */ + + emit(fs_inst(FS_OPCODE_DISCARD)); +} + +void +fs_visitor::visit(ir_constant *ir) +{ + fs_reg reg(this, ir->type); + this->result = reg; + + for (unsigned int i = 0; i < ir->type->vector_elements; i++) { + switch (ir->type->base_type) { + case GLSL_TYPE_FLOAT: + emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.f[i]))); + break; + case GLSL_TYPE_UINT: + emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.u[i]))); + break; + case GLSL_TYPE_INT: + emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg(ir->value.i[i]))); + break; + case GLSL_TYPE_BOOL: + emit(fs_inst(BRW_OPCODE_MOV, reg, fs_reg((int)ir->value.b[i]))); + break; + default: + assert(!"Non-float/uint/int/bool constant"); + } + reg.reg_offset++; + } +} + +void +fs_visitor::visit(ir_if *ir) +{ + fs_inst *inst; + + /* Don't point the annotation at the if statement, because then it plus + * the then and else blocks get printed. + */ + this->base_ir = ir->condition; + + /* Generate the condition into the condition code. */ + ir->condition->accept(this); + inst = emit(fs_inst(BRW_OPCODE_MOV, fs_reg(brw_null_reg()), this->result)); + inst->conditional_mod = BRW_CONDITIONAL_NZ; + + inst = emit(fs_inst(BRW_OPCODE_IF)); + inst->predicated = true; + + foreach_iter(exec_list_iterator, iter, ir->then_instructions) { + ir_instruction *ir = (ir_instruction *)iter.get(); + this->base_ir = ir; + + ir->accept(this); + } + + if (!ir->else_instructions.is_empty()) { + emit(fs_inst(BRW_OPCODE_ELSE)); + + foreach_iter(exec_list_iterator, iter, ir->else_instructions) { + ir_instruction *ir = (ir_instruction *)iter.get(); + this->base_ir = ir; + + ir->accept(this); + } + } + + emit(fs_inst(BRW_OPCODE_ENDIF)); +} + +void +fs_visitor::visit(ir_loop *ir) +{ + assert(!ir->from); + assert(!ir->to); + assert(!ir->increment); + assert(!ir->counter); + + emit(fs_inst(BRW_OPCODE_DO)); + + /* Start a safety counter. If the user messed up their loop + * counting, we don't want to hang the GPU. + */ + fs_reg max_iter = fs_reg(this, glsl_type::int_type); + emit(fs_inst(BRW_OPCODE_MOV, max_iter, fs_reg(10000))); + + foreach_iter(exec_list_iterator, iter, ir->body_instructions) { + ir_instruction *ir = (ir_instruction *)iter.get(); + fs_inst *inst; + + this->base_ir = ir; + ir->accept(this); + + /* Check the maximum loop iters counter. */ + inst = emit(fs_inst(BRW_OPCODE_ADD, max_iter, max_iter, fs_reg(-1))); + inst->conditional_mod = BRW_CONDITIONAL_Z; + + inst = emit(fs_inst(BRW_OPCODE_BREAK)); + inst->predicated = true; + } + + emit(fs_inst(BRW_OPCODE_WHILE)); +} + +void +fs_visitor::visit(ir_loop_jump *ir) +{ + switch (ir->mode) { + case ir_loop_jump::jump_break: + emit(fs_inst(BRW_OPCODE_BREAK)); + break; + case ir_loop_jump::jump_continue: + emit(fs_inst(BRW_OPCODE_CONTINUE)); + break; + } +} + +void +fs_visitor::visit(ir_call *ir) +{ + assert(!"FINISHME"); +} + +void +fs_visitor::visit(ir_return *ir) +{ + assert(!"FINISHME"); +} + +void +fs_visitor::visit(ir_function *ir) +{ + /* Ignore function bodies other than main() -- we shouldn't see calls to + * them since they should all be inlined before we get to ir_to_mesa. + */ + if (strcmp(ir->name, "main") == 0) { + const ir_function_signature *sig; + exec_list empty; + + sig = ir->matching_signature(&empty); + + assert(sig); + + foreach_iter(exec_list_iterator, iter, sig->body) { + ir_instruction *ir = (ir_instruction *)iter.get(); + this->base_ir = ir; + + ir->accept(this); + } + } +} + +void +fs_visitor::visit(ir_function_signature *ir) +{ + assert(!"not reached"); + (void)ir; +} + +fs_inst * +fs_visitor::emit(fs_inst inst) +{ + fs_inst *list_inst = new(mem_ctx) fs_inst; + *list_inst = inst; + + list_inst->annotation = this->current_annotation; + list_inst->ir = this->base_ir; + + this->instructions.push_tail(list_inst); + + return list_inst; +} + +/** Emits a dummy fragment shader consisting of magenta for bringup purposes. */ +void +fs_visitor::emit_dummy_fs() +{ + /* Everyone's favorite color. */ + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, 2), + fs_reg(1.0f))); + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, 3), + fs_reg(0.0f))); + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, 4), + fs_reg(1.0f))); + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, 5), + fs_reg(0.0f))); + + fs_inst *write; + write = emit(fs_inst(FS_OPCODE_FB_WRITE, + fs_reg(0), + fs_reg(0))); +} + +/* The register location here is relative to the start of the URB + * data. It will get adjusted to be a real location before + * generate_code() time. + */ +struct brw_reg +fs_visitor::interp_reg(int location, int channel) +{ + int regnr = location * 2 + channel / 2; + int stride = (channel & 1) * 4; + + return brw_vec1_grf(regnr, stride); +} + +/** Emits the interpolation for the varying inputs. */ +void +fs_visitor::emit_interpolation() +{ + struct brw_reg g1_uw = retype(brw_vec1_grf(1, 0), BRW_REGISTER_TYPE_UW); + /* For now, the source regs for the setup URB data will be unset, + * since we don't know until codegen how many push constants we'll + * use, and therefore what the setup URB offset is. + */ + fs_reg src_reg = reg_undef; + + this->current_annotation = "compute pixel centers"; + this->pixel_x = fs_reg(this, glsl_type::uint_type); + this->pixel_y = fs_reg(this, glsl_type::uint_type); + this->pixel_x.type = BRW_REGISTER_TYPE_UW; + this->pixel_y.type = BRW_REGISTER_TYPE_UW; + emit(fs_inst(BRW_OPCODE_ADD, + this->pixel_x, + fs_reg(stride(suboffset(g1_uw, 4), 2, 4, 0)), + fs_reg(brw_imm_v(0x10101010)))); + emit(fs_inst(BRW_OPCODE_ADD, + this->pixel_y, + fs_reg(stride(suboffset(g1_uw, 5), 2, 4, 0)), + fs_reg(brw_imm_v(0x11001100)))); + + this->current_annotation = "compute pixel deltas from v0"; + this->delta_x = fs_reg(this, glsl_type::float_type); + this->delta_y = fs_reg(this, glsl_type::float_type); + emit(fs_inst(BRW_OPCODE_ADD, + this->delta_x, + this->pixel_x, + fs_reg(negate(brw_vec1_grf(1, 0))))); + emit(fs_inst(BRW_OPCODE_ADD, + this->delta_y, + this->pixel_y, + fs_reg(brw_vec1_grf(1, 1)))); + + this->current_annotation = "compute pos.w and 1/pos.w"; + /* Compute wpos. Unlike many other varying inputs, we usually need it + * to produce 1/w, and the varying variable wouldn't show up. + */ + fs_reg wpos = fs_reg(this, glsl_type::vec4_type); + this->interp_attrs[FRAG_ATTRIB_WPOS] = wpos; + emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_x)); /* FINISHME: ARB_fcc */ + wpos.reg_offset++; + emit(fs_inst(BRW_OPCODE_MOV, wpos, this->pixel_y)); /* FINISHME: ARB_fcc */ + wpos.reg_offset++; + emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, + interp_reg(FRAG_ATTRIB_WPOS, 2))); + wpos.reg_offset++; + emit(fs_inst(FS_OPCODE_LINTERP, wpos, this->delta_x, this->delta_y, + interp_reg(FRAG_ATTRIB_WPOS, 3))); + /* Compute the pixel W value from wpos.w. */ + this->pixel_w = fs_reg(this, glsl_type::float_type); + emit(fs_inst(FS_OPCODE_RCP, this->pixel_w, wpos)); + + /* FINISHME: gl_FrontFacing */ + + foreach_iter(exec_list_iterator, iter, *this->shader->ir) { + ir_instruction *ir = (ir_instruction *)iter.get(); + ir_variable *var = ir->as_variable(); + + if (!var) + continue; + + if (var->mode != ir_var_in) + continue; + + /* If it's already set up (WPOS), skip. */ + if (var->location == 0) + continue; + + this->current_annotation = talloc_asprintf(this->mem_ctx, + "interpolate %s " + "(FRAG_ATTRIB[%d])", + var->name, + var->location); + emit_pinterp(var->location); + } + this->current_annotation = NULL; +} + +void +fs_visitor::emit_pinterp(int location) +{ + fs_reg interp_attr = fs_reg(this, glsl_type::vec4_type); + this->interp_attrs[location] = interp_attr; + + for (unsigned int i = 0; i < 4; i++) { + struct brw_reg interp = interp_reg(location, i); + emit(fs_inst(FS_OPCODE_LINTERP, + interp_attr, + this->delta_x, + this->delta_y, + fs_reg(interp))); + interp_attr.reg_offset++; + } + interp_attr.reg_offset -= 4; + + for (unsigned int i = 0; i < 4; i++) { + emit(fs_inst(BRW_OPCODE_MUL, + interp_attr, + interp_attr, + this->pixel_w)); + interp_attr.reg_offset++; + } +} + +void +fs_visitor::emit_fb_writes() +{ + this->current_annotation = "FB write"; + + assert(this->frag_color || !"FINISHME: MRT"); + fs_reg color = *(variable_storage(this->frag_color)); + + for (int i = 0; i < 4; i++) { + emit(fs_inst(BRW_OPCODE_MOV, + fs_reg(MRF, 2 + i), + color)); + color.reg_offset++; + } + + emit(fs_inst(FS_OPCODE_FB_WRITE, + fs_reg(0), + fs_reg(0))); + + this->current_annotation = NULL; +} + +void +fs_visitor::generate_fb_write(fs_inst *inst) +{ + GLboolean eot = 1; /* FINISHME: MRT */ + /* FINISHME: AADS */ + + /* Header is 2 regs, g0 and g1 are the contents. g0 will be implied + * move, here's g1. + */ + brw_push_insn_state(p); + brw_set_mask_control(p, BRW_MASK_DISABLE); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, + brw_message_reg(1), + brw_vec8_grf(1, 0)); + brw_pop_insn_state(p); + + int nr = 2 + 4; + + brw_fb_WRITE(p, + 8, /* dispatch_width */ + retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW), + 0, /* base MRF */ + retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), + 0, /* FINISHME: MRT target */ + nr, + 0, + eot); +} + +void +fs_visitor::generate_linterp(fs_inst *inst, + struct brw_reg dst, struct brw_reg *src) +{ + struct brw_reg delta_x = src[0]; + struct brw_reg delta_y = src[1]; + struct brw_reg interp = src[2]; + + if (brw->has_pln && + delta_y.nr == delta_x.nr + 1 && + (intel->gen >= 6 || (delta_x.nr & 1) == 0)) { + brw_PLN(p, dst, interp, delta_x); + } else { + brw_LINE(p, brw_null_reg(), interp, delta_x); + brw_MAC(p, dst, suboffset(interp, 1), delta_y); + } +} + +void +fs_visitor::generate_math(fs_inst *inst, + struct brw_reg dst, struct brw_reg *src) +{ + int op; + + switch (inst->opcode) { + case FS_OPCODE_RCP: + op = BRW_MATH_FUNCTION_INV; + break; + case FS_OPCODE_RSQ: + op = BRW_MATH_FUNCTION_RSQ; + break; + case FS_OPCODE_SQRT: + op = BRW_MATH_FUNCTION_SQRT; + break; + case FS_OPCODE_EXP2: + op = BRW_MATH_FUNCTION_EXP; + break; + case FS_OPCODE_LOG2: + op = BRW_MATH_FUNCTION_LOG; + break; + case FS_OPCODE_POW: + op = BRW_MATH_FUNCTION_POW; + break; + case FS_OPCODE_SIN: + op = BRW_MATH_FUNCTION_SIN; + break; + case FS_OPCODE_COS: + op = BRW_MATH_FUNCTION_COS; + break; + default: + assert(!"not reached: unknown math function"); + op = 0; + break; + } + + if (inst->opcode == FS_OPCODE_POW) { + brw_MOV(p, brw_message_reg(3), src[1]); + } + + brw_math(p, dst, + op, + inst->saturate ? BRW_MATH_SATURATE_SATURATE : + BRW_MATH_SATURATE_NONE, + 2, src[0], + BRW_MATH_DATA_VECTOR, + BRW_MATH_PRECISION_FULL); +} + +void +fs_visitor::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src) +{ + int msg_type = -1; + int rlen = 4; + + if (intel->gen == 5) { + switch (inst->opcode) { + case FS_OPCODE_TEX: + if (inst->shadow_compare) { + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_GEN5; + } else { + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_GEN5; + } + break; + case FS_OPCODE_TXB: + if (inst->shadow_compare) { + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_COMPARE_GEN5; + } else { + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_GEN5; + } + break; + } + } else { + switch (inst->opcode) { + case FS_OPCODE_TEX: + /* Note that G45 and older determines shadow compare and dispatch width + * from message length for most messages. + */ + if (inst->shadow_compare) { + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE; + } else { + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE; + } + case FS_OPCODE_TXB: + if (inst->shadow_compare) { + assert(!"FINISHME: shadow compare with bias."); + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; + } else { + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; + rlen = 8; + } + break; + } + } + assert(msg_type != -1); + + /* g0 header. */ + src.nr--; + + brw_SAMPLE(p, + retype(dst, BRW_REGISTER_TYPE_UW), + src.nr, + retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), + SURF_INDEX_TEXTURE(inst->sampler), + inst->sampler, + WRITEMASK_XYZW, + msg_type, + rlen, + inst->mlen + 1, + 0, + 1, + BRW_SAMPLER_SIMD_MODE_SIMD8); +} + +void +fs_visitor::generate_discard(fs_inst *inst) +{ + struct brw_reg g0 = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW); + brw_push_insn_state(p); + brw_set_mask_control(p, BRW_MASK_DISABLE); + brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); /* IMASK */ + brw_AND(p, g0, c->emit_mask_reg, g0); + brw_pop_insn_state(p); +} + +static void +trivial_assign_reg(int header_size, fs_reg *reg) +{ + if (reg->file == GRF && reg->reg != 0) { + reg->hw_reg = header_size + reg->reg - 1 + reg->reg_offset; + reg->reg = 0; + } +} + +void +fs_visitor::assign_curb_setup() +{ + c->prog_data.first_curbe_grf = c->key.nr_payload_regs; + c->prog_data.curb_read_length = ALIGN(c->prog_data.nr_params, 8) / 8; + + if (intel->gen == 5 && (c->prog_data.first_curbe_grf + + c->prog_data.curb_read_length) & 1) { + /* Align the start of the interpolation coefficients so that we can use + * the PLN instruction. + */ + c->prog_data.first_curbe_grf++; + } + + /* Map the offsets in the UNIFORM file to fixed HW regs. */ + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + for (unsigned int i = 0; i < 3; i++) { + if (inst->src[i].file == UNIFORM) { + int constant_nr = inst->src[i].hw_reg + inst->src[i].reg_offset; + struct brw_reg brw_reg = brw_vec1_grf(c->prog_data.first_curbe_grf + + constant_nr / 8, + constant_nr % 8); + + inst->src[i].file = FIXED_HW_REG; + inst->src[i].fixed_hw_reg = brw_reg; + } + } + } +} + +void +fs_visitor::assign_urb_setup() +{ + int urb_start = c->prog_data.first_curbe_grf + c->prog_data.curb_read_length; + int interp_reg_nr[FRAG_ATTRIB_MAX]; + + c->prog_data.urb_read_length = 0; + + /* Figure out where each of the incoming setup attributes lands. */ + for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { + interp_reg_nr[i] = -1; + + if (i != FRAG_ATTRIB_WPOS && + !(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(i))) + continue; + + /* Each attribute is 4 setup channels, each of which is half a reg. */ + interp_reg_nr[i] = urb_start + c->prog_data.urb_read_length; + c->prog_data.urb_read_length += 2; + } + + /* Map the register numbers for FS_OPCODE_LINTERP so that it uses + * the correct setup input. + */ + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + if (inst->opcode != FS_OPCODE_LINTERP) + continue; + + assert(inst->src[2].file == FIXED_HW_REG); + + int location = inst->src[2].fixed_hw_reg.nr / 2; + assert(interp_reg_nr[location] != -1); + inst->src[2].fixed_hw_reg.nr = (interp_reg_nr[location] + + (inst->src[2].fixed_hw_reg.nr & 1)); + } + + this->first_non_payload_grf = urb_start + c->prog_data.urb_read_length; +} + +void +fs_visitor::assign_regs() +{ + int header_size = this->first_non_payload_grf; + int last_grf = 0; + + /* FINISHME: trivial assignment of register numbers */ + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + + trivial_assign_reg(header_size, &inst->dst); + trivial_assign_reg(header_size, &inst->src[0]); + trivial_assign_reg(header_size, &inst->src[1]); + + last_grf = MAX2(last_grf, inst->dst.hw_reg); + last_grf = MAX2(last_grf, inst->src[0].hw_reg); + last_grf = MAX2(last_grf, inst->src[1].hw_reg); + } + + this->grf_used = last_grf + 1; +} + +static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg) +{ + struct brw_reg brw_reg; + + switch (reg->file) { + case GRF: + case ARF: + case MRF: + brw_reg = brw_vec8_reg(reg->file, + reg->hw_reg, 0); + brw_reg = retype(brw_reg, reg->type); + break; + case IMM: + switch (reg->type) { + case BRW_REGISTER_TYPE_F: + brw_reg = brw_imm_f(reg->imm.f); + break; + case BRW_REGISTER_TYPE_D: + brw_reg = brw_imm_d(reg->imm.i); + break; + case BRW_REGISTER_TYPE_UD: + brw_reg = brw_imm_ud(reg->imm.u); + break; + default: + assert(!"not reached"); + break; + } + break; + case FIXED_HW_REG: + brw_reg = reg->fixed_hw_reg; + break; + case BAD_FILE: + /* Probably unused. */ + brw_reg = brw_null_reg(); + break; + case UNIFORM: + assert(!"not reached"); + brw_reg = brw_null_reg(); + break; + } + if (reg->abs) + brw_reg = brw_abs(brw_reg); + if (reg->negate) + brw_reg = negate(brw_reg); + + return brw_reg; +} + +void +fs_visitor::generate_code() +{ + unsigned int annotation_len = 0; + int last_native_inst = 0; + struct brw_instruction *if_stack[16], *loop_stack[16]; + int if_stack_depth = 0, loop_stack_depth = 0; + int if_depth_in_loop[16]; + + if_depth_in_loop[loop_stack_depth] = 0; + + memset(&if_stack, 0, sizeof(if_stack)); + foreach_iter(exec_list_iterator, iter, this->instructions) { + fs_inst *inst = (fs_inst *)iter.get(); + struct brw_reg src[3], dst; + + for (unsigned int i = 0; i < 3; i++) { + src[i] = brw_reg_from_fs_reg(&inst->src[i]); + } + dst = brw_reg_from_fs_reg(&inst->dst); + + brw_set_conditionalmod(p, inst->conditional_mod); + brw_set_predicate_control(p, inst->predicated); + + switch (inst->opcode) { + case BRW_OPCODE_MOV: + brw_MOV(p, dst, src[0]); + break; + case BRW_OPCODE_ADD: + brw_ADD(p, dst, src[0], src[1]); + break; + case BRW_OPCODE_MUL: + brw_MUL(p, dst, src[0], src[1]); + break; + + case BRW_OPCODE_FRC: + brw_FRC(p, dst, src[0]); + break; + case BRW_OPCODE_RNDD: + brw_RNDD(p, dst, src[0]); + break; + case BRW_OPCODE_RNDZ: + brw_RNDZ(p, dst, src[0]); + break; + + case BRW_OPCODE_AND: + brw_AND(p, dst, src[0], src[1]); + break; + case BRW_OPCODE_OR: + brw_OR(p, dst, src[0], src[1]); + break; + case BRW_OPCODE_XOR: + brw_XOR(p, dst, src[0], src[1]); + break; + + case BRW_OPCODE_CMP: + brw_CMP(p, dst, inst->conditional_mod, src[0], src[1]); + break; + case BRW_OPCODE_SEL: + brw_SEL(p, dst, src[0], src[1]); + break; + + case BRW_OPCODE_IF: + assert(if_stack_depth < 16); + if_stack[if_stack_depth] = brw_IF(p, BRW_EXECUTE_8); + if_stack_depth++; + break; + case BRW_OPCODE_ELSE: + if_stack[if_stack_depth - 1] = + brw_ELSE(p, if_stack[if_stack_depth - 1]); + break; + case BRW_OPCODE_ENDIF: + if_stack_depth--; + brw_ENDIF(p , if_stack[if_stack_depth]); + break; + + case BRW_OPCODE_DO: + loop_stack[loop_stack_depth++] = brw_DO(p, BRW_EXECUTE_8); + if_depth_in_loop[loop_stack_depth] = 0; + break; + + case BRW_OPCODE_BREAK: + brw_BREAK(p, if_depth_in_loop[loop_stack_depth]); + brw_set_predicate_control(p, BRW_PREDICATE_NONE); + break; + case BRW_OPCODE_CONTINUE: + brw_CONT(p, if_depth_in_loop[loop_stack_depth]); + brw_set_predicate_control(p, BRW_PREDICATE_NONE); + break; + + case BRW_OPCODE_WHILE: { + struct brw_instruction *inst0, *inst1; + GLuint br = 1; + + if (intel->gen == 5) + br = 2; + + assert(loop_stack_depth > 0); + loop_stack_depth--; + inst0 = inst1 = brw_WHILE(p, loop_stack[loop_stack_depth]); + /* patch all the BREAK/CONT instructions from last BGNLOOP */ + while (inst0 > loop_stack[loop_stack_depth]) { + inst0--; + if (inst0->header.opcode == BRW_OPCODE_BREAK && + inst0->bits3.if_else.jump_count == 0) { + inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); + } + else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && + inst0->bits3.if_else.jump_count == 0) { + inst0->bits3.if_else.jump_count = br * (inst1 - inst0); + } + } + } + break; + + case FS_OPCODE_RCP: + case FS_OPCODE_RSQ: + case FS_OPCODE_SQRT: + case FS_OPCODE_EXP2: + case FS_OPCODE_LOG2: + case FS_OPCODE_POW: + case FS_OPCODE_SIN: + case FS_OPCODE_COS: + generate_math(inst, dst, src); + break; + case FS_OPCODE_LINTERP: + generate_linterp(inst, dst, src); + break; + case FS_OPCODE_TEX: + case FS_OPCODE_TXB: + case FS_OPCODE_TXL: + generate_tex(inst, dst, src[0]); + break; + case FS_OPCODE_DISCARD: + generate_discard(inst); + break; + case FS_OPCODE_FB_WRITE: + generate_fb_write(inst); + break; + default: + if (inst->opcode < (int)ARRAY_SIZE(brw_opcodes)) { + _mesa_problem(ctx, "Unsupported opcode `%s' in FS", + brw_opcodes[inst->opcode].name); + } else { + _mesa_problem(ctx, "Unsupported opcode %d in FS", inst->opcode); + } + this->fail = true; + } + + if (annotation_len < p->nr_insn) { + annotation_len *= 2; + if (annotation_len < 16) + annotation_len = 16; + + this->annotation_string = talloc_realloc(this->mem_ctx, + annotation_string, + const char *, + annotation_len); + this->annotation_ir = talloc_realloc(this->mem_ctx, + annotation_ir, + ir_instruction *, + annotation_len); + } + + for (unsigned int i = last_native_inst; i < p->nr_insn; i++) { + this->annotation_string[i] = inst->annotation; + this->annotation_ir[i] = inst->ir; + } + last_native_inst = p->nr_insn; + } +} + +GLboolean +brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c) +{ + struct brw_compile *p = &c->func; + struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + struct brw_shader *shader = NULL; + struct gl_shader_program *prog = ctx->Shader.CurrentProgram; + + if (!prog) + return GL_FALSE; + + if (!using_new_fs) + return GL_FALSE; + + for (unsigned int i = 0; i < prog->_NumLinkedShaders; i++) { + if (prog->_LinkedShaders[i]->Type == GL_FRAGMENT_SHADER) { + shader = (struct brw_shader *)prog->_LinkedShaders[i]; + break; + } + } + if (!shader) + return GL_FALSE; + + /* We always use 8-wide mode, at least for now. For one, flow + * control only works in 8-wide. Also, when we're fragment shader + * bound, we're almost always under register pressure as well, so + * 8-wide would save us from the performance cliff of spilling + * regs. + */ + c->dispatch_width = 8; + + if (INTEL_DEBUG & DEBUG_WM) { + printf("GLSL IR for native fragment shader %d:\n", prog->Name); + _mesa_print_ir(shader->ir, NULL); + printf("\n"); + } + + /* Now the main event: Visit the shader IR and generate our FS IR for it. + */ + fs_visitor v(c, shader); + + if (0) { + v.emit_dummy_fs(); + } else { + v.emit_interpolation(); + + /* Generate FS IR for main(). (the visitor only descends into + * functions called "main"). + */ + foreach_iter(exec_list_iterator, iter, *shader->ir) { + ir_instruction *ir = (ir_instruction *)iter.get(); + v.base_ir = ir; + ir->accept(&v); + } + + v.emit_fb_writes(); + v.assign_curb_setup(); + v.assign_urb_setup(); + v.assign_regs(); + } + + v.generate_code(); + + assert(!v.fail); /* FINISHME: Cleanly fail, tested at link time, etc. */ + + if (v.fail) + return GL_FALSE; + + if (INTEL_DEBUG & DEBUG_WM) { + const char *last_annotation_string = NULL; + ir_instruction *last_annotation_ir = NULL; + + printf("Native code for fragment shader %d:\n", prog->Name); + for (unsigned int i = 0; i < p->nr_insn; i++) { + if (last_annotation_ir != v.annotation_ir[i]) { + last_annotation_ir = v.annotation_ir[i]; + if (last_annotation_ir) { + printf(" "); + last_annotation_ir->print(); + printf("\n"); + } + } + if (last_annotation_string != v.annotation_string[i]) { + last_annotation_string = v.annotation_string[i]; + if (last_annotation_string) + printf(" %s\n", last_annotation_string); + } + brw_disasm(stdout, &p->store[i], intel->gen); + } + printf("\n"); + } + + c->prog_data.total_grf = v.grf_used; + c->prog_data.total_scratch = 0; + + return GL_TRUE; +} --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ mesa-7.9~git20100924/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -0,0 +1,391 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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. + */ + +/** + * \file brw_wm_vector_splitting.cpp + * + * If a vector is only ever referenced by its components, then + * split those components out to individual variables so they can be + * handled normally by other optimization passes. + * + * This skips vectors in uniforms and varyings, which need to be + * accessible as vectors for their access by the GL. Also, vector + * results of non-variable-derefs in assignments aren't handled + * because to do so we would have to store the vector result to a + * temporary in order to unload each channel, and to do so would just + * loop us back to where we started. For the 965, this is exactly the + * behavior we want for the results of texture lookups, but probably not for + */ + +extern "C" { +#include "main/core.h" +#include "intel_context.h" +} +#include "../glsl/ir.h" +#include "../glsl/ir_visitor.h" +#include "../glsl/ir_print_visitor.h" +#include "../glsl/ir_rvalue_visitor.h" +#include "../glsl/glsl_types.h" + +static bool debug = false; + +class variable_entry : public exec_node +{ +public: + variable_entry(ir_variable *var) + { + this->var = var; + this->whole_vector_access = 0; + this->declaration = false; + this->mem_ctx = NULL; + } + + ir_variable *var; /* The key: the variable's pointer. */ + + /** Number of times the variable is referenced, including assignments. */ + unsigned whole_vector_access; + + bool declaration; /* If the variable had a decl in the instruction stream */ + + ir_variable *components[4]; + + /** talloc_parent(this->var) -- the shader's talloc context. */ + void *mem_ctx; +}; + +class ir_vector_reference_visitor : public ir_hierarchical_visitor { +public: + ir_vector_reference_visitor(void) + { + this->mem_ctx = talloc_new(NULL); + this->variable_list.make_empty(); + } + + ~ir_vector_reference_visitor(void) + { + talloc_free(mem_ctx); + } + + virtual ir_visitor_status visit(ir_variable *); + virtual ir_visitor_status visit(ir_dereference_variable *); + virtual ir_visitor_status visit_enter(ir_swizzle *); + virtual ir_visitor_status visit_enter(ir_assignment *); + virtual ir_visitor_status visit_enter(ir_function_signature *); + + variable_entry *get_variable_entry(ir_variable *var); + + /* List of variable_entry */ + exec_list variable_list; + + void *mem_ctx; +}; + +variable_entry * +ir_vector_reference_visitor::get_variable_entry(ir_variable *var) +{ + assert(var); + + if (!var->type->is_vector()) + return NULL; + + switch (var->mode) { + case ir_var_uniform: + case ir_var_in: + case ir_var_out: + case ir_var_inout: + /* Can't split varyings or uniforms. Function in/outs won't get split + * either, so don't care about the ambiguity. + */ + return NULL; + case ir_var_auto: + case ir_var_temporary: + break; + } + + foreach_iter(exec_list_iterator, iter, this->variable_list) { + variable_entry *entry = (variable_entry *)iter.get(); + if (entry->var == var) + return entry; + } + + variable_entry *entry = new(mem_ctx) variable_entry(var); + this->variable_list.push_tail(entry); + return entry; +} + + +ir_visitor_status +ir_vector_reference_visitor::visit(ir_variable *ir) +{ + variable_entry *entry = this->get_variable_entry(ir); + + if (entry) + entry->declaration = true; + + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit(ir_dereference_variable *ir) +{ + ir_variable *const var = ir->var; + variable_entry *entry = this->get_variable_entry(var); + + if (entry) + entry->whole_vector_access++; + + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_swizzle *ir) +{ + /* Don't descend into a vector ir_dereference_variable below. */ + if (ir->val->as_dereference_variable() && ir->type->is_scalar()) + return visit_continue_with_parent; + + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_assignment *ir) +{ + if (ir->lhs->as_dereference_variable() && + ir->rhs->as_dereference_variable() && + !ir->condition) { + /* We'll split copies of a vector to copies of channels, so don't + * descend to the ir_dereference_variables. + */ + return visit_continue_with_parent; + } + if (ir->lhs->as_dereference_variable() && + is_power_of_two(ir->write_mask) && + !ir->condition) { + /* If we're writing just a channel, then channel-splitting the LHS is OK. + */ + ir->rhs->accept(this); + return visit_continue_with_parent; + } + return visit_continue; +} + +ir_visitor_status +ir_vector_reference_visitor::visit_enter(ir_function_signature *ir) +{ + /* We don't want to descend into the function parameters and + * split them, so just accept the body here. + */ + visit_list_elements(this, &ir->body); + return visit_continue_with_parent; +} + +class ir_vector_splitting_visitor : public ir_rvalue_visitor { +public: + ir_vector_splitting_visitor(exec_list *vars) + { + this->variable_list = vars; + } + + virtual ir_visitor_status visit_leave(ir_assignment *); + + void handle_rvalue(ir_rvalue **rvalue); + struct variable_entry *get_splitting_entry(ir_variable *var); + + exec_list *variable_list; + void *mem_ctx; +}; + +struct variable_entry * +ir_vector_splitting_visitor::get_splitting_entry(ir_variable *var) +{ + assert(var); + + if (!var->type->is_vector()) + return NULL; + + foreach_iter(exec_list_iterator, iter, *this->variable_list) { + variable_entry *entry = (variable_entry *)iter.get(); + if (entry->var == var) { + return entry; + } + } + + return NULL; +} + +void +ir_vector_splitting_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (!*rvalue) + return; + + ir_swizzle *swiz = (*rvalue)->as_swizzle(); + if (!swiz || !swiz->type->is_scalar()) + return; + + ir_dereference_variable *deref_var = swiz->val->as_dereference_variable(); + if (!deref_var) + return; + + variable_entry *entry = get_splitting_entry(deref_var->var); + if (!entry) + return; + + ir_variable *var = entry->components[swiz->mask.x]; + *rvalue = new(entry->mem_ctx) ir_dereference_variable(var); +} + +ir_visitor_status +ir_vector_splitting_visitor::visit_leave(ir_assignment *ir) +{ + ir_dereference_variable *lhs_deref = ir->lhs->as_dereference_variable(); + ir_dereference_variable *rhs_deref = ir->rhs->as_dereference_variable(); + variable_entry *lhs = lhs_deref ? get_splitting_entry(lhs_deref->var) : NULL; + variable_entry *rhs = rhs_deref ? get_splitting_entry(rhs_deref->var) : NULL; + + if (lhs_deref && rhs_deref && (lhs || rhs) && !ir->condition) { + /* Straight assignment of vector variables. */ + for (unsigned int i = 0; i < ir->rhs->type->vector_elements; i++) { + ir_dereference *new_lhs; + ir_rvalue *new_rhs; + void *mem_ctx = lhs ? lhs->mem_ctx : rhs->mem_ctx; + unsigned int writemask; + + if (lhs) { + new_lhs = new(mem_ctx) ir_dereference_variable(lhs->components[i]); + writemask = (ir->write_mask >> i) & 1; + } else { + new_lhs = ir->lhs->clone(mem_ctx, NULL); + writemask = ir->write_mask & (1 << i); + } + + if (rhs) { + new_rhs = new(mem_ctx) ir_dereference_variable(rhs->components[i]); + /* If we're writing into a writemask, smear it out to that channel. */ + if (!lhs) + new_rhs = new(mem_ctx) ir_swizzle(new_rhs, i, i, i, i, i + 1); + } else { + new_rhs = new(mem_ctx) ir_swizzle(ir->rhs->clone(mem_ctx, NULL), + i, i, i, i, 1); + } + + ir->insert_before(new(mem_ctx) ir_assignment(new_lhs, + new_rhs, + NULL, writemask)); + } + ir->remove(); + } else if (lhs) { + int elem = -1; + + switch (ir->write_mask) { + case (1 << 0): + elem = 0; + break; + case (1 << 1): + elem = 1; + break; + case (1 << 2): + elem = 2; + break; + case (1 << 3): + elem = 3; + break; + default: + ir->print(); + assert(!"not reached: non-channelwise dereference of LHS."); + } + + ir->lhs = new(mem_ctx) ir_dereference_variable(lhs->components[elem]); + ir->write_mask = (1 << 0); + + handle_rvalue(&ir->rhs); + ir->rhs = new(mem_ctx) ir_swizzle(ir->rhs, + elem, elem, elem, elem, 1); + } else { + handle_rvalue(&ir->rhs); + } + + handle_rvalue(&ir->condition); + + return visit_continue; +} + +extern "C" { +bool +brw_do_vector_splitting(exec_list *instructions) +{ + ir_vector_reference_visitor refs; + + visit_list_elements(&refs, instructions); + + /* Trim out variables we can't split. */ + foreach_iter(exec_list_iterator, iter, refs.variable_list) { + variable_entry *entry = (variable_entry *)iter.get(); + + if (debug) { + printf("vector %s@%p: decl %d, whole_access %d\n", + entry->var->name, (void *) entry->var, entry->declaration, + entry->whole_vector_access); + } + + if (!entry->declaration || entry->whole_vector_access) { + entry->remove(); + } + } + + if (refs.variable_list.is_empty()) + return false; + + void *mem_ctx = talloc_new(NULL); + + /* Replace the decls of the vectors to be split with their split + * components. + */ + foreach_iter(exec_list_iterator, iter, refs.variable_list) { + variable_entry *entry = (variable_entry *)iter.get(); + const struct glsl_type *type; + type = glsl_type::get_instance(entry->var->type->base_type, 1, 1); + + entry->mem_ctx = talloc_parent(entry->var); + + for (unsigned int i = 0; i < entry->var->type->vector_elements; i++) { + const char *name = talloc_asprintf(mem_ctx, "%s_%c", + entry->var->name, + "xyzw"[i]); + + entry->components[i] = new(entry->mem_ctx) ir_variable(type, name, + ir_var_temporary); + entry->var->insert_before(entry->components[i]); + } + + entry->var->remove(); + } + + ir_vector_splitting_visitor split(&refs.variable_list); + visit_list_elements(&split, instructions); + + talloc_free(mem_ctx); + + return true; +} +} --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp +++ mesa-7.9~git20100924/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp @@ -0,0 +1,368 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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. + */ + +/** + * \file brw_wm_channel_expressions.cpp + * + * Breaks vector operations down into operations on each component. + * + * The 965 fragment shader receives 8 or 16 pixels at a time, so each + * channel of a vector is laid out as 1 or 2 8-float registers. Each + * ALU operation operates on one of those channel registers. As a + * result, there is no value to the 965 fragment shader in tracking + * "vector" expressions in the sense of GLSL fragment shaders, when + * doing a channel at a time may help in constant folding, algebraic + * simplification, and reducing the liveness of channel registers. + * + * The exception to the desire to break everything down to floats is + * texturing. The texture sampler returns a writemasked masked + * 4/8-register sequence containing the texture values. We don't want + * to dispatch to the sampler separately for each channel we need, so + * we do retain the vector types in that case. + */ + +extern "C" { +#include "main/core.h" +#include "brw_wm.h" +} +#include "../glsl/ir.h" +#include "../glsl/ir_expression_flattening.h" +#include "../glsl/glsl_types.h" + +class ir_channel_expressions_visitor : public ir_hierarchical_visitor { +public: + ir_channel_expressions_visitor() + { + this->progress = false; + this->mem_ctx = NULL; + } + + ir_visitor_status visit_leave(ir_assignment *); + + ir_rvalue *get_element(ir_variable *var, unsigned int element); + void assign(ir_assignment *ir, int elem, ir_rvalue *val); + + bool progress; + void *mem_ctx; +}; + +static bool +channel_expressions_predicate(ir_instruction *ir) +{ + ir_expression *expr = ir->as_expression(); + unsigned int i; + + if (!expr) + return false; + + for (i = 0; i < expr->get_num_operands(); i++) { + if (expr->operands[i]->type->is_vector()) + return true; + } + + return false; +} + +extern "C" { +GLboolean +brw_do_channel_expressions(exec_list *instructions) +{ + ir_channel_expressions_visitor v; + + /* Pull out any matrix expression to a separate assignment to a + * temp. This will make our handling of the breakdown to + * operations on the matrix's vector components much easier. + */ + do_expression_flattening(instructions, channel_expressions_predicate); + + visit_list_elements(&v, instructions); + + return v.progress; +} +} + +ir_rvalue * +ir_channel_expressions_visitor::get_element(ir_variable *var, unsigned int elem) +{ + ir_dereference *deref; + + if (var->type->is_scalar()) + return new(mem_ctx) ir_dereference_variable(var); + + assert(elem < var->type->components()); + deref = new(mem_ctx) ir_dereference_variable(var); + return new(mem_ctx) ir_swizzle(deref, elem, 0, 0, 0, 1); +} + +void +ir_channel_expressions_visitor::assign(ir_assignment *ir, int elem, ir_rvalue *val) +{ + ir_dereference *lhs = ir->lhs->clone(mem_ctx, NULL); + ir_assignment *assign; + ir_swizzle *val_swiz; + + /* This assign-of-expression should have been generated by the + * expression flattening visitor (since we never short circit to + * not flatten, even for plain assignments of variables), so the + * writemask is always full. + */ + assert(ir->write_mask == (1 << ir->lhs->type->components()) - 1); + + /* Smear the float across all the channels for the masked write. */ + val_swiz = new(mem_ctx) ir_swizzle(val, 0, 0, 0, 0, + ir->lhs->type->components()); + assign = new(mem_ctx) ir_assignment(lhs, val_swiz, NULL, (1 << elem)); + ir->insert_before(assign); +} + +ir_visitor_status +ir_channel_expressions_visitor::visit_leave(ir_assignment *ir) +{ + ir_expression *expr = ir->rhs->as_expression(); + bool found_vector = false; + unsigned int i, vector_elements = 1; + ir_variable *op_var[2]; + + if (!expr) + return visit_continue; + + if (!this->mem_ctx) + this->mem_ctx = talloc_parent(ir); + + for (i = 0; i < expr->get_num_operands(); i++) { + if (expr->operands[i]->type->is_vector()) { + found_vector = true; + vector_elements = expr->operands[i]->type->vector_elements; + break; + } + } + if (!found_vector) + return visit_continue; + + /* Store the expression operands in temps so we can use them + * multiple times. + */ + for (i = 0; i < expr->get_num_operands(); i++) { + ir_assignment *assign; + ir_dereference *deref; + + assert(!expr->operands[i]->type->is_matrix()); + + op_var[i] = new(mem_ctx) ir_variable(expr->operands[i]->type, + "channel_expressions", + ir_var_temporary); + ir->insert_before(op_var[i]); + + deref = new(mem_ctx) ir_dereference_variable(op_var[i]); + assign = new(mem_ctx) ir_assignment(deref, + expr->operands[i], + NULL); + ir->insert_before(assign); + } + + const glsl_type *element_type = glsl_type::get_instance(ir->lhs->type->base_type, + 1, 1); + + /* OK, time to break down this vector operation. */ + switch (expr->operation) { + case ir_unop_bit_not: + case ir_unop_logic_not: + case ir_unop_neg: + case ir_unop_abs: + case ir_unop_sign: + case ir_unop_rcp: + case ir_unop_rsq: + case ir_unop_sqrt: + case ir_unop_exp: + case ir_unop_log: + case ir_unop_exp2: + case ir_unop_log2: + case ir_unop_f2i: + case ir_unop_i2f: + case ir_unop_f2b: + case ir_unop_b2f: + case ir_unop_i2b: + case ir_unop_b2i: + case ir_unop_u2f: + case ir_unop_trunc: + case ir_unop_ceil: + case ir_unop_floor: + case ir_unop_fract: + case ir_unop_sin: + case ir_unop_cos: + case ir_unop_dFdx: + case ir_unop_dFdy: + for (i = 0; i < vector_elements; i++) { + ir_rvalue *op0 = get_element(op_var[0], i); + + assign(ir, i, new(mem_ctx) ir_expression(expr->operation, + element_type, + op0, + NULL)); + } + break; + + case ir_binop_add: + case ir_binop_sub: + case ir_binop_mul: + case ir_binop_div: + case ir_binop_mod: + case ir_binop_min: + case ir_binop_max: + case ir_binop_pow: + case ir_binop_lshift: + case ir_binop_rshift: + case ir_binop_bit_and: + case ir_binop_bit_xor: + case ir_binop_bit_or: + for (i = 0; i < vector_elements; i++) { + ir_rvalue *op0 = get_element(op_var[0], i); + ir_rvalue *op1 = get_element(op_var[1], i); + + assign(ir, i, new(mem_ctx) ir_expression(expr->operation, + element_type, + op0, + op1)); + } + break; + + case ir_unop_any: { + ir_expression *temp; + temp = new(mem_ctx) ir_expression(ir_binop_logic_or, + element_type, + get_element(op_var[0], 0), + get_element(op_var[0], 1)); + + for (i = 2; i < vector_elements; i++) { + temp = new(mem_ctx) ir_expression(ir_binop_logic_or, + element_type, + get_element(op_var[0], i), + temp); + } + assign(ir, 0, temp); + break; + } + + case ir_binop_dot: { + ir_expression *last = NULL; + for (i = 0; i < vector_elements; i++) { + ir_rvalue *op0 = get_element(op_var[0], i); + ir_rvalue *op1 = get_element(op_var[1], i); + ir_expression *temp; + + temp = new(mem_ctx) ir_expression(ir_binop_mul, + element_type, + op0, + op1); + if (last) { + last = new(mem_ctx) ir_expression(ir_binop_add, + element_type, + temp, + last); + } else { + last = temp; + } + } + assign(ir, 0, last); + break; + } + + case ir_binop_cross: { + for (i = 0; i < vector_elements; i++) { + int swiz0 = (i + 1) % 3; + int swiz1 = (i + 2) % 3; + ir_expression *temp1, *temp2; + + temp1 = new(mem_ctx) ir_expression(ir_binop_mul, + element_type, + get_element(op_var[0], swiz0), + get_element(op_var[1], swiz1)); + + temp2 = new(mem_ctx) ir_expression(ir_binop_mul, + element_type, + get_element(op_var[1], swiz0), + get_element(op_var[0], swiz1)); + + temp2 = new(mem_ctx) ir_expression(ir_unop_neg, + element_type, + temp2, + NULL); + + assign(ir, i, new(mem_ctx) ir_expression(ir_binop_add, + element_type, + temp1, temp2)); + } + break; + } + + case ir_binop_less: + case ir_binop_greater: + case ir_binop_lequal: + case ir_binop_gequal: + case ir_binop_logic_and: + case ir_binop_logic_xor: + case ir_binop_logic_or: + ir->print(); + printf("\n"); + assert(!"not reached: expression operates on scalars only"); + break; + case ir_binop_equal: + case ir_binop_nequal: { + ir_expression *last = NULL; + for (i = 0; i < vector_elements; i++) { + ir_rvalue *op0 = get_element(op_var[0], i); + ir_rvalue *op1 = get_element(op_var[1], i); + ir_expression *temp; + ir_expression_operation join; + + if (expr->operation == ir_binop_equal) + join = ir_binop_logic_and; + else + join = ir_binop_logic_or; + + temp = new(mem_ctx) ir_expression(expr->operation, + element_type, + op0, + op1); + if (last) { + last = new(mem_ctx) ir_expression(join, + element_type, + temp, + last); + } else { + last = temp; + } + } + assign(ir, 0, last); + break; + } + case ir_unop_noise: + assert(!"noise should have been broken down to function call"); + break; + } + + ir->remove(); + this->progress = true; + + return visit_continue; +} --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py +++ mesa-7.9~git20100924/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py @@ -0,0 +1,191 @@ +#!/usr/bin/python + +import sys +import gettext +import re + +# List of supported languages +languages = sys.argv[1:] + +# Escape special characters in C strings +def escapeCString (s): + escapeSeqs = {'\a' : '\\a', '\b' : '\\b', '\f' : '\\f', '\n' : '\\n', + '\r' : '\\r', '\t' : '\\t', '\v' : '\\v', '\\' : '\\\\'} + # " -> '' is a hack. Quotes (") aren't possible in XML attributes. + # Better use Unicode characters for typographic quotes in option + # descriptions and translations. + i = 0 + r = '' + while i < len(s): + # Special case: escape double quote with \u201c or \u201d, depending + # on whether it's an open or close quote. This is needed because plain + # double quotes are not possible in XML attributes. + if s[i] == '"': + if i == len(s)-1 or s[i+1].isspace(): + # close quote + q = u'\u201c' + else: + # open quote + q = u'\u201d' + r = r + q + elif escapeSeqs.has_key(s[i]): + r = r + escapeSeqs[s[i]] + else: + r = r + s[i] + i = i + 1 + return r + +# Expand escape sequences in C strings (needed for gettext lookup) +def expandCString (s): + escapeSeqs = {'a' : '\a', 'b' : '\b', 'f' : '\f', 'n' : '\n', + 'r' : '\r', 't' : '\t', 'v' : '\v', + '"' : '"', '\\' : '\\'} + i = 0 + escape = False + hexa = False + octa = False + num = 0 + digits = 0 + r = '' + while i < len(s): + if not escape: + if s[i] == '\\': + escape = True + else: + r = r + s[i] + elif hexa: + if (s[i] >= '0' and s[i] <= '9') or \ + (s[i] >= 'a' and s[i] <= 'f') or \ + (s[i] >= 'A' and s[i] <= 'F'): + num = num * 16 + int(s[i],16) + digits = digits + 1 + else: + digits = 2 + if digits >= 2: + hexa = False + escape = False + r = r + chr(num) + elif octa: + if s[i] >= '0' and s[i] <= '7': + num = num * 8 + int(s[i],8) + digits = digits + 1 + else: + digits = 3 + if digits >= 3: + octa = False + escape = False + r = r + chr(num) + else: + if escapeSeqs.has_key(s[i]): + r = r + escapeSeqs[s[i]] + escape = False + elif s[i] >= '0' and s[i] <= '7': + octa = True + num = int(s[i],8) + if num <= 3: + digits = 1 + else: + digits = 2 + elif s[i] == 'x' or s[i] == 'X': + hexa = True + num = 0 + digits = 0 + else: + r = r + s[i] + escape = False + i = i + 1 + return r + +# Expand matches. The first match is always a DESC or DESC_BEGIN match. +# Subsequent matches are ENUM matches. +# +# DESC, DESC_BEGIN format: \1 \2= \3 \4=gettext(" \5= \6=") \7 +# ENUM format: \1 \2=gettext(" \3= \4=") \5 +def expandMatches (matches, translations, end=None): + assert len(matches) > 0 + nTranslations = len(translations) + i = 0 + # Expand the description+enums for all translations + for lang,trans in translations: + i = i + 1 + # Make sure that all but the last line of a simple description + # are extended with a backslash. + suffix = '' + if len(matches) == 1 and i < len(translations) and \ + not matches[0].expand (r'\7').endswith('\\'): + suffix = ' \\' + # Expand the description line. Need to use ugettext in order to allow + # non-ascii unicode chars in the original English descriptions. + text = escapeCString (trans.ugettext (unicode (expandCString ( + matches[0].expand (r'\5')), "utf-8"))).encode("utf-8") + print matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix + # Expand any subsequent enum lines + for match in matches[1:]: + text = escapeCString (trans.ugettext (unicode (expandCString ( + match.expand (r'\3')), "utf-8"))).encode("utf-8") + print match.expand (r'\1"' + text + r'"\5') + + # Expand description end + if end: + print end, + +# Compile a list of translation classes to all supported languages. +# The first translation is always a NullTranslations. +translations = [("en", gettext.NullTranslations())] +for lang in languages: + try: + trans = gettext.translation ("options", ".", [lang]) + except IOError: + sys.stderr.write ("Warning: language '%s' not found.\n" % lang) + continue + translations.append ((lang, trans)) + +# Regular expressions: +reLibintl_h = re.compile (r'#\s*include\s*') +reDESC = re.compile (r'(\s*DRI_CONF_DESC\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reDESC_BEGIN = re.compile (r'(\s*DRI_CONF_DESC_BEGIN\s*\(\s*)([a-z]+)(\s*,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reENUM = re.compile (r'(\s*DRI_CONF_ENUM\s*\([^,]+,\s*)(gettext\s*\(\s*")(.*)("\s*\))(\s*\)[ \t]*\\?)$') +reDESC_END = re.compile (r'\s*DRI_CONF_DESC_END') + +# Print a header +print \ +"/***********************************************************************\n" \ +" *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***\n" \ +" ***********************************************************************/" + +# Process the options template and generate options.h with all +# translations. +template = file ("t_options.h", "r") +descMatches = [] +for line in template: + if len(descMatches) > 0: + matchENUM = reENUM .match (line) + matchDESC_END = reDESC_END.match (line) + if matchENUM: + descMatches.append (matchENUM) + elif matchDESC_END: + expandMatches (descMatches, translations, line) + descMatches = [] + else: + sys.stderr.write ( + "Warning: unexpected line inside description dropped:\n%s\n" \ + % line) + continue + if reLibintl_h.search (line): + # Ignore (comment out) #include + print "/* %s * commented out by gen_xmlpool.py */" % line + continue + matchDESC = reDESC .match (line) + matchDESC_BEGIN = reDESC_BEGIN.match (line) + if matchDESC: + assert len(descMatches) == 0 + expandMatches ([matchDESC], translations) + elif matchDESC_BEGIN: + assert len(descMatches) == 0 + descMatches = [matchDESC_BEGIN] + else: + print line, + +if len(descMatches) > 0: + sys.stderr.write ("Warning: unterminated description at end of file.\n") + expandMatches (descMatches, translations) --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/mga/README +++ mesa-7.9~git20100924/src/mesa/drivers/dri/mga/README @@ -0,0 +1,26 @@ +MGA DRI driver ported from XF86DRI to FBDRI +by Denis Oliver Kropp + + +INFO + +This driver has been ported from the head branch of XFree86 to +the embedded-1-branch of Mesa. + + +STATUS + +Already working very well as far as I've tested it (16/32 bit). +glxgears runs at 935 fps (G550 32MB AGP 4x, Athlon 1.33) vs 744 fps with XFree. +Other demos (terrain, fire, etc.) have been successfully tested as well. + + +TODO + +- mgaEngineShutdown +- mgaEngineRestore +- SGRAM detection +- remove some unused bits from server/* +- subset driver support +- mgaWaitForVBlank +- deinitialization (from MGADRICloseScreen) a la radeonDestroyScreen --- mesa-7.9~git20100924.orig/src/mesa/drivers/dri/tdfx/BUGS +++ mesa-7.9~git20100924/src/mesa/drivers/dri/tdfx/BUGS @@ -0,0 +1,64 @@ +REMOVE THIS FILE BEFORE MERGING WITH TRUNK +------------------------------------------ + +OUTSTANDING BUGS + +demos/reflect - reading back Z on Voodoo3, image offset to right + Fixed in latest Glide. + +Q3 - some polygons drawn as vertical strips, similar to bug that was + seen in demos/fire. Voodoo3 only. May be related to glDepthMask + or glColorMask. + +book/fog - not fogging + Fog in orthograph mode still not implemented. Checking with + 3dfx engineers for ideas. + +Q3 demo crashes after changing display settings + but the full Q3 game version seems OK. + + + +MORE OUTSTANDING BUGS + +private context was NULL! causing immediate failure of any glx prog. cant +reproduce after restarting the X server. putting it down as halluc. + +texture object image was NULL, causing segmentation failure. happens with +prboom. ive put a check in tdfx_texstate.c but this isn't a fix. + +prboom, wall textures near first chainsaw aren't bound properly. sideways +movements causes the wall textures to move with you. prboom busted? + +16bpp mode, quake3, windowed, q3dm1, floor under rocketlauncher bands. it +looks like multitexturing gone wrong. i'll disable a tmu and test. + +sof, polygons appear at wrong x,y,z positions, intermittent, have not yet +found reliable way of reproducing. culling? sometimes polys disappear. + +descent3 is all black in 16bpp mode - FIXED (palette problems) + +smeared pixels in quake3 - FIXED (texture memory overlapped FB) + + + +PERFORMANCE COMPARISON (Brian / Alan) + + V3/16 is Voodoo3 in 16bpp on a P3/500 + V5/16 is Voodoo5 in 16bpp on a P3/600 + V5/32 is Voodoo5 in 32bpp on a P3/600 + V5A/16 is Voodoo5 in 16bpp on an Alpha AXP/600 + V5A/32 is Voodoo5 in 32bpp on an Alpha AXP/600 + + tdfx-2-1-branch tdfx-3-0-0-branch +demo V3/16 V5/16 V5/32 V3/16 V5/16 V5/32 V5A/16 V5A/32 +------------------------------------------------------------------------ +gloss 257 183 174 320 308 177 313 167 +fire 42 39 52 41 +fire (no help) 98 80 50 106 113 73 124 80 +tunnel 61 50 70 58 +tunnel (no help) 167 142 57 138 152 113 171 122 +gears 663 554 540 881 1232 776 1484 830 +teapot 20 21 37 36 +teapot (no help) 22 14 14 24 30 30 43 42 + --- mesa-7.9~git20100924.orig/src/mesa/vf/vf.h +++ mesa-7.9~git20100924/src/mesa/vf/vf.h @@ -0,0 +1,234 @@ +/* + * Copyright 2003 Tungsten Graphics, inc. + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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: + * Keith Whitwell + */ + +#ifndef VF_VERTEX_H +#define VF_VERTEX_H + +#include "main/glheader.h" +#include "math/m_vector.h" + +enum { + VF_ATTRIB_POS = 0, + VF_ATTRIB_WEIGHT = 1, + VF_ATTRIB_NORMAL = 2, + VF_ATTRIB_COLOR0 = 3, + VF_ATTRIB_COLOR1 = 4, + VF_ATTRIB_FOG = 5, + VF_ATTRIB_COLOR_INDEX = 6, + VF_ATTRIB_EDGEFLAG = 7, + VF_ATTRIB_TEX0 = 8, + VF_ATTRIB_TEX1 = 9, + VF_ATTRIB_TEX2 = 10, + VF_ATTRIB_TEX3 = 11, + VF_ATTRIB_TEX4 = 12, + VF_ATTRIB_TEX5 = 13, + VF_ATTRIB_TEX6 = 14, + VF_ATTRIB_TEX7 = 15, + VF_ATTRIB_VAR0 = 16, + VF_ATTRIB_VAR1 = 17, + VF_ATTRIB_VAR2 = 18, + VF_ATTRIB_VAR3 = 19, + VF_ATTRIB_VAR4 = 20, + VF_ATTRIB_VAR5 = 21, + VF_ATTRIB_VAR6 = 22, + VF_ATTRIB_VAR7 = 23, + VF_ATTRIB_POINTSIZE = 24, + VF_ATTRIB_BFC0 = 25, + VF_ATTRIB_BFC1 = 26, + VF_ATTRIB_CLIP_POS = 27, + VF_ATTRIB_VERTEX_HEADER = 28, + VF_ATTRIB_MAX = 29 +}; + + +enum vf_attr_format { + EMIT_1F, + EMIT_2F, + EMIT_3F, + EMIT_4F, + EMIT_2F_VIEWPORT, /* do viewport transform and emit */ + EMIT_3F_VIEWPORT, /* do viewport transform and emit */ + EMIT_4F_VIEWPORT, /* do viewport transform and emit */ + EMIT_3F_XYW, /* for projective texture */ + EMIT_1UB_1F, /* for fog coordinate */ + EMIT_3UB_3F_RGB, /* for specular color */ + EMIT_3UB_3F_BGR, /* for specular color */ + EMIT_4UB_4F_RGBA, /* for color */ + EMIT_4UB_4F_BGRA, /* for color */ + EMIT_4UB_4F_ARGB, /* for color */ + EMIT_4UB_4F_ABGR, /* for color */ + EMIT_4CHAN_4F_RGBA, /* for swrast color */ + EMIT_PAD, /* leave a hole of 'offset' bytes */ + EMIT_MAX +}; + +struct vf_attr_map { + GLuint attrib; + enum vf_attr_format format; + GLuint offset; +}; + +struct vertex_fetch; + +void vf_set_vp_matrix( struct vertex_fetch *vf, + const GLfloat *viewport ); + +void vf_set_vp_scale_translate( struct vertex_fetch *vf, + const GLfloat *scale, + const GLfloat *translate ); + +GLuint vf_set_vertex_attributes( struct vertex_fetch *vf, + const struct vf_attr_map *map, + GLuint nr, + GLuint vertex_stride ); + +void vf_set_sources( struct vertex_fetch *vf, + GLvector4f * const attrib[], + GLuint start ); + +void vf_emit_vertices( struct vertex_fetch *vf, + GLuint count, + void *dest ); + +void vf_get_attr( struct vertex_fetch *vf, + const void *vertex, + GLenum attr, + const GLfloat *dflt, + GLfloat *dest ); + +struct vertex_fetch *vf_create( GLboolean allow_viewport_emits ); + +void vf_destroy( struct vertex_fetch *vf ); + + + +/*********************************************************************** + * Internal functions and structs: + */ + +struct vf_attr; + +typedef void (*vf_extract_func)( const struct vf_attr *a, + GLfloat *out, + const GLubyte *v ); + +typedef void (*vf_insert_func)( const struct vf_attr *a, + GLubyte *v, + const GLfloat *in ); + +typedef void (*vf_emit_func)( struct vertex_fetch *vf, + GLuint count, + GLubyte *dest ); + + + +/* Describes how to convert/move a vertex attribute from a vertex + * array to a vertex structure. + */ +struct vf_attr +{ + struct vertex_fetch *vf; + + GLuint format; + GLuint inputsize; + GLuint inputstride; + GLuint vertoffset; /* position of the attrib in the vertex struct */ + + GLuint attrib; /* which vertex attrib (0=position, etc) */ + GLuint vertattrsize; /* size of the attribute in bytes */ + + GLubyte *inputptr; + const vf_insert_func *insert; + vf_insert_func do_insert; + vf_extract_func extract; +}; + +struct vertex_fetch +{ + struct vf_attr attr[VF_ATTRIB_MAX]; + GLuint attr_count; + GLuint vertex_stride; + + struct vf_attr *lookup[VF_ATTRIB_MAX]; + + vf_emit_func emit; + + /* Parameters and constants for codegen: + */ + GLboolean allow_viewport_emits; + GLfloat vp[8]; + GLfloat chan_scale[4]; + GLfloat identity[4]; + + struct vf_fastpath *fastpath; + + void (*codegen_emit)( struct vertex_fetch *vf ); +}; + + +struct vf_attr_type { + GLuint format; + GLuint size; + GLuint stride; + GLuint offset; +}; + +struct vf_fastpath { + GLuint vertex_stride; + GLuint attr_count; + GLboolean match_strides; + + struct vf_attr_type *attr; + + vf_emit_func func; + struct vf_fastpath *next; +}; + + +void vf_register_fastpath( struct vertex_fetch *vtx, + GLboolean match_strides ); + +void vf_generic_emit( struct vertex_fetch *vf, + GLuint count, + GLubyte *v ); + +void vf_generate_hardwired_emit( struct vertex_fetch *vf ); + +void vf_generate_sse_emit( struct vertex_fetch *vf ); + + +struct vf_format_info { + const char *name; + vf_extract_func extract; + vf_insert_func insert[4]; + const GLuint attrsize; +}; + +const struct vf_format_info vf_format_info[EMIT_MAX]; + + +#endif --- mesa-7.9~git20100924.orig/src/mesa/vf/vf_generic.c +++ mesa-7.9~git20100924/src/mesa/vf/vf_generic.c @@ -0,0 +1,982 @@ + +/* + * Copyright 2003 Tungsten Graphics, inc. + * All Rights Reserved. + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS 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: + * Keith Whitwell + */ + +#include "main/glheader.h" +#include "main/context.h" +#include "main/colormac.h" +#include "main/macros.h" +#include "main/simple_list.h" + +#include "vf/vf.h" + + +/* + * These functions take the NDC coordinates pointed to by 'in', apply the + * NDC->Viewport mapping and store the results at 'v'. + */ + +static INLINE void insert_4f_viewport_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; + out[2] = scale[2] * in[2] + trans[2]; + out[3] = in[3]; +} + +static INLINE void insert_4f_viewport_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; + out[2] = scale[2] * in[2] + trans[2]; + out[3] = 1; +} + +static INLINE void insert_4f_viewport_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; + out[2] = trans[2]; + out[3] = 1; +} + +static INLINE void insert_4f_viewport_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = trans[1]; + out[2] = trans[2]; + out[3] = 1; +} + +static INLINE void insert_3f_viewport_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; + out[2] = scale[2] * in[2] + trans[2]; +} + +static INLINE void insert_3f_viewport_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; + out[2] = scale[2] * in[2] + trans[2]; +} + +static INLINE void insert_3f_viewport_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = trans[1]; + out[2] = trans[2]; +} + +static INLINE void insert_2f_viewport_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = scale[1] * in[1] + trans[1]; +} + +static INLINE void insert_2f_viewport_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = scale[0] * in[0] + trans[0]; + out[1] = trans[1]; +} + + +/* + * These functions do the same as above, except for the viewport mapping. + */ + +static INLINE void insert_4f_4( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = in[3]; +} + +static INLINE void insert_4f_3( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = 1; +} + +static INLINE void insert_4f_2( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0; + out[3] = 1; +} + +static INLINE void insert_4f_1( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = 0; + out[2] = 0; + out[3] = 1; +} + +static INLINE void insert_3f_xyw_4( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[3]; +} + +static INLINE void insert_3f_xyw_err( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + (void) a; (void) v; (void) in; + exit(1); +} + +static INLINE void insert_3f_3( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; +} + +static INLINE void insert_3f_2( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0; +} + +static INLINE void insert_3f_1( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = 0; + out[2] = 0; +} + + +static INLINE void insert_2f_2( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = in[1]; +} + +static INLINE void insert_2f_1( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; + out[1] = 0; +} + +static INLINE void insert_1f_1( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + GLfloat *out = (GLfloat *)(v); + (void) a; + + out[0] = in[0]; +} + +static INLINE void insert_null( const struct vf_attr *a, GLubyte *v, const GLfloat *in ) +{ + (void) a; (void) v; (void) in; +} + +static INLINE void insert_4chan_4f_rgba_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLchan *c = (GLchan *)v; + (void) a; + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]); +} + +static INLINE void insert_4chan_4f_rgba_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLchan *c = (GLchan *)v; + (void) a; + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); + c[3] = CHAN_MAX; +} + +static INLINE void insert_4chan_4f_rgba_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLchan *c = (GLchan *)v; + (void) a; + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); + c[2] = 0; + c[3] = CHAN_MAX; +} + +static INLINE void insert_4chan_4f_rgba_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + GLchan *c = (GLchan *)v; + (void) a; + UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); + c[1] = 0; + c[2] = 0; + c[3] = CHAN_MAX; +} + +static INLINE void insert_4ub_4f_rgba_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); +} + +static INLINE void insert_4ub_4f_rgba_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_rgba_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + v[2] = 0; + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_rgba_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + v[1] = 0; + v[2] = 0; + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_bgra_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]); +} + +static INLINE void insert_4ub_4f_bgra_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_bgra_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + v[0] = 0; + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_bgra_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + v[1] = 0; + v[0] = 0; + v[3] = 0xff; +} + +static INLINE void insert_4ub_4f_argb_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]); + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); +} + +static INLINE void insert_4ub_4f_argb_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]); + v[0] = 0xff; +} + +static INLINE void insert_4ub_4f_argb_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + v[3] = 0x00; + v[0] = 0xff; +} + +static INLINE void insert_4ub_4f_argb_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]); + v[2] = 0x00; + v[3] = 0x00; + v[0] = 0xff; +} + +static INLINE void insert_4ub_4f_abgr_4( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]); + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]); +} + +static INLINE void insert_4ub_4f_abgr_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]); + v[0] = 0xff; +} + +static INLINE void insert_4ub_4f_abgr_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]); + v[1] = 0x00; + v[0] = 0xff; +} + +static INLINE void insert_4ub_4f_abgr_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]); + v[2] = 0x00; + v[1] = 0x00; + v[0] = 0xff; +} + +static INLINE void insert_3ub_3f_rgb_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); +} + +static INLINE void insert_3ub_3f_rgb_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + v[2] = 0; +} + +static INLINE void insert_3ub_3f_rgb_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); + v[1] = 0; + v[2] = 0; +} + +static INLINE void insert_3ub_3f_bgr_3( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); +} + +static INLINE void insert_3ub_3f_bgr_2( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); + v[0] = 0; +} + +static INLINE void insert_3ub_3f_bgr_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); + v[1] = 0; + v[0] = 0; +} + + +static INLINE void insert_1ub_1f_1( const struct vf_attr *a, GLubyte *v, + const GLfloat *in ) +{ + (void) a; + UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); +} + + +/*********************************************************************** + * Functions to perform the reverse operations to the above, for + * swrast translation and clip-interpolation. + * + * Currently always extracts a full 4 floats. + */ + +static void extract_4f_viewport( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + /* Although included for completeness, the position coordinate is + * usually handled differently during clipping. + */ + out[0] = (in[0] - trans[0]) / scale[0]; + out[1] = (in[1] - trans[1]) / scale[1]; + out[2] = (in[2] - trans[2]) / scale[2]; + out[3] = in[3]; +} + +static void extract_3f_viewport( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = (in[0] - trans[0]) / scale[0]; + out[1] = (in[1] - trans[1]) / scale[1]; + out[2] = (in[2] - trans[2]) / scale[2]; + out[3] = 1; +} + + +static void extract_2f_viewport( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + const GLfloat *scale = a->vf->vp; + const GLfloat *trans = a->vf->vp + 4; + + out[0] = (in[0] - trans[0]) / scale[0]; + out[1] = (in[1] - trans[1]) / scale[1]; + out[2] = 0; + out[3] = 1; +} + + +static void extract_4f( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = in[3]; +} + +static void extract_3f_xyw( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0; + out[3] = in[2]; +} + + +static void extract_3f( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = in[2]; + out[3] = 1; +} + + +static void extract_2f( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + (void) a; + + out[0] = in[0]; + out[1] = in[1]; + out[2] = 0; + out[3] = 1; +} + +static void extract_1f( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + const GLfloat *in = (const GLfloat *)v; + (void) a; + + out[0] = in[0]; + out[1] = 0; + out[2] = 0; + out[3] = 1; +} + +static void extract_4chan_4f_rgba( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + GLchan *c = (GLchan *)v; + (void) a; + + out[0] = CHAN_TO_FLOAT(c[0]); + out[1] = CHAN_TO_FLOAT(c[1]); + out[2] = CHAN_TO_FLOAT(c[2]); + out[3] = CHAN_TO_FLOAT(c[3]); +} + +static void extract_4ub_4f_rgba( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[0] = UBYTE_TO_FLOAT(v[0]); + out[1] = UBYTE_TO_FLOAT(v[1]); + out[2] = UBYTE_TO_FLOAT(v[2]); + out[3] = UBYTE_TO_FLOAT(v[3]); +} + +static void extract_4ub_4f_bgra( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[2] = UBYTE_TO_FLOAT(v[0]); + out[1] = UBYTE_TO_FLOAT(v[1]); + out[0] = UBYTE_TO_FLOAT(v[2]); + out[3] = UBYTE_TO_FLOAT(v[3]); +} + +static void extract_4ub_4f_argb( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[3] = UBYTE_TO_FLOAT(v[0]); + out[0] = UBYTE_TO_FLOAT(v[1]); + out[1] = UBYTE_TO_FLOAT(v[2]); + out[2] = UBYTE_TO_FLOAT(v[3]); +} + +static void extract_4ub_4f_abgr( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[3] = UBYTE_TO_FLOAT(v[0]); + out[2] = UBYTE_TO_FLOAT(v[1]); + out[1] = UBYTE_TO_FLOAT(v[2]); + out[0] = UBYTE_TO_FLOAT(v[3]); +} + +static void extract_3ub_3f_rgb( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[0] = UBYTE_TO_FLOAT(v[0]); + out[1] = UBYTE_TO_FLOAT(v[1]); + out[2] = UBYTE_TO_FLOAT(v[2]); + out[3] = 1; +} + +static void extract_3ub_3f_bgr( const struct vf_attr *a, GLfloat *out, + const GLubyte *v ) +{ + (void) a; + out[2] = UBYTE_TO_FLOAT(v[0]); + out[1] = UBYTE_TO_FLOAT(v[1]); + out[0] = UBYTE_TO_FLOAT(v[2]); + out[3] = 1; +} + +static void extract_1ub_1f( const struct vf_attr *a, GLfloat *out, const GLubyte *v ) +{ + (void) a; + out[0] = UBYTE_TO_FLOAT(v[0]); + out[1] = 0; + out[2] = 0; + out[3] = 1; +} + + +const struct vf_format_info vf_format_info[EMIT_MAX] = +{ + { "1f", + extract_1f, + { insert_1f_1, insert_1f_1, insert_1f_1, insert_1f_1 }, + sizeof(GLfloat) }, + + { "2f", + extract_2f, + { insert_2f_1, insert_2f_2, insert_2f_2, insert_2f_2 }, + 2 * sizeof(GLfloat) }, + + { "3f", + extract_3f, + { insert_3f_1, insert_3f_2, insert_3f_3, insert_3f_3 }, + 3 * sizeof(GLfloat) }, + + { "4f", + extract_4f, + { insert_4f_1, insert_4f_2, insert_4f_3, insert_4f_4 }, + 4 * sizeof(GLfloat) }, + + { "2f_viewport", + extract_2f_viewport, + { insert_2f_viewport_1, insert_2f_viewport_2, insert_2f_viewport_2, + insert_2f_viewport_2 }, + 2 * sizeof(GLfloat) }, + + { "3f_viewport", + extract_3f_viewport, + { insert_3f_viewport_1, insert_3f_viewport_2, insert_3f_viewport_3, + insert_3f_viewport_3 }, + 3 * sizeof(GLfloat) }, + + { "4f_viewport", + extract_4f_viewport, + { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3, + insert_4f_viewport_4 }, + 4 * sizeof(GLfloat) }, + + { "3f_xyw", + extract_3f_xyw, + { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err, + insert_3f_xyw_4 }, + 3 * sizeof(GLfloat) }, + + { "1ub_1f", + extract_1ub_1f, + { insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1 }, + sizeof(GLubyte) }, + + { "3ub_3f_rgb", + extract_3ub_3f_rgb, + { insert_3ub_3f_rgb_1, insert_3ub_3f_rgb_2, insert_3ub_3f_rgb_3, + insert_3ub_3f_rgb_3 }, + 3 * sizeof(GLubyte) }, + + { "3ub_3f_bgr", + extract_3ub_3f_bgr, + { insert_3ub_3f_bgr_1, insert_3ub_3f_bgr_2, insert_3ub_3f_bgr_3, + insert_3ub_3f_bgr_3 }, + 3 * sizeof(GLubyte) }, + + { "4ub_4f_rgba", + extract_4ub_4f_rgba, + { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3, + insert_4ub_4f_rgba_4 }, + 4 * sizeof(GLubyte) }, + + { "4ub_4f_bgra", + extract_4ub_4f_bgra, + { insert_4ub_4f_bgra_1, insert_4ub_4f_bgra_2, insert_4ub_4f_bgra_3, + insert_4ub_4f_bgra_4 }, + 4 * sizeof(GLubyte) }, + + { "4ub_4f_argb", + extract_4ub_4f_argb, + { insert_4ub_4f_argb_1, insert_4ub_4f_argb_2, insert_4ub_4f_argb_3, + insert_4ub_4f_argb_4 }, + 4 * sizeof(GLubyte) }, + + { "4ub_4f_abgr", + extract_4ub_4f_abgr, + { insert_4ub_4f_abgr_1, insert_4ub_4f_abgr_2, insert_4ub_4f_abgr_3, + insert_4ub_4f_abgr_4 }, + 4 * sizeof(GLubyte) }, + + { "4chan_4f_rgba", + extract_4chan_4f_rgba, + { insert_4chan_4f_rgba_1, insert_4chan_4f_rgba_2, insert_4chan_4f_rgba_3, + insert_4chan_4f_rgba_4 }, + 4 * sizeof(GLchan) }, + + { "pad", + NULL, + { NULL, NULL, NULL, NULL }, + 0 } + +}; + + + + +/*********************************************************************** + * Hardwired fastpaths for emitting whole vertices or groups of + * vertices + */ +#define EMIT5(NR, F0, F1, F2, F3, F4, NAME) \ +static void NAME( struct vertex_fetch *vf, \ + GLuint count, \ + GLubyte *v ) \ +{ \ + struct vf_attr *a = vf->attr; \ + GLuint i; \ + \ + for (i = 0 ; i < count ; i++, v += vf->vertex_stride) { \ + if (NR > 0) { \ + F0( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr ); \ + a[0].inputptr += a[0].inputstride; \ + } \ + \ + if (NR > 1) { \ + F1( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr ); \ + a[1].inputptr += a[1].inputstride; \ + } \ + \ + if (NR > 2) { \ + F2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr ); \ + a[2].inputptr += a[2].inputstride; \ + } \ + \ + if (NR > 3) { \ + F3( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr ); \ + a[3].inputptr += a[3].inputstride; \ + } \ + \ + if (NR > 4) { \ + F4( &a[4], v + a[4].vertoffset, (GLfloat *)a[4].inputptr ); \ + a[4].inputptr += a[4].inputstride; \ + } \ + } \ +} + + +#define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \ + insert_null, insert_null, NAME) + +#define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \ + insert_null, NAME) + +#define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \ + insert_null, NAME) + + +EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4) +EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4) +EMIT2(insert_3f_3, insert_4ub_4f_rgba_4, emit_xyz3_rgba4) + +EMIT3(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_viewport4_rgba4_st2) +EMIT3(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, emit_viewport4_bgra4_st2) +EMIT3(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_xyzw4_rgba4_st2) + +EMIT4(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_viewport4_rgba4_st2_st2) +EMIT4(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, insert_2f_2, emit_viewport4_bgra4_st2_st2) +EMIT4(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_xyzw4_rgba4_st2_st2) + + +/* Use the codegen paths to select one of a number of hardwired + * fastpaths. + */ +void vf_generate_hardwired_emit( struct vertex_fetch *vf ) +{ + vf_emit_func func = NULL; + + /* Does it fit a hardwired fastpath? Help! this is growing out of + * control! + */ + switch (vf->attr_count) { + case 2: + if (vf->attr[0].do_insert == insert_3f_viewport_3) { + if (vf->attr[1].do_insert == insert_4ub_4f_bgra_4) + func = emit_viewport3_bgra4; + else if (vf->attr[1].do_insert == insert_4ub_4f_rgba_4) + func = emit_viewport3_rgba4; + } + else if (vf->attr[0].do_insert == insert_3f_3 && + vf->attr[1].do_insert == insert_4ub_4f_rgba_4) { + func = emit_xyz3_rgba4; + } + break; + case 3: + if (vf->attr[2].do_insert == insert_2f_2) { + if (vf->attr[1].do_insert == insert_4ub_4f_rgba_4) { + if (vf->attr[0].do_insert == insert_4f_viewport_4) + func = emit_viewport4_rgba4_st2; + else if (vf->attr[0].do_insert == insert_4f_4) + func = emit_xyzw4_rgba4_st2; + } + else if (vf->attr[1].do_insert == insert_4ub_4f_bgra_4 && + vf->attr[0].do_insert == insert_4f_viewport_4) + func = emit_viewport4_bgra4_st2; + } + break; + case 4: + if (vf->attr[2].do_insert == insert_2f_2 && + vf->attr[3].do_insert == insert_2f_2) { + if (vf->attr[1].do_insert == insert_4ub_4f_rgba_4) { + if (vf->attr[0].do_insert == insert_4f_viewport_4) + func = emit_viewport4_rgba4_st2_st2; + else if (vf->attr[0].do_insert == insert_4f_4) + func = emit_xyzw4_rgba4_st2_st2; + } + else if (vf->attr[1].do_insert == insert_4ub_4f_bgra_4 && + vf->attr[0].do_insert == insert_4f_viewport_4) + func = emit_viewport4_bgra4_st2_st2; + } + break; + } + + vf->emit = func; +} + +/*********************************************************************** + * Generic (non-codegen) functions for whole vertices or groups of + * vertices + */ + +void vf_generic_emit( struct vertex_fetch *vf, + GLuint count, + GLubyte *v ) +{ + struct vf_attr *a = vf->attr; + const GLuint attr_count = vf->attr_count; + const GLuint stride = vf->vertex_stride; + GLuint i, j; + + for (i = 0 ; i < count ; i++, v += stride) { + for (j = 0; j < attr_count; j++) { + GLfloat *in = (GLfloat *)a[j].inputptr; + a[j].inputptr += a[j].inputstride; + a[j].do_insert( &a[j], v + a[j].vertoffset, in ); + } + } +} + + --- mesa-7.9~git20100924.orig/src/mesa/state_tracker/Makefile +++ mesa-7.9~git20100924/src/mesa/state_tracker/Makefile @@ -0,0 +1,2 @@ +default: + cd ../.. ; make \ No newline at end of file --- mesa-7.9~git20100924.orig/src/egl/main/SConscript +++ mesa-7.9~git20100924/src/egl/main/SConscript @@ -0,0 +1,51 @@ +####################################################################### +# SConscript for EGL + + +Import('*') + +if env['platform'] != 'winddk': + + env = env.Clone() + + env.Append(CPPDEFINES = [ + '_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WINDOWS', + '_EGL_DRIVER_SEARCH_DIR=\\"\\"', + '_EGL_OS_WINDOWS', + '_EGL_GET_CORE_ADDRESSES', + 'KHRONOS_DLL_EXPORTS', + ]) + + env.Append(CPPPATH = [ + '#/include', + ]) + + egl_sources = [ + 'eglapi.c', + 'eglarray.c', + 'eglconfig.c', + 'eglcontext.c', + 'eglcurrent.c', + 'egldisplay.c', + 'egldriver.c', + 'eglglobals.c', + 'eglimage.c', + 'egllog.c', + 'eglmisc.c', + 'eglmode.c', + 'eglscreen.c', + 'eglstring.c', + 'eglsurface.c', + 'eglsync.c', + ] + + egl = env.SharedLibrary( + target = 'libEGL', + source = egl_sources + ['egl.def'], + ) + + env.InstallSharedLibrary(egl, version=(1, 4, 0)) + + egl = [env.FindIxes(egl, 'LIBPREFIX', 'LIBSUFFIX')] + + Export('egl') --- mesa-7.9~git20100924.orig/src/egl/main/README.txt +++ mesa-7.9~git20100924/src/egl/main/README.txt @@ -0,0 +1,71 @@ + + +Notes about the EGL library: + + +The EGL code here basically consists of two things: + +1. An EGL API dispatcher. This directly routes all the eglFooBar() API + calls into driver-specific functions. + +2. Fallbacks for EGL API functions. A driver _could_ implement all the + EGL API calls from scratch. But in many cases, the fallbacks provided + in libEGL (such as eglChooseConfig()) will do the job. + + + +Bootstrapping: + +When the apps calls eglOpenDisplay() a device driver is selected and loaded +(look for dlsym() or LoadLibrary() in egldriver.c). + +The driver's _eglMain() function is then called. This driver function +allocates, initializes and returns a new _EGLDriver object (usually a +subclass of that type). + +As part of initialization, the dispatch table in _EGLDriver->API must be +populated with all the EGL entrypoints. Typically, _eglInitDriverFallbacks() +can be used to plug in default/fallback functions. Some functions like +driver->API.Initialize and driver->API.Terminate _must_ be implemented +with driver-specific code (no default/fallback function is possible). + + +A bit later, the app will call eglInitialize(). This will get routed +to the driver->API.Initialize() function. Any additional driver +initialization that wasn't done in _eglMain() should be done at this +point. Typically, this will involve setting up visual configs, etc. + + + +Special Functions: + +Certain EGL functions _must_ be implemented by the driver. This includes: + +eglCreateContext +eglCreateWindowSurface +eglCreatePixmapSurface +eglCreatePBufferSurface +eglMakeCurrent +eglSwapBuffers + +Most of the EGLConfig-related functions can be implemented with the +defaults/fallbacks. Same thing for the eglGet/Query functions. + + + + +Teardown: + +When eglTerminate() is called, the driver->API.Terminate() function is +called. The driver should clean up after itself. eglTerminate() will +then close/unload the driver (shared library). + + + + +Subclassing: + +The internal libEGL data structures such as _EGLDisplay, _EGLContext, +_EGLSurface, etc should be considered base classes from which drivers +will derive subclasses. + --- mesa-7.9~git20100924.orig/src/egl/docs/EGL_MESA_screen_surface +++ mesa-7.9~git20100924/src/egl/docs/EGL_MESA_screen_surface @@ -0,0 +1,564 @@ +Name + + MESA_screen_surface + +Name Strings + + EGL_MESA_screen_surface + +Contact + + Brian Paul + + To discuss, join the dri-egl@lists.freedesktop.org list. + +Status + + Obsolete. + +Version + + 11 (27 January 2006) + +Number + + TBD + +Dependencies + + EGL 1.0 or later. + +Overview + + EGL 1.1 supports three types of drawing surfaces: + * Window surfaces + * Pixmap surfaces + * Pbuffer surfaces + This extension defines a fourth type of drawing surface: + * Screen surface + + A screen surface is a surface for which the (front) color buffer can + be directly displayed (i.e. scanned out) on a monitor (such as a flat + panel or CRT). In particular the color buffer memory will be allocated + at a location in VRAM (and in a suitable format) which can be displayed + by the graphics hardware. + + Note that the width and height of the screen surface need not exactly + match the monitor's current resolution. For example, while the monitor + may be configured to to show 1024x768 pixels, the associated screen + surface may be larger, such as 1200x1000. The "screen origin" attribute + will specify which region of the screen surface which is visible on the + monitor. The screen surface can be scrolled by changing this origin. + + This extension also defines functions for controlling the monitor's + display mode (width, height, refresh rate, etc), and specifing which + screen surface is to be displayed on a monitor. + + The new EGLModeMESA type and related functions are very similar to the + EGLConfig type and related functions. The user may get a list of + supported modes for a screen and specify the mode to be used when + displaying a screen surface. + + +Issues + + 1. Should EGL_INTERLACE be a supported mode attribute? + + Arguments against: + + No, this should be provided by another extension which would + also provide the mechanisms needed to play back interlaced video + material correctly on hardware that supports it. + This extension should prefer non-interlaced modes. [M. Danzer] + + Arguments for: + + An interlaced display can be of use without considering video + material. Being able to query whether a screen is operating in + interlaced mode can be used by applications to control their + drawing. For example: avoid drawing 1-pixel-wide horizontal lines + if screen is interlaced. [B. Paul] + + Resolution: Defer for future extension? + + + 2. Should EGL_REFRESH_RATE be a supported mode attribute? + + Arguments for: + + Yes, it's been shown that applications and/or users need to select + modes by this. [M. Danzer] + + Many examples have been given in which it's desirable to let the + user choose from a variety of refresh rates without having to + restart/reconfigure. [B. Paul] + + Arguments against: + + TBD. + + Resolution: Yes. + + + 3. Exactly how should the list of modes returned by eglChooseConfigMESA + be sorted? + + Current method is described in the text below. Subject to change. + + Alternately, leave the sorting order undefined so that each + implementation can return the modes in order of "most desirable" + to "least desirable" which may depend on the display technology + (CRT vs LCD, etc) or other factors. + + + 4. How should screen blanking be supported? Note that a screen can be + disabled or turned off by calling eglShowSurface(dpy, scrn, + EGL_NO_SURFACE, EGL_NO_MODE_MESA). But what about power-save mode? + + I would defer this to other extensions that depend on this one. + I can imagine people wanting different semantics not just in + relation to the power management API being exposed (DPMS or whatever) + but also relating to what events can trigger EGL_CONTEXT_LOST. Also + I'm not sure whether power management commands are properly operations + on the Display or on a screen surface. [A. Jackson] + + + 5. Should the EGL_PHYSICAL_SIZE_EGL query be kept? The size information + isn't always reliable (consider video projectors) but can still be + used to determine the pixel aspect ratio. + + Resolution: Omit. The EGL 1.2 specification includes queries for + the display resolution and pixel aspect ratio. + + + 6. Should detailed mode timing information be exposed by this API? + + Probably not. Instead, offer that information in a layered extension. + + + 7. How should the notion of a screen's "native" mode be expressed? + For example, LCD panels have a native resolution and refresh rate + that looks best but other sub-optimal resolutions may be supported. + + The mode attribute EGL_OPTIMAL_MESA will be set for modes which + best match the screen. [M. Danzer] + + + 8. Should eglQueryModeStringMESA() be included? This function returns + a human-readable string which corresponds to an EGLMode. + + Arguments for: + + A mode name such as "HDTV-720P" might mean more to users than + "1280x720@60Hz" if the later were generated via code. + + Arguments against: + + There's no standard syntax for the strings. May cause more + trouble than it's worth. + + Postpone for future extension. [A. Jackson] + + Latest discussion leaning toward omitting this function. + + + 9. Should we use "Get" or "Query" for functions which return state? + The EGL 1.x specification doesn't seem to be totally consistent + in this regard, but "Query" is used more often. + + Use "Get" for mode-related queries (as for EGLConfigs) but "Query" + for everything else. + + + 10. What should be the default size for screen surfaces? + + For Pbuffer surfaces the default width and height are zero. + We'll do the same for screen surfaces. Since there's no function + to resize surfaces it's useless to have a 0x0 screen, but this isn't + a situation that'll normally be encountered. + + + 11. Should there be a function for resizing a screen surface? + + Suppose one wants to change the screen's size in the EGL application. + Also suppose there's a hardware restriction such that only one screen + surface can exist at a time (either for lack of memory or because of + memory layout restrictions). + + The basic idea is that the currently displayed screen surface must + be deallocated before a new one can be created. Perhaps a resize + function would work better? + + + 12. How should sub-pixel LCD color information be made available? + What about the display's gamma value? + + Perhaps expose as additional read-only mode attributes. + + Perhaps postpone for a layered extension. + + + 13. What happens if the user attempts to delete a screen surface that + is currently being shown? + + Spec currently says that's illegal and that an error (TBD) will be + generated. + + + 14. What if the physical screen size can't be determined? Should + a query of EGL_PHYSICAL_SIZE_MESA return [0,0]? + + Obsolete: EGL_PHYSICAL_SIZE_MESA not used. + + + 15. Suppose the device's number of RAMDACs is different from the + number of output ports. For example, a graphics card with + two RAMDACs but three ports (VGA, DVI, TV). + + Address this in a follow-on extension. [Matthias Hopf] + + + 16. How should we deal with on-the-fly device changes? For example, + the monitor being unplugged and replaced by another with different + characteristics? + + A HAL event could be received via DBUS in the application [J. Smirl, + A. Jackson]. + + Should there be an EGL mechanism for detecting this? Maybe an + EGL_SCREEN_LOST error (similar to EGL_CONTEXT_LOST) can be recorded + when there's a screen change. At least then the application can + poll to detect this situation. + + Maybe leave that to a future extension. + + See also the EGL_SCREEN_COUNT_MESA query. + + + 17. What if pixel-accurate panning is not supported (see + eglScreenPositionMESA)? [M. Danzer] + + Is this a common problem? Can we ignore it for now? + + + 18. Should eglShowSurfaceMESA be renamed to eglShowScreenSurfaceMESA? + + Probably. + + + +New Procedures and Functions + + EGLBoolean eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + const EGLint *attrib_list, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, + EGLint attrib, EGLint *value) + + + EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, + EGLint screens_size, EGLint *num_screens) + + EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) + + EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface surface, EGLModeMESA mode) + + EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint x, EGLint y) + + + EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint attrib, EGLint *value); + + EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface *surface) + + EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *mode) + + const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLMode mode); + + +New Types + + EGLModeMESA + EGLScreenMESA + +New Tokens + + New error codes: + + EGL_BAD_SCREEN_MESA + EGL_BAD_MODE_MESA + + Screen-related tokens: + + EGL_SCREEN_COUNT_MESA + EGL_SCREEN_POSITION_MESA + EGL_SCREEN_BIT_MESA + EGL_SCREEN_POSITION_GRANULARITY_MESA + + Mode-related tokens: + + EGL_MODE_ID_MESA + EGL_REFRESH_RATE_MESA + EGL_INTERLACED_MESA + EGL_OPTIMAL_MESA + EGL_NO_MODE_MESA + + +Additions to Chapter X of the EGL 1.1 Specification + + [XXX this all has to be rewritten to fit into the EGL specification + and match the conventions of an EGL extension. For now, just list + all the functions with brief descriptions.] + + + EGLBoolean eglChooseModeMESA(EGLDisplay dpy, const EGLScreenMESA screen, + EGLint *attrib_list, EGLModeMESA *modes, + EGLint modes_size, EGLint *num_modes) + + Like eglChooseConfig, returns a list of EGLModes which match the given + attribute list. This does not set the screen's current display mode. + The attribute list is a list of token/value pairs terminated with + EGL_NONE. Supported attributes include: + + Name Description + --------------------- --------------------------------------------- + EGL_WIDTH Mode width (resolution) + EGL_HEIGHT Mode height (resolution) + EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000 + EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise + EGL_OPTIMAL_MESA Set if the most is especially optimal for the + screen (ex. for particular LCD resolutions) + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + The list of modes returned by eglChooseModeMESA will be sorted + according to the following criteria. See the discussion of table 3.3 + in the EGL specification for more information. + + Selection Sort Sort + Attribute Default Criteria Order Priority + -------------------- -------------- ----------- ------ -------- + EGL_OPTIMAL_MESA EGL_DONT_CARE Exact 1,0 1 + EGL_INTERLACED_MESA EGL_DONT_CARE Exact 0,1 2 + EGL_REFRESH_RATE EGL_DONT_CARE AtLeast Larger 3 + EGL_WIDTH EGL_DONT_CARE AtLeast Larger 4 + EGL_HEIGHT EGL_DONT_CARE AtLeast Larger 5 + EGL_MODE_ID_MESA EGL_DONT_CARE Exact Smaller 6 + + + EGLBoolean eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *modes, EGLint modes_size, + EGLint *num_modes) + + Like eglGetConfigs, returns a list of all modes supported by the + given screen. The returned modes will be sorted in the same manner + as for eglChooseModeMESA(). + + + + EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, + EGLint attrib, EGLint *value) + + Used to query mode attributes. The following attributes are supported: + + Name Return value description + --------------------- ---------------------------------------------- + EGL_OPTIMAL_MESA 1 indicates an optimal mode, 0 otherwise + EGL_INTERLACED_MESA 1 indicates an interlaced mode, 0 otherwise + EGL_REFRESH_RATE_MESA The mode's refresh rate, multiplied by 1000 + EGL_WIDTH Mode width (resolution) + EGL_HEIGHT Mode height (resolution) + EGL_MODE_ID_MESA A unique small integer identifier for the mode + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + + + EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, + EGLint screens_size, EGLint *num_screens) + + This function returns an array of all available screen handles. + is the maximum number of screens to return in the + array. will return the number of screen handles + placed in the array, even if is NULL. + + The number of screens and the availability of each may change over + time (hot-plugging). Screen handles will not be reused. When a + screen handle becomes invalid, function calls which reference an + invalid handle will generate EGL_BAD_SCREEN_MESA. + + The first screen handle returned will be considered to be the primary + one. + + + + EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) + + Create a surface that can be displayed on a screen. is + an array of token/value pairs terminated with EGL_NONE. Valid tokens + include: + + Name Description + ---------------- -------------------------------- + EGL_WIDTH desired surface width in pixels + EGL_HEIGHT desired surface height in pixels + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + The default width and height are zero. + + + + EGLBoolean eglShowSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface surface, EGLModeMESA mode) + + This function causes a screen to show the given surface (or more + precisely, the surface's front color buffer) with the given mode. + + If the surface is in any way incompatible with the mode, the error + EGL_BAD_MATCH will be generated, EGL_FALSE will be returned, and the + previous screen state will remain in effect. This might occur when + the bandwidth of the video-out subsystem is exceeded, or if the mode + specifies a width or height that's greater than the width or height + of the surface. + + To disable a screen, the values EGL_NO_SURFACE and EGL_NO_MODE_MESA + be passed as the and parameters. + + The values of EGL_SCREEN_POSITION_MESA are clamped to the new valid + range computed from the screen size and surface size. If the new + surface is EGL_NO_SURFACE, EGL_SCREEN_POSITION_MESA is set to [0, 0]. + + + Attempting to delete a screen surface which is currently being + displayed will result in the error EGL_BAD_ACCESS being generated. + + + + EGLBoolean eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint x, EGLint y) + + Specifies the origin of the screen's view into the surface, if the + surface is larger than the screen. Valid values for x and y are + [0, surfaceWidth - screenWidth] and [0, surfaceHeight - screenHeight], + respectively. + + The x and y values are also constrained to be integer multiples of the + EGL_SCREEN_POSITION_GRANULARITY_MESA values. + + + + + EGLBoolean eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLint attrib, EGLint *value); + + Used to query screen attributes. may be one of the following: + + Name Return value description + ------------------------ --------------------------------------------- + EGL_SCREEN_POSITION_MESA x, y position of the screen's origin with + respect to the surface. If no surface is + attached to the screen, [0, 0] is returned. + EGL_SCREEN_POSITION_GRANULARITY_MESA + Returns the granularity, in pixels, for + which the screen position is constrained. + + Any other token will generate the error EGL_BAD_ATTRIBUTE. + + + + + EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLSurface *surface) + + Returns the surface currently displayed on the given screen. + may be EGL_NO_SURFACE if the screen isn't currently showing any surface. + + + + + EGLBoolean eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, + EGLModeMESA *mode) + + Returns the given screen's current display mode. The mode may be + EGL_NO_MODE_MESA if the screen is currently disabled. + + + + const char *eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); + + Returns a human-readable string for the given mode. The string is a + zero-terminated C string which the user should not attempt to free. + There is no standard syntax for mode strings. Applications should + not directly rely on mode strings. + + + +Version History + + 1. 15 March 2005 - BrianP + Initial version + + 2. 16 March 2005 - BrianP + Removed EGL_DEPTH_MESA + Added EGL_PHYSICAL_WIDTH_MESA, EGL_PHYSICAL_HEIGHT_MESA queries + Added EGL_OPTIMAL_MESA for width/height/refresh rate selection + Added possible eglQueryModeStringMESA() function + More details of the new functions explained. + + 3. 18 March 2005 - BrianP + Added screen_number to eglChooseModeMESA(). + Fix off by one mistake in value range for ORIGIN attributes + Added Issues section + + 4. 21 March 2005 - BrianP + Removed eglScreenAttribsMESA(). + Added eglScreenPositionMESA() to set screen origin. + Replaced EGL_SCREEN_X/Y_OFFSET_MESA with EGL_SCREEN_POSITION_MESA. + Replaced EGL_PHYSICAL_WIDTH/HEIGHT_MESA with EGL_PHYSICAL_SIZE_MESA. + Use EGL_OPTIMAL_MESA as a new mode attribute. (Michel Danzer) + Added a few more issues. + + 5. 6 April 2005 - BrianP + More language for eglGetModeStringMESA(). + Added issues 10, 11, 12, 13, 14. + Updated issue 3 discussion about mode sorting. + + 6. 22 April 2005 - BrianP + Fixed "LDC" typo. + Added issues 15, 16. + Changed dependency on EGL 1.1 to EGL 1.0 + s/EGL_NUM_SCREENS_MESA/EGL_SCREEN_COUNT_MESA/ + Added eglQueryDisplayMESA() to New Functions section. + Clarified language for the EGL_SCREEN_COUNT_MESA query. + + 7. 29 April 2005 - BrianP + Added EGLScreenMESA type and eglGetScreensMESA() function. [J. Smirl]. + Replaced EGLint screen_number parameters with EGLScreenMESA screen. + Added issue 17 (pixel-accurate panning) + + 8. 2 May 2005 - BrianP + Removed eglQueryDisplayMESA. + Fixed a few more EGLint -> EGLScreenMESA changes. + + 9. 20 May 2005 - BrianP + Fixed a few typos. + Updated some open issues text. + + 10. 10 August 2005 - BrianP + Added EGL_SCREEN_POSITION_GRANULARITY_MESA. + + 11. 27 January 2006 - BrianP + EGL_PHYSICAL_SIZE_MESA removed since EGL 1.2 has a similar feature. + --- mesa-7.9~git20100924.orig/src/mapi/glapi/gen/next_available_offset.sh +++ mesa-7.9~git20100924/src/mapi/glapi/gen/next_available_offset.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# 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 +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS 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: +# Ian Romanick + +# Trivial shell script to search the API definition file and print out the +# next numerically available API entry-point offset. This could probably +# be made smarter, but it would be better to use the existin Python +# framework to do that. This is just a quick-and-dirty hack. + +num=$(grep 'offset="' gl_API.xml |\ + sed 's/.\+ offset="//g;s/".*$//g' |\ + grep -v '?' |\ + sort -rn |\ + head -1) + +echo $((num + 1)) --- mesa-7.9~git20100924.orig/src/mapi/vgapi/SConscript +++ mesa-7.9~git20100924/src/mapi/vgapi/SConscript @@ -0,0 +1,56 @@ +####################################################################### +# SConscript for vgapi + +from sys import executable as python_cmd + +Import('*') + +if env['platform'] != 'winddk': + + env = env.Clone() + + vgapi_header = env.CodeGenerate( + target = '#src/mapi/vgapi/vgapi_tmp.h', + script = '../mapi/mapi_abi.py', + source = 'vgapi.csv', + command = python_cmd + ' $SCRIPT -i vgapi/vgapi_defines.h $SOURCE > $TARGET' + ) + + env.Append(CPPDEFINES = [ + 'MAPI_ABI_HEADER=\\"vgapi/vgapi_tmp.h\\"', + 'MAPI_DLL_EXPORTS', + 'KHRONOS_DLL_EXPORTS', + ]) + + env.Append(CPPPATH = [ + '#/include', + '#/src/mapi', + ]) + + mapi_sources = [ + 'entry.c', + 'mapi.c', + 'stub.c', + 'table.c', + 'u_current.c', + 'u_execmem.c', + 'u_thread.c', + ] + + vgapi_objects = [] + for s in mapi_sources: + o = env.SharedObject(s[:-2], '../mapi/' + s) + vgapi_objects.append(o) + + env.Depends(vgapi_objects, vgapi_header) + + openvg = env.SharedLibrary( + target = 'libOpenVG', + source = vgapi_objects, + ) + + env.InstallSharedLibrary(openvg, version=(1, 0, 0)) + + vgapi = [env.FindIxes(openvg, 'LIBPREFIX', 'LIBSUFFIX')] + + Export(['vgapi', 'vgapi_header']) --- mesa-7.9~git20100924.orig/src/driclient/src/XF86dri.c +++ mesa-7.9~git20100924/src/driclient/src/XF86dri.c @@ -0,0 +1,618 @@ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +All Rights Reserved. + +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, sub license, 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 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +/* THIS IS NOT AN X CONSORTIUM STANDARD */ + +#include +#include +#include +#include "xf86dristr.h" + +static XExtensionInfo _xf86dri_info_data; +static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; +static char xf86dri_extension_name[] = XF86DRINAME; + +#define XF86DRICheckExtension(dpy,i,val) \ + XextCheckExtension (dpy, i, xf86dri_extension_name, val) + +/***************************************************************************** + * * + * private utility routines * + * * + *****************************************************************************/ + +static int close_display(Display *dpy, XExtCodes *extCodes); +static /* const */ XExtensionHooks xf86dri_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + close_display, /* close_display */ + NULL, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86dri_info, + xf86dri_extension_name, + &xf86dri_extension_hooks, + 0, NULL) + +static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86dri_info) + + +/***************************************************************************** + * * + * public XFree86-DRI Extension routines * + * * + *****************************************************************************/ + +#if 0 +#include +#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg); +#else +#define TRACE(msg) +#endif + +#define PUBLIC + +PUBLIC Bool XF86DRIQueryExtension (dpy, event_basep, error_basep) + Display *dpy; + int *event_basep, *error_basep; +{ + XExtDisplayInfo *info = find_display (dpy); + + TRACE("QueryExtension..."); + if (XextHasExtension(info)) { + *event_basep = info->codes->first_event; + *error_basep = info->codes->first_error; + TRACE("QueryExtension... return True"); + return True; + } else { + TRACE("QueryExtension... return False"); + return False; + } +} + +PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) + Display* dpy; + int* majorVersion; + int* minorVersion; + int* patchVersion; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIQueryVersionReply rep; + xXF86DRIQueryVersionReq *req; + + TRACE("QueryVersion..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIQueryVersion; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return False"); + return False; + } + *majorVersion = rep.majorVersion; + *minorVersion = rep.minorVersion; + *patchVersion = rep.patchVersion; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return True"); + return True; +} + +PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable) + Display* dpy; + int screen; + Bool* isCapable; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIQueryDirectRenderingCapableReply rep; + xXF86DRIQueryDirectRenderingCapableReq *req; + + TRACE("QueryDirectRenderingCapable..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIQueryDirectRenderingCapable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIQueryDirectRenderingCapable; + req->screen = screen; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return False"); + return False; + } + *isCapable = rep.isCapable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return True"); + return True; +} + +PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString) + Display* dpy; + int screen; + drm_handle_t * hSAREA; + char **busIdString; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIOpenConnectionReply rep; + xXF86DRIOpenConnectionReq *req; + + TRACE("OpenConnection..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIOpenConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIOpenConnection; + req->screen = screen; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return False"); + return False; + } + + *hSAREA = rep.hSAREALow; + if (sizeof(drm_handle_t) == 8) { + int shift = 32; /* var to prevent warning on next line */ + *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; + } + + if (rep.length) { + if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) { + _XEatData(dpy, ((rep.busIdStringLength+3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return False"); + return False; + } + _XReadPad(dpy, *busIdString, rep.busIdStringLength); + } else { + *busIdString = NULL; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("OpenConnection... return True"); + return True; +} + +PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic) + Display* dpy; + int screen; + drm_magic_t magic; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIAuthConnectionReq *req; + xXF86DRIAuthConnectionReply rep; + + TRACE("AuthConnection..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIAuthConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIAuthConnection; + req->screen = screen; + req->magic = magic; + rep.authenticated = 0; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.authenticated) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return False"); + return False; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return True"); + return True; +} + +PUBLIC Bool XF86DRICloseConnection(dpy, screen) + Display* dpy; + int screen; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRICloseConnectionReq *req; + + TRACE("CloseConnection..."); + + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICloseConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICloseConnection; + req->screen = screen; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CloseConnection... return True"); + return True; +} + +PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, + ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName) + Display* dpy; + int screen; + int* ddxDriverMajorVersion; + int* ddxDriverMinorVersion; + int* ddxDriverPatchVersion; + char** clientDriverName; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIGetClientDriverNameReply rep; + xXF86DRIGetClientDriverNameReq *req; + + TRACE("GetClientDriverName..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetClientDriverName, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetClientDriverName; + req->screen = screen; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return False"); + return False; + } + + *ddxDriverMajorVersion = rep.ddxDriverMajorVersion; + *ddxDriverMinorVersion = rep.ddxDriverMinorVersion; + *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; + + if (rep.length) { + if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) { + _XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return False"); + return False; + } + _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength); + } else { + *clientDriverName = NULL; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetClientDriverName... return True"); + return True; +} + +PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context, + hHWContext) + Display* dpy; + int screen; + int configID; + XID* context; + drm_context_t * hHWContext; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRICreateContextReply rep; + xXF86DRICreateContextReq *req; + + TRACE("CreateContext..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICreateContext, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICreateContext; + req->visual = configID; + req->screen = screen; + *context = XAllocID(dpy); + req->context = *context; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateContext... return False"); + return False; + } + *hHWContext = rep.hHWContext; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateContext... return True"); + return True; +} + +PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext) + Display* dpy; + int screen; + Visual* visual; + XID* context; + drm_context_t * hHWContext; +{ + return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid, + context, hHWContext ); +} + +PUBLIC Bool XF86DRIDestroyContext( Display * ndpy, int screen, + XID context ) +{ + Display * const dpy = (Display *) ndpy; + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIDestroyContextReq *req; + + TRACE("DestroyContext..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIDestroyContext, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIDestroyContext; + req->screen = screen; + req->context = context; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("DestroyContext... return True"); + return True; +} + +PUBLIC Bool XF86DRICreateDrawable( Display * ndpy, int screen, + Drawable drawable, drm_drawable_t * hHWDrawable ) +{ + Display * const dpy = (Display *) ndpy; + XExtDisplayInfo *info = find_display (dpy); + xXF86DRICreateDrawableReply rep; + xXF86DRICreateDrawableReq *req; + + TRACE("CreateDrawable..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRICreateDrawable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRICreateDrawable; + req->screen = screen; + req->drawable = drawable; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateDrawable... return False"); + return False; + } + *hHWDrawable = rep.hHWDrawable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateDrawable... return True"); + return True; +} + +PUBLIC Bool XF86DRIDestroyDrawable( Display * ndpy, int screen, + Drawable drawable ) +{ + Display * const dpy = (Display *) ndpy; + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIDestroyDrawableReq *req; + + TRACE("DestroyDrawable..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIDestroyDrawable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIDestroyDrawable; + req->screen = screen; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("DestroyDrawable... return True"); + return True; +} + +PUBLIC Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable, + unsigned int* index, unsigned int* stamp, + int* X, int* Y, int* W, int* H, + int* numClipRects, drm_clip_rect_t ** pClipRects, + int* backX, int* backY, + int* numBackClipRects, drm_clip_rect_t ** pBackClipRects ) +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIGetDrawableInfoReply rep; + xXF86DRIGetDrawableInfoReq *req; + int total_rects; + + TRACE("GetDrawableInfo..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetDrawableInfo, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetDrawableInfo; + req->screen = screen; + req->drawable = drawable; + + if (!_XReply(dpy, (xReply *)&rep, 1, xFalse)) + { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return False"); + return False; + } + *index = rep.drawableTableIndex; + *stamp = rep.drawableTableStamp; + *X = (int)rep.drawableX; + *Y = (int)rep.drawableY; + *W = (int)rep.drawableWidth; + *H = (int)rep.drawableHeight; + *numClipRects = rep.numClipRects; + total_rects = *numClipRects; + + *backX = rep.backX; + *backY = rep.backY; + *numBackClipRects = rep.numBackClipRects; + total_rects += *numBackClipRects; + +#if 0 + /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks + * backwards compatibility (Because of the >> 2 shift) but the fix + * enables multi-threaded apps to work. + */ + if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - + SIZEOF(xGenericReply) + + total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) { + _XEatData(dpy, rep.length); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return False"); + return False; + } +#endif + + if (*numClipRects) { + int len = sizeof(drm_clip_rect_t) * (*numClipRects); + + *pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1); + if (*pClipRects) + _XRead(dpy, (char*)*pClipRects, len); + } else { + *pClipRects = NULL; + } + + if (*numBackClipRects) { + int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); + + *pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1); + if (*pBackClipRects) + _XRead(dpy, (char*)*pBackClipRects, len); + } else { + *pBackClipRects = NULL; + } + + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDrawableInfo... return True"); + return True; +} + +PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer, + fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate) + Display* dpy; + int screen; + drm_handle_t * hFrameBuffer; + int* fbOrigin; + int* fbSize; + int* fbStride; + int* devPrivateSize; + void** pDevPrivate; +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86DRIGetDeviceInfoReply rep; + xXF86DRIGetDeviceInfoReq *req; + + TRACE("GetDeviceInfo..."); + XF86DRICheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86DRIGetDeviceInfo, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_XF86DRIGetDeviceInfo; + req->screen = screen; + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return False"); + return False; + } + + *hFrameBuffer = rep.hFrameBufferLow; + if (sizeof(drm_handle_t) == 8) { + int shift = 32; /* var to prevent warning on next line */ + *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; + } + + *fbOrigin = rep.framebufferOrigin; + *fbSize = rep.framebufferSize; + *fbStride = rep.framebufferStride; + *devPrivateSize = rep.devPrivateSize; + + if (rep.length) { + if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) { + _XEatData(dpy, ((rep.devPrivateSize+3) & ~3)); + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return False"); + return False; + } + _XRead(dpy, (char*)*pDevPrivate, rep.devPrivateSize); + } else { + *pDevPrivate = NULL; + } + + UnlockDisplay(dpy); + SyncHandle(); + TRACE("GetDeviceInfo... return True"); + return True; +} + +PUBLIC Bool XF86DRIOpenFullScreen(dpy, screen, drawable) + Display* dpy; + int screen; + Drawable drawable; +{ + /* This function and the underlying X protocol are deprecated. + */ + (void) dpy; + (void) screen; + (void) drawable; + return False; +} + +PUBLIC Bool XF86DRICloseFullScreen(dpy, screen, drawable) + Display* dpy; + int screen; + Drawable drawable; +{ + /* This function and the underlying X protocol are deprecated. + */ + (void) dpy; + (void) screen; + (void) drawable; + return True; +} + --- mesa-7.9~git20100924.orig/src/gallium/README.portability +++ mesa-7.9~git20100924/src/gallium/README.portability @@ -0,0 +1,109 @@ + CROSS-PLATFORM PORTABILITY GUIDELINES FOR GALLIUM3D + + += General Considerations = + +The state tracker and winsys driver support a rather limited number of +platforms. However, the pipe drivers are meant to run in a wide number of +platforms. Hence the pipe drivers, the auxiliary modules, and all public +headers in general, should strictly follow these guidelines to ensure + + += Compiler Support = + +* Include the p_compiler.h. + +* Don't use the 'inline' keyword, use the INLINE macro in p_compiler.h instead. + +* Cast explicitly when converting to integer types of smaller sizes. + +* Cast explicitly when converting between float, double and integral types. + +* Don't use named struct initializers. + +* Don't use variable number of macro arguments. Use static inline functions +instead. + +* Don't use C99 features. + += Standard Library = + +* Avoid including standard library headers. Most standard library functions are +not available in Windows Kernel Mode. Use the appropriate p_*.h include. + +== Memory Allocation == + +* Use MALLOC, CALLOC, FREE instead of the malloc, calloc, free functions. + +* Use align_pointer() function defined in u_memory.h for aligning pointers + in a portable way. + +== Debugging == + +* Use the functions/macros in p_debug.h. + +* Don't include assert.h, call abort, printf, etc. + + += Code Style = + +== Inherantice in C == + +The main thing we do is mimic inheritance by structure containment. + +Here's a silly made-up example: + +/* base class */ +struct buffer +{ + int size; + void (*validate)(struct buffer *buf); +}; + +/* sub-class of bufffer */ +struct texture_buffer +{ + struct buffer base; /* the base class, MUST COME FIRST! */ + int format; + int width, height; +}; + + +Then, we'll typically have cast-wrapper functions to convert base-class +pointers to sub-class pointers where needed: + +static inline struct vertex_buffer *vertex_buffer(struct buffer *buf) +{ + return (struct vertex_buffer *) buf; +} + + +To create/init a sub-classed object: + +struct buffer *create_texture_buffer(int w, int h, int format) +{ + struct texture_buffer *t = malloc(sizeof(*t)); + t->format = format; + t->width = w; + t->height = h; + t->base.size = w * h; + t->base.validate = tex_validate; + return &t->base; +} + +Example sub-class method: + +void tex_validate(struct buffer *buf) +{ + struct texture_buffer *tb = texture_buffer(buf); + assert(tb->format); + assert(tb->width); + assert(tb->height); +} + + +Note that we typically do not use typedefs to make "class names"; we use +'struct whatever' everywhere. + +Gallium's pipe_context and the subclassed psb_context, etc are prime examples +of this. There's also many examples in Mesa and the Mesa state tracker. --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/add.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/add.txt @@ -0,0 +1,23 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE LINE_STRIP +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT + +MOV OUT[0], IN[0][0] +ADD OUT[1], IN[0][1], IN[0][1] +EMIT + +MOV OUT[0], IN[1][0] +ADD OUT[1], IN[1][1], IN[1][1] +EMIT + +MOV OUT[0], IN[2][0] +ADD OUT[1], IN[2][1], IN[2][1] +EMIT + +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/line.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/line.txt @@ -0,0 +1,28 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE LINE_STRIP +PROPERTY GS_MAX_OUTPUT_VERTICES 4 +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT + +MOV OUT[0], IN[0][0] +MOV OUT[1], IN[0][1] +EMIT + +MOV OUT[0], IN[1][0] +MOV OUT[1], IN[0][1] +EMIT + +MOV OUT[0], IN[2][0] +MOV OUT[1], IN[2][1] +EMIT + +MOV OUT[0], IN[0][0] +MOV OUT[1], IN[0][1] +EMIT + +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/mov.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/mov.txt @@ -0,0 +1,23 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE TRIANGLE_STRIP +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT + +MOV OUT[0], IN[0][0] +MOV OUT[1], IN[0][1] +EMIT + +MOV OUT[0], IN[1][0] +MOV OUT[1], IN[1][1] +EMIT + +MOV OUT[0], IN[2][0] +MOV OUT[1], IN[2][1] +EMIT + +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/add-mix.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/add-mix.txt @@ -0,0 +1,23 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE TRIANGLE_STRIP +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT + +MOV OUT[0], IN[0][0] +ADD OUT[1], IN[0][1], IN[1][1] +EMIT + +MOV OUT[0], IN[1][0] +ADD OUT[1], IN[1][1], IN[2][1] +EMIT + +MOV OUT[0], IN[2][0] +ADD OUT[1], IN[2][1], IN[0][1] +EMIT + +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/multi-line.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/multi-line.txt @@ -0,0 +1,42 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE LINE_STRIP +PROPERTY GS_MAX_OUTPUT_VERTICES 8 +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT +DCL TEMP[0] + +MOV TEMP[0], IN[0][0] +ADD TEMP[0].y, IN[0][0], IN[1][0] + +MOV OUT[0], TEMP[0] +MOV OUT[1], IN[0][1] +EMIT +MOV OUT[0], IN[2][0] +MOV OUT[1], IN[0][1] +EMIT +MOV OUT[0], IN[0][0] +MOV OUT[1], IN[2][1] +EMIT +MOV OUT[0], TEMP[0] +MOV OUT[1], IN[0][1] +EMIT +ENDPRIM + +MOV OUT[0], TEMP[0] +MOV OUT[1], IN[0][1] +EMIT +MOV OUT[0], IN[2][0] +MOV OUT[1], IN[0][1] +EMIT +MOV OUT[0], IN[1][0] +MOV OUT[1], IN[2][1] +EMIT +MOV OUT[0], TEMP[0] +MOV OUT[1], IN[0][1] +EMIT +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/graw/geometry-shader/mov-cb-2d.txt +++ mesa-7.9~git20100924/src/gallium/tests/graw/geometry-shader/mov-cb-2d.txt @@ -0,0 +1,24 @@ +GEOM +PROPERTY GS_INPUT_PRIMITIVE TRIANGLES +PROPERTY GS_OUTPUT_PRIMITIVE TRIANGLE_STRIP +DCL IN[][0], POSITION, CONSTANT +DCL IN[][1], COLOR, CONSTANT +DCL OUT[0], POSITION, CONSTANT +DCL OUT[1], COLOR, CONSTANT +DCL CONST[1][0..6] + +MOV OUT[0], IN[0][0] +MOV OUT[1], CONST[1][0] +EMIT + +MOV OUT[0], IN[1][0] +MOV OUT[1], CONST[1][1] +EMIT + +MOV OUT[0], IN[2][0] +MOV OUT[1], CONST[1][4] +EMIT + +ENDPRIM + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-mad.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-mad.sh @@ -0,0 +1,14 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.5, 1.0, 1.0, 1.0 } +IMM FLT32 { 0.5, 0.0, 0.0, 0.0 } + +MAD OUT[0], IN[0], IMM[0], IMM[1] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-lit.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-lit.sh @@ -0,0 +1,11 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0], IN[0] +LIT OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-absneg.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-absneg.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL TEMP[0] + +IMM FLT32 { -0.2, -0.2, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +MOV OUT[0].xy, -|TEMP[0]| +MOV OUT[0].zw, IN[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-min.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-min.sh @@ -0,0 +1,13 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.5, 0.5, 0.5, 0.0 } + +MOV OUT[0], IN[0] +MIN OUT[1], IN[1], IMM[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-arl.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-arl.sh @@ -0,0 +1,23 @@ +VERT + +DCL IN[0] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +DCL ADDR[0] + +IMM FLT32 { 3.0, 1.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 0.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 0.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 1.0, 1.0 } + +MOV OUT[0], IN[0] +MUL TEMP[0], IN[0], IMM[0] +ARL ADDR[0].x, TEMP[0] +MOV OUT[1], IMM[ADDR[0].x + 3] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-ex2.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-ex2.sh @@ -0,0 +1,18 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0..1] + +IMM FLT32 { 0.3, 0.3, 0.3, 1.0 } + +EX2 TEMP[0], IN[0] +EX2 TEMP[1], IN[1].yyyy +MUL TEMP[0], TEMP[0], IMM[0] +MOV OUT[0], IN[0] +MUL OUT[1], TEMP[0], TEMP[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-slt.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-slt.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { 0.6, 0.6, 0.0, 0.0 } + +SLT TEMP[0], IN[0], IMM[0] +MOV OUT[0], IN[0] +MUL OUT[1], IN[1], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-mul.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-mul.sh @@ -0,0 +1,13 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.6, 0.6, 1.0, 1.0 } + +MUL OUT[0], IN[0], IMM[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-swz.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-swz.sh @@ -0,0 +1,11 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0], IN[0].yxzw +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-arr.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-arr.sh @@ -0,0 +1,23 @@ +VERT + +DCL IN[0] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +DCL ADDR[0] + +IMM FLT32 { 3.0, 1.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 0.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 0.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 1.0, 1.0 } + +MOV OUT[0], IN[0] +MUL TEMP[0], IN[0], IMM[0] +ARR ADDR[0].x, TEMP[0] +MOV OUT[1], IMM[ADDR[0].x + 3] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-flr.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-flr.sh @@ -0,0 +1,23 @@ +VERT + +DCL IN[0] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +DCL ADDR[0] + +IMM FLT32 { 3.0, 1.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 0.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 0.0, 1.0, 1.0 } +IMM FLT32 { 1.0, 1.0, 0.0, 1.0 } +IMM FLT32 { 0.0, 1.0, 1.0, 1.0 } + +MOV OUT[0], IN[0] +MUL TEMP[0], IN[0], IMM[0] +FLR ADDR[0].x, TEMP[0] +MOV OUT[1], IMM[ADDR[0].x + 3] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-xpd.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-xpd.sh @@ -0,0 +1,11 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0], IN[0] +XPD OUT[1], IN[0], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-abs.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-abs.sh @@ -0,0 +1,15 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL TEMP[0] + +IMM FLT32 { 0.2, 0.2, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +ABS OUT[0], TEMP[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-dp4.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-dp4.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL TEMP[0] + +IMM FLT32 { 0.0, 0.0, 1.0, 1.0 } + +DP4 TEMP[0].xy, IN[0], IN[0] +MOV TEMP[0].zw, IMM[0] +MUL OUT[0], IN[0], TEMP[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-max.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-max.sh @@ -0,0 +1,13 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.5, 0.5, 0.5, 0.0 } + +MOV OUT[0], IN[0] +MAX OUT[1], IN[1], IMM[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-rsq.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-rsq.sh @@ -0,0 +1,18 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 1.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +RSQ TEMP[0].x, TEMP[0].xxxx +SUB OUT[0], TEMP[0], IMM[1] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-sub.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-sub.sh @@ -0,0 +1,13 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.1, 0.1, 0.0, 0.0 } + +SUB OUT[0], IN[0], IMM[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-rcp.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-rcp.sh @@ -0,0 +1,18 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 1.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +RCP TEMP[0].x, TEMP[0].xxxx +SUB OUT[0], TEMP[0], IMM[1] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-dst.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-dst.sh @@ -0,0 +1,11 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0], IN[0] +DST OUT[1], IN[1], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-sge.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-sge.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { -0.1, -0.1, 1.0, 0.0 } + +SGE TEMP[0], IN[0], IMM[0] +MOV OUT[0], IN[0] +MUL OUT[1], IN[1], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-abs.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-abs.sh @@ -0,0 +1,15 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL TEMP[0] + +IMM FLT32 { 0.1, 0.1, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +MOV OUT[0], |TEMP[0]| +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-dp3.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-dp3.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL TEMP[0] + +IMM FLT32 { 0.0, 0.0, 1.0, 1.0 } + +DP3 TEMP[0].xy, IN[0], IN[0] +MOV TEMP[0].zw, IMM[0] +MUL OUT[0], IN[0], TEMP[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-lrp.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-lrp.sh @@ -0,0 +1,14 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +ABS TEMP[0], IN[0] +MOV OUT[0], IN[0] +LRP OUT[1], TEMP[0], IN[1].xxxx, IN[1].yyyy + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-neg.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-srcmod-neg.sh @@ -0,0 +1,12 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0].xy, -IN[0] +MOV OUT[0].zw, IN[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-add.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-add.sh @@ -0,0 +1,13 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +IMM FLT32 { 0.2, -0.1, 0.0, 0.0 } + +ADD OUT[0], IN[0], IMM[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-cb-2d.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-cb-2d.sh @@ -0,0 +1,12 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL CONST[1][1..2] + +MOV OUT[0], IN[0] +MAD OUT[1], IN[1], CONST[1][2], CONST[1][1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vertex-shader.py +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vertex-shader.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python +########################################################################## +# +# Copyright 2009 VMware, Inc. +# All Rights Reserved. +# +# 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, sub license, 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 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 NON-INFRINGEMENT. +# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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. +# +########################################################################## + + +import struct + +from gallium import * + +def make_image(surface): + data = surface.get_tile_rgba8(0, 0, surface.width, surface.height) + + import Image + outimage = Image.fromstring('RGBA', (surface.width, surface.height), data, "raw", 'RGBA', 0, 1) + return outimage + +def save_image(filename, surface): + outimage = make_image(surface) + outimage.save(filename, "PNG") + +def test(dev, name): + ctx = dev.context_create() + + width = 320 + height = 320 + minz = 0.0 + maxz = 1.0 + + # disabled blending/masking + blend = Blend() + blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE + blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE + blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO + blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO + blend.rt[0].colormask = PIPE_MASK_RGBA + ctx.set_blend(blend) + + # depth/stencil/alpha + depth_stencil_alpha = DepthStencilAlpha() + depth_stencil_alpha.depth.enabled = 0 + depth_stencil_alpha.depth.writemask = 1 + depth_stencil_alpha.depth.func = PIPE_FUNC_LESS + ctx.set_depth_stencil_alpha(depth_stencil_alpha) + + # rasterizer + rasterizer = Rasterizer() + rasterizer.front_winding = PIPE_WINDING_CW + rasterizer.cull_mode = PIPE_WINDING_NONE + rasterizer.scissor = 1 + ctx.set_rasterizer(rasterizer) + + # viewport + viewport = Viewport() + scale = FloatArray(4) + scale[0] = width / 2.0 + scale[1] = -height / 2.0 + scale[2] = (maxz - minz) / 2.0 + scale[3] = 1.0 + viewport.scale = scale + translate = FloatArray(4) + translate[0] = width / 2.0 + translate[1] = height / 2.0 + translate[2] = (maxz - minz) / 2.0 + translate[3] = 0.0 + viewport.translate = translate + ctx.set_viewport(viewport) + + # samplers + sampler = Sampler() + sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE + sampler.min_img_filter = PIPE_TEX_MIPFILTER_NEAREST + sampler.mag_img_filter = PIPE_TEX_MIPFILTER_NEAREST + sampler.normalized_coords = 1 + ctx.set_fragment_sampler(0, sampler) + + # scissor + scissor = Scissor() + scissor.minx = 0 + scissor.miny = 0 + scissor.maxx = width + scissor.maxy = height + ctx.set_scissor(scissor) + + clip = Clip() + clip.nr = 0 + ctx.set_clip(clip) + + # framebuffer + cbuf = dev.resource_create( + PIPE_FORMAT_B8G8R8X8_UNORM, + width, height, + bind=PIPE_BIND_RENDER_TARGET, + ).get_surface() + fb = Framebuffer() + fb.width = width + fb.height = height + fb.nr_cbufs = 1 + fb.set_cbuf(0, cbuf) + ctx.set_framebuffer(fb) + rgba = FloatArray(4); + rgba[0] = 0.5 + rgba[1] = 0.5 + rgba[2] = 0.5 + rgba[3] = 0.5 + ctx.clear(PIPE_CLEAR_COLOR, rgba, 0.0, 0) + + # vertex shader + vs = Shader(file('vert-' + name + '.sh', 'rt').read()) + ctx.set_vertex_shader(vs) + + # fragment shader + fs = Shader(''' + FRAG + DCL IN[0], COLOR, LINEAR + DCL OUT[0], COLOR, CONSTANT + 0:MOV OUT[0], IN[0] + 1:END + ''') + ctx.set_fragment_shader(fs) + + constbuf0 = dev.buffer_create(64, + (PIPE_BUFFER_USAGE_CONSTANT | + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE), + 4 * 4 * 4) + + cbdata = '' + cbdata += struct.pack('4f', 0.4, 0.0, 0.0, 1.0) + cbdata += struct.pack('4f', 1.0, 1.0, 1.0, 1.0) + cbdata += struct.pack('4f', 2.0, 2.0, 2.0, 2.0) + cbdata += struct.pack('4f', 4.0, 8.0, 16.0, 32.0) + + constbuf0.write(cbdata, 0) + + ctx.set_constant_buffer(PIPE_SHADER_VERTEX, + 0, + constbuf0) + + constbuf1 = dev.buffer_create(64, + (PIPE_BUFFER_USAGE_CONSTANT | + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE), + 4 * 4 * 4) + + cbdata = '' + cbdata += struct.pack('4f', 0.1, 0.1, 0.1, 0.1) + cbdata += struct.pack('4f', 0.25, 0.25, 0.25, 0.25) + cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5) + cbdata += struct.pack('4f', 0.75, 0.75, 0.75, 0.75) + + constbuf1.write(cbdata, 0) + + ctx.set_constant_buffer(PIPE_SHADER_VERTEX, + 1, + constbuf1) + + xy = [ + 0.0, 0.8, + -0.2, 0.4, + 0.2, 0.4, + -0.4, 0.0, + 0.0, 0.0, + 0.4, 0.0, + -0.6, -0.4, + -0.2, -0.4, + 0.2, -0.4, + 0.6, -0.4, + -0.8, -0.8, + -0.4, -0.8, + 0.0, -0.8, + 0.4, -0.8, + 0.8, -0.8, + ] + color = [ + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + ] + tri = [ + 1, 2, 0, + 3, 4, 1, + 4, 2, 1, + 4, 5, 2, + 6, 7, 3, + 7, 4, 3, + 7, 8, 4, + 8, 5, 4, + 8, 9, 5, + 10, 11, 6, + 11, 7, 6, + 11, 12, 7, + 12, 8, 7, + 12, 13, 8, + 13, 9, 8, + 13, 14, 9, + ] + + nverts = 16 * 3 + nattrs = 2 + verts = FloatArray(nverts * nattrs * 4) + + for i in range(0, nverts): + verts[i * nattrs * 4 + 0] = xy[tri[i] * 2 + 0] # x + verts[i * nattrs * 4 + 1] = xy[tri[i] * 2 + 1] # y + verts[i * nattrs * 4 + 2] = 0.5 # z + verts[i * nattrs * 4 + 3] = 1.0 # w + verts[i * nattrs * 4 + 4] = color[(i % 3) * 3 + 0] # r + verts[i * nattrs * 4 + 5] = color[(i % 3) * 3 + 1] # g + verts[i * nattrs * 4 + 6] = color[(i % 3) * 3 + 2] # b + verts[i * nattrs * 4 + 7] = 1.0 # a + + ctx.draw_vertices(PIPE_PRIM_TRIANGLES, + nverts, + nattrs, + verts) + + ctx.flush() + + save_image('vert-' + name + '.png', cbuf) + +def main(): + tests = [ + 'abs', + 'add', + 'arl', + 'arr', + 'cb-1d', + 'cb-2d', + 'dp3', + 'dp4', + 'dst', + 'ex2', + 'flr', + 'frc', + 'lg2', + 'lit', + 'lrp', + 'mad', + 'max', + 'min', + 'mov', + 'mul', + 'rcp', + 'rsq', + 'sge', + 'slt', + 'srcmod-abs', + 'srcmod-absneg', + 'srcmod-neg', + 'srcmod-swz', + 'sub', + 'xpd', + ] + + dev = Device() + for t in tests: + test(dev, t) + +if __name__ == '__main__': + main() --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-mov.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-mov.sh @@ -0,0 +1,11 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +MOV OUT[0], IN[0] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-frc.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-frc.sh @@ -0,0 +1,15 @@ +VERT + +DCL IN[0] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { 2.7, 3.1, 4.5, 1.0 } + +MUL TEMP[0], IN[0].xyxw, IMM[0] +MOV OUT[0], IN[0] +FRC OUT[1], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-cb-1d.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-cb-1d.sh @@ -0,0 +1,16 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR +DCL CONST[1] +DCL CONST[3] +DCL TEMP[0..1] + +MOV OUT[0], IN[0] +ADD TEMP[0], IN[1], CONST[1] +RCP TEMP[1], CONST[3].xxxx +MUL OUT[1], TEMP[0], TEMP[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/vertex-shader/vert-lg2.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/vertex-shader/vert-lg2.sh @@ -0,0 +1,18 @@ +VERT + +DCL IN[0] +DCL IN[1] +DCL OUT[0], POSITION +DCL OUT[1], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 0.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +LG2 TEMP[0].x, TEMP[0].xxxx +ADD OUT[0], TEMP[0], IMM[1] +MOV OUT[1], IN[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-max.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-max.sh @@ -0,0 +1,10 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +IMM FLT32 { 0.4, 0.4, 0.4, 0.0 } + +MAX OUT[0], IN[0], IMM[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-slt.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-slt.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 0.6, 0.6, 0.6, 0.0 } + +SLT TEMP[0], IN[0], IMM[0] +MUL OUT[0], IN[0], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-kil.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-kil.sh @@ -0,0 +1,18 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 0.6, 0.6, 0.6, 0.0 } +IMM FLT32 { 0.01, 0.0, 0.0, 0.0 } +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } + +SLT TEMP[0], IN[0], IMM[0] +MUL OUT[0], IN[0], TEMP[0] +MOV OUT[0].w, IMM[2].xxxx +SUB TEMP[0], TEMP[0], IMM[1].xxxy +KIL TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-abs.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-abs.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { -0.3, -0.5, -0.4, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +MOV OUT[0], |TEMP[0]| + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-rcp.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-rcp.sh @@ -0,0 +1,15 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 1.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +RCP TEMP[0].x, TEMP[0].xxxx +SUB OUT[0], TEMP[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-lrp.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-lrp.sh @@ -0,0 +1,11 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +ABS TEMP[0], IN[0] +LRP OUT[0], TEMP[0], IN[0].xxxx, IN[0].yyyy + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-dst.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-dst.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DST OUT[0], IN[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-ex2.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-ex2.sh @@ -0,0 +1,11 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +EX2 TEMP[0], IN[0].xxxx +MUL OUT[0], TEMP[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-abs.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-abs.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { -0.5, -0.4, -0.6, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +ABS OUT[0], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-rsq.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-rsq.sh @@ -0,0 +1,15 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 1.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +RSQ TEMP[0].x, TEMP[0].xxxx +SUB OUT[0], TEMP[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-min.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-min.sh @@ -0,0 +1,10 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +IMM FLT32 { 0.6, 0.6, 0.6, 1.0 } + +MIN OUT[0], IN[0], IMM[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-cb-2d.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-cb-2d.sh @@ -0,0 +1,9 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR +DCL CONST[1][6] + +MOV OUT[0], CONST[1][6] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-swz.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-swz.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +MOV OUT[0], IN[0].yxzw + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-lit.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-lit.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +LIT OUT[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-dp4.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-dp4.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DP4 OUT[0], IN[0].xyzx, IN[0].xyzx + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-frc.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-frc.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 2.7, 3.1, 4.5, 1.0 } + +MUL TEMP[0], IN[0], IMM[0] +FRC OUT[0], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-sub.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-sub.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +SUB OUT[0], IN[0], IN[0].yzxw + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-lg2.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-lg2.sh @@ -0,0 +1,15 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 1.0, 0.0, 0.0, 0.0 } +IMM FLT32 { 0.5, 0.0, 0.0, 0.0 } + +ADD TEMP[0], IN[0], IMM[0] +LG2 TEMP[0].x, TEMP[0].xxxx +ADD OUT[0], TEMP[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-mov.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-mov.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +MOV OUT[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-mad.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-mad.sh @@ -0,0 +1,11 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +IMM FLT32 { 0.5, 0.4, 0.6, 1.0 } +IMM FLT32 { 0.5, 0.4, 0.6, 0.0 } + +MAD OUT[0], IN[0], IMM[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-neg.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-neg.sh @@ -0,0 +1,11 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +SUB TEMP[0], IN[0], IN[0].yzxw +MOV OUT[0], -TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-xpd.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-xpd.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +XPD OUT[0], IN[0], IN[0].yzxw + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-dp3.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-dp3.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DP3 OUT[0], IN[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-mul.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-mul.sh @@ -0,0 +1,10 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +IMM FLT32 { 0.5, 0.6, 0.7, 1.0 } + +MUL OUT[0], IN[0], IMM[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-mad-immx.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-mad-immx.sh @@ -0,0 +1,10 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR +DCL IMMX[0..1] {{ 0.5, 0.4, 0.6, 1.0 }, + { 0.5, 0.4, 0.6, 0.0 }} + +MAD OUT[0], IN[0], IMMX[0], IMMX[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-absneg.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-srcmod-absneg.sh @@ -0,0 +1,15 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { -0.2, -0.3, -0.4, 0.0 } +IMM FLT32 { -1.0, -1.0, -1.0, -1.0 } + +ADD TEMP[0], IN[0], IMM[0] +MOV TEMP[0], -|TEMP[0]| +MUL OUT[0], TEMP[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/fragment-shader.py +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/fragment-shader.py @@ -0,0 +1,257 @@ +#!/usr/bin/env python +########################################################################## +# +# Copyright 2009 VMware, Inc. +# All Rights Reserved. +# +# 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, sub license, 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 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 NON-INFRINGEMENT. +# IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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. +# +########################################################################## + +import struct + +from gallium import * + +def make_image(surface): + data = surface.get_tile_rgba8(0, 0, surface.width, surface.height) + + import Image + outimage = Image.fromstring('RGBA', (surface.width, surface.height), data, "raw", 'RGBA', 0, 1) + return outimage + +def save_image(filename, surface): + outimage = make_image(surface) + outimage.save(filename, "PNG") + +def test(dev, name): + ctx = dev.context_create() + + width = 320 + height = 320 + minz = 0.0 + maxz = 1.0 + + # disabled blending/masking + blend = Blend() + blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE + blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE + blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO + blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO + blend.rt[0].colormask = PIPE_MASK_RGBA + ctx.set_blend(blend) + + # depth/stencil/alpha + depth_stencil_alpha = DepthStencilAlpha() + depth_stencil_alpha.depth.enabled = 0 + depth_stencil_alpha.depth.writemask = 1 + depth_stencil_alpha.depth.func = PIPE_FUNC_LESS + ctx.set_depth_stencil_alpha(depth_stencil_alpha) + + # rasterizer + rasterizer = Rasterizer() + rasterizer.front_winding = PIPE_WINDING_CW + rasterizer.cull_mode = PIPE_WINDING_NONE + rasterizer.scissor = 1 + ctx.set_rasterizer(rasterizer) + + # viewport + viewport = Viewport() + scale = FloatArray(4) + scale[0] = width / 2.0 + scale[1] = -height / 2.0 + scale[2] = (maxz - minz) / 2.0 + scale[3] = 1.0 + viewport.scale = scale + translate = FloatArray(4) + translate[0] = width / 2.0 + translate[1] = height / 2.0 + translate[2] = (maxz - minz) / 2.0 + translate[3] = 0.0 + viewport.translate = translate + ctx.set_viewport(viewport) + + # samplers + sampler = Sampler() + sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE + sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE + sampler.min_img_filter = PIPE_TEX_MIPFILTER_NEAREST + sampler.mag_img_filter = PIPE_TEX_MIPFILTER_NEAREST + sampler.normalized_coords = 1 + ctx.set_fragment_sampler(0, sampler) + + # scissor + scissor = Scissor() + scissor.minx = 0 + scissor.miny = 0 + scissor.maxx = width + scissor.maxy = height + ctx.set_scissor(scissor) + + clip = Clip() + clip.nr = 0 + ctx.set_clip(clip) + + # framebuffer + cbuf = dev.resource_create( + PIPE_FORMAT_B8G8R8X8_UNORM, + width, height, + bind=PIPE_BIND_RENDER_TARGET, + ).get_surface() + fb = Framebuffer() + fb.width = width + fb.height = height + fb.nr_cbufs = 1 + fb.set_cbuf(0, cbuf) + ctx.set_framebuffer(fb) + rgba = FloatArray(4); + rgba[0] = 0.5 + rgba[1] = 0.5 + rgba[2] = 0.5 + rgba[3] = 0.5 + ctx.clear(PIPE_CLEAR_COLOR, rgba, 0.0, 0) + + # vertex shader + vs = Shader(''' + VERT + DCL IN[0], POSITION + DCL IN[1], COLOR + DCL OUT[0], POSITION + DCL OUT[1], COLOR + MOV OUT[0], IN[0] + MOV OUT[1], IN[1] + END + ''') + ctx.set_vertex_shader(vs) + + # fragment shader + fs = Shader(file('frag-' + name + '.sh', 'rt').read()) + ctx.set_fragment_shader(fs) + + constbuf0 = dev.buffer_create(64, + (PIPE_BUFFER_USAGE_CONSTANT | + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE), + 4 * 4 * 4) + + cbdata = '' + cbdata += struct.pack('4f', 0.4, 0.0, 0.0, 1.0) + cbdata += struct.pack('4f', 1.0, 1.0, 1.0, 1.0) + cbdata += struct.pack('4f', 2.0, 2.0, 2.0, 2.0) + cbdata += struct.pack('4f', 4.0, 8.0, 16.0, 32.0) + + constbuf0.write(cbdata, 0) + + ctx.set_constant_buffer(PIPE_SHADER_FRAGMENT, + 0, + constbuf0) + + constbuf1 = dev.buffer_create(64, + (PIPE_BUFFER_USAGE_CONSTANT | + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE), + 4 * 4 * 4) + + cbdata = '' + cbdata += struct.pack('4f', 0.1, 0.1, 0.1, 0.1) + cbdata += struct.pack('4f', 0.25, 0.25, 0.25, 0.25) + cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5) + cbdata += struct.pack('4f', 0.75, 0.75, 0.75, 0.75) + + constbuf1.write(cbdata, 0) + + ctx.set_constant_buffer(PIPE_SHADER_FRAGMENT, + 1, + constbuf1) + + xy = [ + -0.8, -0.8, + 0.8, -0.8, + 0.0, 0.8, + ] + color = [ + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + ] + + nverts = 3 + nattrs = 2 + verts = FloatArray(nverts * nattrs * 4) + + for i in range(0, nverts): + verts[i * nattrs * 4 + 0] = xy[i * 2 + 0] # x + verts[i * nattrs * 4 + 1] = xy[i * 2 + 1] # y + verts[i * nattrs * 4 + 2] = 0.5 # z + verts[i * nattrs * 4 + 3] = 1.0 # w + verts[i * nattrs * 4 + 4] = color[i * 3 + 0] # r + verts[i * nattrs * 4 + 5] = color[i * 3 + 1] # g + verts[i * nattrs * 4 + 6] = color[i * 3 + 2] # b + verts[i * nattrs * 4 + 7] = 1.0 # a + + ctx.draw_vertices(PIPE_PRIM_TRIANGLES, + nverts, + nattrs, + verts) + + ctx.flush() + + save_image('frag-' + name + '.png', cbuf) + +def main(): + tests = [ + 'abs', + 'add', + 'cb-1d', + 'cb-2d', + 'dp3', + 'dp4', + 'dst', + 'ex2', + 'flr', + 'frc', + 'lg2', + 'lit', + 'lrp', + 'mad', + 'max', + 'min', + 'mov', + 'mul', + 'rcp', + 'rsq', + 'sge', + 'slt', + 'srcmod-abs', + 'srcmod-absneg', + 'srcmod-neg', + 'srcmod-swz', + 'sub', + 'xpd', + ] + + dev = Device() + for t in tests: + test(dev, t) + +if __name__ == '__main__': + main() --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-flr.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-flr.sh @@ -0,0 +1,15 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 2.5, 4.0, 2.0, 1.0 } +IMM FLT32 { 0.4, 0.25, 0.5, 1.0 } + +MUL TEMP[0], IN[0], IMM[0] +FLR TEMP[0], TEMP[0] +MUL OUT[0], TEMP[0], IMM[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-cb-1d.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-cb-1d.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR +DCL CONST[1] +DCL CONST[3] +DCL TEMP[0..1] + +ADD TEMP[0], IN[0], CONST[1] +RCP TEMP[1], CONST[3].xxxx +MUL OUT[0], TEMP[0], TEMP[1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-sge.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-sge.sh @@ -0,0 +1,13 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMP[0] + +IMM FLT32 { 0.6, 0.6, 0.6, 0.0 } + +SGE TEMP[0], IN[0], IMM[0] +MUL OUT[0], IN[0], TEMP[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-tempx.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-tempx.sh @@ -0,0 +1,14 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +DCL TEMPX[0][0..1] + +IMM FLT32 { -0.5, -0.4, -0.6, 0.0 } + +ADD TEMPX[0][0], IN[0], IMM[0] +ADD TEMPX[0][1], IN[0], IMM[0] +ABS OUT[0], TEMPX[0][1] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/tests/regress/fragment-shader/frag-add.sh +++ mesa-7.9~git20100924/src/gallium/tests/python/tests/regress/fragment-shader/frag-add.sh @@ -0,0 +1,8 @@ +FRAG + +DCL IN[0], COLOR, LINEAR +DCL OUT[0], COLOR + +ADD OUT[0], IN[0], IN[0] + +END --- mesa-7.9~git20100924.orig/src/gallium/tests/python/retrace/README +++ mesa-7.9~git20100924/src/gallium/tests/python/retrace/README @@ -0,0 +1,17 @@ +This is an application written in python to replay the traces captured by the + trace pipe driver. + + +To use it follow the instructions in src/gallium/drivers/trace/README and +src/gallium/state_trackers/python/README, and then do + + python src/gallium/state_trackers/python/samples/retrace/interpreter.py filename.trace + + +This is still work in progress: +- not everything is captured/replayed + - surface/textures contents +- any tiny error will result in a crash + +-- +Jose Fonseca --- mesa-7.9~git20100924.orig/src/gallium/tools/addr2line.sh +++ mesa-7.9~git20100924/src/gallium/tools/addr2line.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# This script processes symbols output by Gallium using glibc to human-readable function names + +lastbin= +i=-1 +dir="$(mktemp -d)" +input="$1" + +# Gather all unique addresses for each binary +sed -nre 's|([^ ]*/[^ ]*)\(\+0x([^)]*).*|\1 \2|p' "$input"|sort|uniq|while read bin addr; do + if test "$lastbin" != "$bin"; then + ((++i)) + lastbin="$bin" + echo "$bin" > "$dir/$i.addrs.bin" + fi + echo "$addr" >> "$dir/$i.addrs" +done + +# Construct a sed script to convert hex address to human readable form, and apply it +for i in "$dir"/*.addrs; do + bin="$(<"$i.bin")" + addr2line -p -e "$bin" -a -f < "$i"|sed -nre 's@^0x0*([^:]*): ([^?]*)$@s|'"$bin"'(+0x\1)|\2|g@gp' + rm -f "$i" "$i.bin" +done|sed -f - "$input" + +rmdir "$dir" --- mesa-7.9~git20100924.orig/src/gallium/auxiliary/rbug/README +++ mesa-7.9~git20100924/src/gallium/auxiliary/rbug/README @@ -0,0 +1,25 @@ + GALLIUM REMOTE DEBUGGING COMMON CODE + += About = + +This directory contains the common code for the Gallium 3D remote debugging +driver and clients. The code is two parts the connection managment code and +the (de)marsheller. + +The code currently uses tcp and ip4v for connections. + +Information about driver integration can be found in: + +src/gallium/drivers/rbug/README + +for information about applications look in: + +progs/rbug/README + +for a GUI see: + + http://cgit.freedesktop.org/mesa/rbug-gui + + +-- +Jakob Bornecrantz --- mesa-7.9~git20100924.orig/src/gallium/drivers/llvmpipe/README +++ mesa-7.9~git20100924/src/gallium/drivers/llvmpipe/README @@ -0,0 +1,166 @@ +LLVMPIPE -- a fork of softpipe that employs LLVM for code generation. + + +Status +====== + +Done so far is: + + - the whole fragment pipeline is code generated in a single function + + - input interpolation + + - depth testing + + - texture sampling + - 1D/2D/3D/cube maps supported + - all texture wrap modes supported + - all texture filtering modes supported + - perhaps not all texture formats yet supported + + - fragment shader TGSI translation + - same level of support as the TGSI SSE2 exec machine, with the exception + we don't fallback to TGSI interpretation when an unsupported opcode is + found, but just ignore it + - done in SoA layout + - input interpolation also code generated + + - alpha testing + + - blend (including logic ops) + - both in SoA and AoS layouts, but only the former used for now + + - code is generic + - intermediates can be vectors of floats, ubytes, fixed point, etc, and of + any width and length + - not all operations are implemented for these types yet though + +Most mesa/progs/demos/* work. + +To do (probably by this order): + + - code generate stipple and stencil testing + + - translate TGSI control flow instructions, and all other remaining opcodes + + - integrate with the draw module for VS code generation + + - code generate the triangle setup and rasterization + + +Requirements +============ + + - A x86 or amd64 processor. 64bit mode is preferred. + + Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will + yield the most efficient code. The less features the CPU has the more + likely is that you ran into underperforming, buggy, or incomplete code. + + See /proc/cpuinfo to know what your CPU supports. + + - LLVM 2.6 (or later) + + For Linux, on a recent Debian based distribution do: + + aptitude install llvm-dev + + For Windows download pre-built MSVC 9.0 or MinGW binaries from + http://people.freedesktop.org/~jrfonseca/llvm/ and set the LLVM environment + variable to the extracted path. + + For MSVC there are two set of binaries: llvm-x.x-msvc32mt.7z and + llvm-x.x-msvc32mtd.7z . + + You have to set the LLVM=/path/to/llvm-x.x-msvc32mtd env var when passing + debug=yes to scons, and LLVM=/path/to/llvm-x.x-msvc32mt when building with + debug=no. This is necessary as LLVM builds as static library so the chosen + MS CRT must match. + + The version of LLVM from SVN ("2.7svn") from mid-March 2010 is pretty + stable and has some features not in version 2.6. + + - scons (optional) + + - udis86, http://udis86.sourceforge.net/ (optional). My personal repository + supports more opcodes which haven't been merged upstream yet: + + git clone git://anongit.freedesktop.org/~jrfonseca/udis86 + cd udis86 + ./autogen.sh + ./configure --with-pic + make + sudo make install + + +Building +======== + +To build everything on Linux invoke scons as: + + scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false + +Alternatively, you can build it with GNU make, if you prefer, by invoking it as + + make linux-llvm + +but the rest of these instructions assume that scons is used. + +For windows is everything the except except the winsys: + + scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=gdi dri=false + +Using +===== + +On Linux, building will create a drop-in alternative for libGL.so. To use it +set the environment variables: + + export LD_LIBRARY_PATH=$PWD/build/linux-x86_64-debug/lib:$LD_LIBRARY_PATH + +or + + export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib:$LD_LIBRARY_PATH + +For performance evaluation pass debug=no to scons, and use the corresponding +lib directory without the "-debug" suffix. + +On Windows, building will create a drop-in alternative for opengl32.dll. To use +it put it in the same directory as the application. It can also be used by +replacing the native ICD driver, but it's quite an advanced usage, so if you +need to ask, don't even try it. + + +Unit testing +============ + +Building will also create several unit tests in +build/linux-???-debug/gallium/drivers/llvmpipe: + + - lp_test_blend: blending + - lp_test_conv: SIMD vector conversion + - lp_test_format: pixel unpacking/packing + +Some of this tests can output results and benchmarks to a tab-separated-file +for posterior analysis, e.g.: + + build/linux-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -o blend.tsv + + +Development Notes +================= + +- When looking to this code by the first time start in lp_state_fs.c, and + then skim through the lp_bld_* functions called in there, and the comments + at the top of the lp_bld_*.c functions. + +- The driver-independent parts of the LLVM / Gallium code are found in + src/gallium/auxiliary/gallivm/. The filenames and function prefixes + need to be renamed from "lp_bld_" to something else though. + +- We use LLVM-C bindings for now. They are not documented, but follow the C++ + interfaces very closely, and appear to be complete enough for code + generation. See + http://npcontemplation.blogspot.com/2008/06/secret-of-llvm-c-bindings.html + for a stand-alone example. + See the llvm-c/Core.h file for reference. --- mesa-7.9~git20100924.orig/src/gallium/drivers/svga/include/README +++ mesa-7.9~git20100924/src/gallium/drivers/svga/include/README @@ -0,0 +1,3 @@ +This directory contains the headers from the VMware SVGA Device Developer Kit: + + https://vmware-svga.svn.sourceforge.net/svnroot/vmware-svga/trunk/lib/vmware/ --- mesa-7.9~git20100924.orig/src/gallium/drivers/trace/trace.xsl +++ mesa-7.9~git20100924/src/gallium/drivers/trace/trace.xsl @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + Gallium Trace + + + +
    + +
+ + +
+ + +
  • + + + + + + :: + + + ( + + ) + +
  • +
    + + + + = + + + , + + + + + = + + + + + + + + + + + + ... + + + + + + " + + + + " + + + + + { + + } + + + + + + , + + + + + + NULL + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    --- mesa-7.9~git20100924.orig/src/gallium/drivers/trace/README +++ mesa-7.9~git20100924/src/gallium/drivers/trace/README @@ -0,0 +1,64 @@ + TRACE PIPE DRIVER + + += About = + +This directory contains a Gallium3D trace debugger pipe driver. +It can traces all incoming calls. + + += Build Instructions = + +To build, invoke scons on the top dir as + + scons dri=no statetrackers=mesa winsys=xlib + + += Usage = + +To use do + + export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib + +ensure the right libGL.so is being picked by doing + + ldd progs/trivial/tri + +== Tracing == + +For tracing then do + + GALLIUM_TRACE=tri.trace progs/trivial/tri + +which should create a tri.trace file, which is an XML file. You can view copying +trace.xsl to the same directory, and opening with a XSLT capable browser such as +Firefox or Internet Explorer. + +== Remote debugging == + +For remote debugging see: + + src/gallium/drivers/rbug/README + += Integrating = + +You can integrate the trace pipe driver either inside the state tracker or the +target. The procedure on both cases is the same. Let's assume you have a +pipe_screen obtained by the usual means (variable and function names are just +for illustration purposes): + + real_screen = real_screen_create(...); + +The trace screen is then created by doing + + trace_screen = trace_screen_create(real_screen); + +You can then simply use trace_screen instead of real_screen. + +You can create as many contexts you wish from trace_screen::context_create they +are automatically wrapped by trace_screen. + + +-- +Jose Fonseca +Jakob Bornecrantz --- mesa-7.9~git20100924.orig/src/gallium/drivers/rbug/README +++ mesa-7.9~git20100924/src/gallium/drivers/rbug/README @@ -0,0 +1,58 @@ + RBUG PIPE DRIVER + + += About = + +This directory contains a Gallium3D remote debugger pipe driver. +It provides remote debugging functionality. + + += Build Instructions = + +To build, invoke scons on the top dir as + + scons dri=no statetrackers=mesa winsys=xlib + + += Usage = + +To use do + + export LD_LIBRARY_PATH=$PWD/build/linux-x86-debug/lib + +ensure the right libGL.so is being picked by doing + + ldd progs/trivial/tri + + export XMESA_TRACE=y + GALLIUM_RBUG=true progs/trivial/tri + +which should open gallium remote debugging session. While the program is running +you can launch the small remote debugging application from progs/rbug. More +information is in that directory. Also for a gui see: + + http://cgit.freedesktop.org/mesa/rbug-gui + + += Integrating = + +You can integrate the rbug pipe driver either inside the state tracker or the +target. The procedure on both cases is the same. Let's assume you have a +pipe_screen obtained by the usual means (variable and function names are just +for illustration purposes): + + real_screen = real_screen_create(...); + +The rbug screen is then created by doing + + rbug_screen = rbug_screen_create(real_screen); + +You can then simply use rbug_screen instead of real_screen. + +You can create as many contexts you wish from rbug_screen::context_create they +are automatically wrapped by rbug_screen. + + +-- +Jose Fonseca +Jakob Bornecrantz --- mesa-7.9~git20100924.orig/src/gallium/targets/Makefile.xorg +++ mesa-7.9~git20100924/src/gallium/targets/Makefile.xorg @@ -0,0 +1,82 @@ +# src/gallium/targets/Makefile.xorg + +# Template makefile for gallium xorg drivers. +# +# Usage: +# The minimum that the including makefile needs to define +# is TOP, LIBNAME and one of of the *_SOURCES. +# +# Optional defines: +# DRIVER_INCLUDES are appended to the list of includes directories. +# DRIVER_DEFINES is not used for makedepend, but for compilation. +# DRIVER_PIPES are pipe drivers and modules that the driver depends on. +# DRIVER_LINKS are flags given to the linker. + +### Basic defines ### + +OBJECTS = $(C_SOURCES:.c=.o) \ + $(CPP_SOURCES:.cpp=.o) \ + $(ASM_SOURCES:.S=.o) + +INCLUDES = \ + $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/auxiliary \ + -I$(TOP)/src/gallium/winsys \ + $(DRIVER_INCLUDES) + +LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET) + +ifeq ($(MESA_LLVM),1) +LD = g++ +LDFLAGS += $(LLVM_LDFLAGS) +USE_CXX=1 +DRIVER_PIPES += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a +DRIVER_LINKS += $(LLVM_LIBS) -lm -ldl +endif + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING) + +$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) + $(MKLIB) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS) + +depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES) + rm -f depend + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null + +$(LIBNAME_STAGING): $(LIBNAME) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium + +$(TOP)/$(LIB_DIR)/gallium: + mkdir -p $@ + +clean: + rm -f $(OBJECTS) $(GENERATED_SOURCES) $(LIBNAME).a depend depend.bak + +install: + $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) + $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) + + +##### RULES ##### + +%.s: %.c + $(CC) -S $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + +%.o: %.c + $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + +%.o: %.cpp + $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@ + +%.o: %.S + $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + +sinclude depend + +.PHONY: default clean install --- mesa-7.9~git20100924.orig/src/gallium/targets/SConscript.dri +++ mesa-7.9~git20100924/src/gallium/targets/SConscript.dri @@ -0,0 +1,108 @@ +################################### +# SConcscript file for dri targets + +Import('*') + +drienv = env.Clone() + +drienv.Replace(CPPPATH = [ + '#src/mesa/drivers/dri/common', + '#include', + '#include/GL/internal', + '#src/mapi', + '#src/gallium/include', + '#src/gallium/auxiliary', + '#src/gallium/drivers', + '#src/gallium/winsys', + '#src/mesa', + '#src/mesa/main', + '#src/mesa/glapi', + '#src/mesa/math', + '#src/mesa/transform', + '#src/mesa/shader', + '#src/mesa/swrast', + '#src/mesa/swrast_setup', + '#src/egl/main', + '#src/egl/drivers/dri', +]) + +drienv.ParseConfig('pkg-config --cflags --libs libdrm') + +dri_common_utils = drienv.SharedObject( + target = 'utils.o', + source = '#src/mesa/drivers/dri/common/utils.c' +) + +dri_common_xmlconfig = drienv.SharedObject( + target = 'xmlconfig.o', + source = '#src/mesa/drivers/dri/common/xmlconfig.c' +) + +dri_common_vblank = drienv.SharedObject( + target = 'vblank.o', + source = '#src/mesa/drivers/dri/common/vblank.c' +) + +dri_common_dri_util = drienv.SharedObject( + target = 'dri_util.o', + source = '#src/mesa/drivers/dri/common/dri_util.c' +) + +dri_common_drisw_util = drienv.SharedObject( + target = 'drisw_util.o', + source = '#src/mesa/drivers/dri/common/drisw_util.c' +) + + +COMMON_DRI_SW_OBJECTS = [ + dri_common_utils, + dri_common_xmlconfig, + dri_common_drisw_util, +] + +COMMON_DRI_DRM_OBJECTS = [ + dri_common_utils, + dri_common_xmlconfig, + dri_common_vblank, + dri_common_dri_util, +] + +drienv.AppendUnique(LIBS = [ + 'expat', + 'talloc', +]) + +Export([ + 'drienv', + 'COMMON_DRI_SW_OBJECTS', + 'COMMON_DRI_DRM_OBJECTS', +]) + +SConscript([ + 'dri-swrast/SConscript', +]) + +if 'vmware' in env['winsys']: + SConscript([ + 'dri-vmwgfx/SConscript', + ]) + +if 'i915' in env['winsys']: + SConscript([ + 'dri-i915/SConscript', + ]) + +if 'i965' in env['winsys']: + SConscript([ + 'dri-i965/SConscript', + ]) + +if 'radeon' in env['winsys']: + SConscript([ + 'dri-radeong/SConscript', + ]) + +if 'r600' in env['winsys']: + SConscript([ + 'dri-r600/SConscript', + ]) --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/README +++ mesa-7.9~git20100924/src/gallium/state_trackers/README @@ -0,0 +1,2 @@ +This directory is a placeholder for incubating state-trackers. Mesa's +state-tracker is in src/mesa. --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/wgl/opengl32.def +++ mesa-7.9~git20100924/src/gallium/state_trackers/wgl/opengl32.def @@ -0,0 +1,389 @@ +EXPORTS +; GlmfBeginGlsBlock +; GlmfCloseMetaFile +; GlmfEndGlsBlock +; GlmfEndPlayback +; GlmfInitPlayback +; GlmfPlayGlsRecord + glAccum + glAlphaFunc + glAreTexturesResident + glArrayElement + glBegin + glBindTexture + glBitmap + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearColor + glClearDepth + glClearIndex + glClearStencil + glClipPlane + glColor3b + glColor3bv + glColor3d + glColor3dv + glColor3f + glColor3fv + glColor3i + glColor3iv + glColor3s + glColor3sv + glColor3ub + glColor3ubv + glColor3ui + glColor3uiv + glColor3us + glColor3usv + glColor4b + glColor4bv + glColor4d + glColor4dv + glColor4f + glColor4fv + glColor4i + glColor4iv + glColor4s + glColor4sv + glColor4ub + glColor4ubv + glColor4ui + glColor4uiv + glColor4us + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCullFace +; glDebugEntry + glDeleteLists + glDeleteTextures + glDepthFunc + glDepthMask + glDepthRange + glDisable + glDisableClientState + glDrawArrays + glDrawBuffer + glDrawElements + glDrawPixels + glEdgeFlag + glEdgeFlagPointer + glEdgeFlagv + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1dv + glEvalCoord1f + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2dv + glEvalCoord2f + glEvalCoord2fv + glEvalMesh1 + glEvalMesh2 + glEvalPoint1 + glEvalPoint2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogfv + glFogi + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGetBooleanv + glGetClipPlane + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGendv + glGetTexGenfv + glGetTexGeniv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexMask + glIndexPointer + glIndexd + glIndexdv + glIndexf + glIndexfv + glIndexi + glIndexiv + glIndexs + glIndexsv + glIndexub + glIndexubv + glInitNames + glInterleavedArrays + glIsEnabled + glIsList + glIsTexture + glLightModelf + glLightModelfv + glLightModeli + glLightModeliv + glLightf + glLightfv + glLighti + glLightiv + glLineStipple + glLineWidth + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMaterialfv + glMateriali + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3bv + glNormal3d + glNormal3dv + glNormal3f + glNormal3fv + glNormal3i + glNormal3iv + glNormal3s + glNormal3sv + glNormalPointer + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointSize + glPolygonMode + glPolygonOffset + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPushAttrib + glPushClientAttrib + glPushMatrix + glPushName + glRasterPos2d + glRasterPos2dv + glRasterPos2f + glRasterPos2fv + glRasterPos2i + glRasterPos2iv + glRasterPos2s + glRasterPos2sv + glRasterPos3d + glRasterPos3dv + glRasterPos3f + glRasterPos3fv + glRasterPos3i + glRasterPos3iv + glRasterPos3s + glRasterPos3sv + glRasterPos4d + glRasterPos4dv + glRasterPos4f + glRasterPos4fv + glRasterPos4i + glRasterPos4iv + glRasterPos4s + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectdv + glRectf + glRectfv + glRecti + glRectiv + glRects + glRectsv + glRenderMode + glRotated + glRotatef + glScaled + glScalef + glScissor + glSelectBuffer + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1dv + glTexCoord1f + glTexCoord1fv + glTexCoord1i + glTexCoord1iv + glTexCoord1s + glTexCoord1sv + glTexCoord2d + glTexCoord2dv + glTexCoord2f + glTexCoord2fv + glTexCoord2i + glTexCoord2iv + glTexCoord2s + glTexCoord2sv + glTexCoord3d + glTexCoord3dv + glTexCoord3f + glTexCoord3fv + glTexCoord3i + glTexCoord3iv + glTexCoord3s + glTexCoord3sv + glTexCoord4d + glTexCoord4dv + glTexCoord4f + glTexCoord4fv + glTexCoord4i + glTexCoord4iv + glTexCoord4s + glTexCoord4sv + glTexCoordPointer + glTexEnvf + glTexEnvfv + glTexEnvi + glTexEnviv + glTexGend + glTexGendv + glTexGenf + glTexGenfv + glTexGeni + glTexGeniv + glTexImage1D + glTexImage2D + glTexParameterf + glTexParameterfv + glTexParameteri + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTranslated + glTranslatef + glVertex2d + glVertex2dv + glVertex2f + glVertex2fv + glVertex2i + glVertex2iv + glVertex2s + glVertex2sv + glVertex3d + glVertex3dv + glVertex3f + glVertex3fv + glVertex3i + glVertex3iv + glVertex3s + glVertex3sv + glVertex4d + glVertex4dv + glVertex4f + glVertex4fv + glVertex4i + glVertex4iv + glVertex4s + glVertex4sv + glVertexPointer + glViewport + wglChoosePixelFormat + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext + wglDescribeLayerPlane + wglDescribePixelFormat + wglGetCurrentContext + wglGetCurrentDC +; wglGetDefaultProcAddress + wglGetLayerPaletteEntries + wglGetPixelFormat + wglGetProcAddress + wglMakeCurrent + wglRealizeLayerPalette + wglSetLayerPaletteEntries + wglSetPixelFormat + wglShareLists + wglSwapBuffers + wglSwapLayerBuffers + wglSwapMultipleBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglGetExtensionsStringARB + DrvCopyContext + DrvCreateContext + DrvCreateLayerContext + DrvDeleteContext + DrvDescribeLayerPlane + DrvDescribePixelFormat + DrvGetLayerPaletteEntries + DrvGetProcAddress + DrvPresentBuffers + DrvRealizeLayerPalette + DrvReleaseContext + DrvSetCallbackProcs + DrvSetContext + DrvSetLayerPaletteEntries + DrvSetPixelFormat + DrvShareLists + DrvSwapBuffers + DrvSwapLayerBuffers + DrvValidateVersion --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/wgl/opengl32.mingw.def +++ mesa-7.9~git20100924/src/gallium/state_trackers/wgl/opengl32.mingw.def @@ -0,0 +1,388 @@ +EXPORTS +; GlmfBeginGlsBlock = GlmfBeginGlsBlock@4 +; GlmfCloseMetaFile = GlmfCloseMetaFile@4 +; GlmfEndGlsBlock = GlmfEndGlsBlock@4 +; GlmfEndPlayback = GlmfEndPlayback@4 +; GlmfInitPlayback = GlmfInitPlayback@12 +; GlmfPlayGlsRecord = GlmfPlayGlsRecord@16 + glAccum = glAccum@8 + glAlphaFunc = glAlphaFunc@8 + glAreTexturesResident = glAreTexturesResident@12 + glArrayElement = glArrayElement@4 + glBegin = glBegin@4 + glBindTexture = glBindTexture@8 + glBitmap = glBitmap@28 + glBlendFunc = glBlendFunc@8 + glCallList = glCallList@4 + glCallLists = glCallLists@12 + glClear = glClear@4 + glClearAccum = glClearAccum@16 + glClearColor = glClearColor@16 + glClearDepth = glClearDepth@8 + glClearIndex = glClearIndex@4 + glClearStencil = glClearStencil@4 + glClipPlane = glClipPlane@8 + glColor3b = glColor3b@12 + glColor3bv = glColor3bv@4 + glColor3d = glColor3d@24 + glColor3dv = glColor3dv@4 + glColor3f = glColor3f@12 + glColor3fv = glColor3fv@4 + glColor3i = glColor3i@12 + glColor3iv = glColor3iv@4 + glColor3s = glColor3s@12 + glColor3sv = glColor3sv@4 + glColor3ub = glColor3ub@12 + glColor3ubv = glColor3ubv@4 + glColor3ui = glColor3ui@12 + glColor3uiv = glColor3uiv@4 + glColor3us = glColor3us@12 + glColor3usv = glColor3usv@4 + glColor4b = glColor4b@16 + glColor4bv = glColor4bv@4 + glColor4d = glColor4d@32 + glColor4dv = glColor4dv@4 + glColor4f = glColor4f@16 + glColor4fv = glColor4fv@4 + glColor4i = glColor4i@16 + glColor4iv = glColor4iv@4 + glColor4s = glColor4s@16 + glColor4sv = glColor4sv@4 + glColor4ub = glColor4ub@16 + glColor4ubv = glColor4ubv@4 + glColor4ui = glColor4ui@16 + glColor4uiv = glColor4uiv@4 + glColor4us = glColor4us@16 + glColor4usv = glColor4usv@4 + glColorMask = glColorMask@16 + glColorMaterial = glColorMaterial@8 + glColorPointer = glColorPointer@16 + glCopyPixels = glCopyPixels@20 + glCopyTexImage1D = glCopyTexImage1D@28 + glCopyTexImage2D = glCopyTexImage2D@32 + glCopyTexSubImage1D = glCopyTexSubImage1D@24 + glCopyTexSubImage2D = glCopyTexSubImage2D@32 + glCullFace = glCullFace@4 +; glDebugEntry = glDebugEntry@8 + glDeleteLists = glDeleteLists@8 + glDeleteTextures = glDeleteTextures@8 + glDepthFunc = glDepthFunc@4 + glDepthMask = glDepthMask@4 + glDepthRange = glDepthRange@16 + glDisable = glDisable@4 + glDisableClientState = glDisableClientState@4 + glDrawArrays = glDrawArrays@12 + glDrawBuffer = glDrawBuffer@4 + glDrawElements = glDrawElements@16 + glDrawPixels = glDrawPixels@20 + glEdgeFlag = glEdgeFlag@4 + glEdgeFlagPointer = glEdgeFlagPointer@8 + glEdgeFlagv = glEdgeFlagv@4 + glEnable = glEnable@4 + glEnableClientState = glEnableClientState@4 + glEnd = glEnd@0 + glEndList = glEndList@0 + glEvalCoord1d = glEvalCoord1d@8 + glEvalCoord1dv = glEvalCoord1dv@4 + glEvalCoord1f = glEvalCoord1f@4 + glEvalCoord1fv = glEvalCoord1fv@4 + glEvalCoord2d = glEvalCoord2d@16 + glEvalCoord2dv = glEvalCoord2dv@4 + glEvalCoord2f = glEvalCoord2f@8 + glEvalCoord2fv = glEvalCoord2fv@4 + glEvalMesh1 = glEvalMesh1@12 + glEvalMesh2 = glEvalMesh2@20 + glEvalPoint1 = glEvalPoint1@4 + glEvalPoint2 = glEvalPoint2@8 + glFeedbackBuffer = glFeedbackBuffer@12 + glFinish = glFinish@0 + glFlush = glFlush@0 + glFogf = glFogf@8 + glFogfv = glFogfv@8 + glFogi = glFogi@8 + glFogiv = glFogiv@8 + glFrontFace = glFrontFace@4 + glFrustum = glFrustum@48 + glGenLists = glGenLists@4 + glGenTextures = glGenTextures@8 + glGetBooleanv = glGetBooleanv@8 + glGetClipPlane = glGetClipPlane@8 + glGetDoublev = glGetDoublev@8 + glGetError = glGetError@0 + glGetFloatv = glGetFloatv@8 + glGetIntegerv = glGetIntegerv@8 + glGetLightfv = glGetLightfv@12 + glGetLightiv = glGetLightiv@12 + glGetMapdv = glGetMapdv@12 + glGetMapfv = glGetMapfv@12 + glGetMapiv = glGetMapiv@12 + glGetMaterialfv = glGetMaterialfv@12 + glGetMaterialiv = glGetMaterialiv@12 + glGetPixelMapfv = glGetPixelMapfv@8 + glGetPixelMapuiv = glGetPixelMapuiv@8 + glGetPixelMapusv = glGetPixelMapusv@8 + glGetPointerv = glGetPointerv@8 + glGetPolygonStipple = glGetPolygonStipple@4 + glGetString = glGetString@4 + glGetTexEnvfv = glGetTexEnvfv@12 + glGetTexEnviv = glGetTexEnviv@12 + glGetTexGendv = glGetTexGendv@12 + glGetTexGenfv = glGetTexGenfv@12 + glGetTexGeniv = glGetTexGeniv@12 + glGetTexImage = glGetTexImage@20 + glGetTexLevelParameterfv = glGetTexLevelParameterfv@16 + glGetTexLevelParameteriv = glGetTexLevelParameteriv@16 + glGetTexParameterfv = glGetTexParameterfv@12 + glGetTexParameteriv = glGetTexParameteriv@12 + glHint = glHint@8 + glIndexMask = glIndexMask@4 + glIndexPointer = glIndexPointer@12 + glIndexd = glIndexd@8 + glIndexdv = glIndexdv@4 + glIndexf = glIndexf@4 + glIndexfv = glIndexfv@4 + glIndexi = glIndexi@4 + glIndexiv = glIndexiv@4 + glIndexs = glIndexs@4 + glIndexsv = glIndexsv@4 + glIndexub = glIndexub@4 + glIndexubv = glIndexubv@4 + glInitNames = glInitNames@0 + glInterleavedArrays = glInterleavedArrays@12 + glIsEnabled = glIsEnabled@4 + glIsList = glIsList@4 + glIsTexture = glIsTexture@4 + glLightModelf = glLightModelf@8 + glLightModelfv = glLightModelfv@8 + glLightModeli = glLightModeli@8 + glLightModeliv = glLightModeliv@8 + glLightf = glLightf@12 + glLightfv = glLightfv@12 + glLighti = glLighti@12 + glLightiv = glLightiv@12 + glLineStipple = glLineStipple@8 + glLineWidth = glLineWidth@4 + glListBase = glListBase@4 + glLoadIdentity = glLoadIdentity@0 + glLoadMatrixd = glLoadMatrixd@4 + glLoadMatrixf = glLoadMatrixf@4 + glLoadName = glLoadName@4 + glLogicOp = glLogicOp@4 + glMap1d = glMap1d@32 + glMap1f = glMap1f@24 + glMap2d = glMap2d@56 + glMap2f = glMap2f@40 + glMapGrid1d = glMapGrid1d@20 + glMapGrid1f = glMapGrid1f@12 + glMapGrid2d = glMapGrid2d@40 + glMapGrid2f = glMapGrid2f@24 + glMaterialf = glMaterialf@12 + glMaterialfv = glMaterialfv@12 + glMateriali = glMateriali@12 + glMaterialiv = glMaterialiv@12 + glMatrixMode = glMatrixMode@4 + glMultMatrixd = glMultMatrixd@4 + glMultMatrixf = glMultMatrixf@4 + glNewList = glNewList@8 + glNormal3b = glNormal3b@12 + glNormal3bv = glNormal3bv@4 + glNormal3d = glNormal3d@24 + glNormal3dv = glNormal3dv@4 + glNormal3f = glNormal3f@12 + glNormal3fv = glNormal3fv@4 + glNormal3i = glNormal3i@12 + glNormal3iv = glNormal3iv@4 + glNormal3s = glNormal3s@12 + glNormal3sv = glNormal3sv@4 + glNormalPointer = glNormalPointer@12 + glOrtho = glOrtho@48 + glPassThrough = glPassThrough@4 + glPixelMapfv = glPixelMapfv@12 + glPixelMapuiv = glPixelMapuiv@12 + glPixelMapusv = glPixelMapusv@12 + glPixelStoref = glPixelStoref@8 + glPixelStorei = glPixelStorei@8 + glPixelTransferf = glPixelTransferf@8 + glPixelTransferi = glPixelTransferi@8 + glPixelZoom = glPixelZoom@8 + glPointSize = glPointSize@4 + glPolygonMode = glPolygonMode@8 + glPolygonOffset = glPolygonOffset@8 + glPolygonStipple = glPolygonStipple@4 + glPopAttrib = glPopAttrib@0 + glPopClientAttrib = glPopClientAttrib@0 + glPopMatrix = glPopMatrix@0 + glPopName = glPopName@0 + glPrioritizeTextures = glPrioritizeTextures@12 + glPushAttrib = glPushAttrib@4 + glPushClientAttrib = glPushClientAttrib@4 + glPushMatrix = glPushMatrix@0 + glPushName = glPushName@4 + glRasterPos2d = glRasterPos2d@16 + glRasterPos2dv = glRasterPos2dv@4 + glRasterPos2f = glRasterPos2f@8 + glRasterPos2fv = glRasterPos2fv@4 + glRasterPos2i = glRasterPos2i@8 + glRasterPos2iv = glRasterPos2iv@4 + glRasterPos2s = glRasterPos2s@8 + glRasterPos2sv = glRasterPos2sv@4 + glRasterPos3d = glRasterPos3d@24 + glRasterPos3dv = glRasterPos3dv@4 + glRasterPos3f = glRasterPos3f@12 + glRasterPos3fv = glRasterPos3fv@4 + glRasterPos3i = glRasterPos3i@12 + glRasterPos3iv = glRasterPos3iv@4 + glRasterPos3s = glRasterPos3s@12 + glRasterPos3sv = glRasterPos3sv@4 + glRasterPos4d = glRasterPos4d@32 + glRasterPos4dv = glRasterPos4dv@4 + glRasterPos4f = glRasterPos4f@16 + glRasterPos4fv = glRasterPos4fv@4 + glRasterPos4i = glRasterPos4i@16 + glRasterPos4iv = glRasterPos4iv@4 + glRasterPos4s = glRasterPos4s@16 + glRasterPos4sv = glRasterPos4sv@4 + glReadBuffer = glReadBuffer@4 + glReadPixels = glReadPixels@28 + glRectd = glRectd@32 + glRectdv = glRectdv@8 + glRectf = glRectf@16 + glRectfv = glRectfv@8 + glRecti = glRecti@16 + glRectiv = glRectiv@8 + glRects = glRects@16 + glRectsv = glRectsv@8 + glRenderMode = glRenderMode@4 + glRotated = glRotated@32 + glRotatef = glRotatef@16 + glScaled = glScaled@24 + glScalef = glScalef@12 + glScissor = glScissor@16 + glSelectBuffer = glSelectBuffer@8 + glShadeModel = glShadeModel@4 + glStencilFunc = glStencilFunc@12 + glStencilMask = glStencilMask@4 + glStencilOp = glStencilOp@12 + glTexCoord1d = glTexCoord1d@8 + glTexCoord1dv = glTexCoord1dv@4 + glTexCoord1f = glTexCoord1f@4 + glTexCoord1fv = glTexCoord1fv@4 + glTexCoord1i = glTexCoord1i@4 + glTexCoord1iv = glTexCoord1iv@4 + glTexCoord1s = glTexCoord1s@4 + glTexCoord1sv = glTexCoord1sv@4 + glTexCoord2d = glTexCoord2d@16 + glTexCoord2dv = glTexCoord2dv@4 + glTexCoord2f = glTexCoord2f@8 + glTexCoord2fv = glTexCoord2fv@4 + glTexCoord2i = glTexCoord2i@8 + glTexCoord2iv = glTexCoord2iv@4 + glTexCoord2s = glTexCoord2s@8 + glTexCoord2sv = glTexCoord2sv@4 + glTexCoord3d = glTexCoord3d@24 + glTexCoord3dv = glTexCoord3dv@4 + glTexCoord3f = glTexCoord3f@12 + glTexCoord3fv = glTexCoord3fv@4 + glTexCoord3i = glTexCoord3i@12 + glTexCoord3iv = glTexCoord3iv@4 + glTexCoord3s = glTexCoord3s@12 + glTexCoord3sv = glTexCoord3sv@4 + glTexCoord4d = glTexCoord4d@32 + glTexCoord4dv = glTexCoord4dv@4 + glTexCoord4f = glTexCoord4f@16 + glTexCoord4fv = glTexCoord4fv@4 + glTexCoord4i = glTexCoord4i@16 + glTexCoord4iv = glTexCoord4iv@4 + glTexCoord4s = glTexCoord4s@16 + glTexCoord4sv = glTexCoord4sv@4 + glTexCoordPointer = glTexCoordPointer@16 + glTexEnvf = glTexEnvf@12 + glTexEnvfv = glTexEnvfv@12 + glTexEnvi = glTexEnvi@12 + glTexEnviv = glTexEnviv@12 + glTexGend = glTexGend@16 + glTexGendv = glTexGendv@12 + glTexGenf = glTexGenf@12 + glTexGenfv = glTexGenfv@12 + glTexGeni = glTexGeni@12 + glTexGeniv = glTexGeniv@12 + glTexImage1D = glTexImage1D@32 + glTexImage2D = glTexImage2D@36 + glTexParameterf = glTexParameterf@12 + glTexParameterfv = glTexParameterfv@12 + glTexParameteri = glTexParameteri@12 + glTexParameteriv = glTexParameteriv@12 + glTexSubImage1D = glTexSubImage1D@28 + glTexSubImage2D = glTexSubImage2D@36 + glTranslated = glTranslated@24 + glTranslatef = glTranslatef@12 + glVertex2d = glVertex2d@16 + glVertex2dv = glVertex2dv@4 + glVertex2f = glVertex2f@8 + glVertex2fv = glVertex2fv@4 + glVertex2i = glVertex2i@8 + glVertex2iv = glVertex2iv@4 + glVertex2s = glVertex2s@8 + glVertex2sv = glVertex2sv@4 + glVertex3d = glVertex3d@24 + glVertex3dv = glVertex3dv@4 + glVertex3f = glVertex3f@12 + glVertex3fv = glVertex3fv@4 + glVertex3i = glVertex3i@12 + glVertex3iv = glVertex3iv@4 + glVertex3s = glVertex3s@12 + glVertex3sv = glVertex3sv@4 + glVertex4d = glVertex4d@32 + glVertex4dv = glVertex4dv@4 + glVertex4f = glVertex4f@16 + glVertex4fv = glVertex4fv@4 + glVertex4i = glVertex4i@16 + glVertex4iv = glVertex4iv@4 + glVertex4s = glVertex4s@16 + glVertex4sv = glVertex4sv@4 + glVertexPointer = glVertexPointer@16 + glViewport = glViewport@16 + wglChoosePixelFormat = wglChoosePixelFormat@8 + wglCopyContext = wglCopyContext@12 + wglCreateContext = wglCreateContext@4 + wglCreateLayerContext = wglCreateLayerContext@8 + wglDeleteContext = wglDeleteContext@4 + wglDescribeLayerPlane = wglDescribeLayerPlane@20 + wglDescribePixelFormat = wglDescribePixelFormat@16 + wglGetCurrentContext = wglGetCurrentContext@0 + wglGetCurrentDC = wglGetCurrentDC@0 +; wglGetDefaultProcAddress = wglGetDefaultProcAddress@4 + wglGetLayerPaletteEntries = wglGetLayerPaletteEntries@20 + wglGetPixelFormat = wglGetPixelFormat@4 + wglGetProcAddress = wglGetProcAddress@4 + wglMakeCurrent = wglMakeCurrent@8 + wglRealizeLayerPalette = wglRealizeLayerPalette@12 + wglSetLayerPaletteEntries = wglSetLayerPaletteEntries@20 + wglSetPixelFormat = wglSetPixelFormat@12 + wglShareLists = wglShareLists@8 + wglSwapBuffers = wglSwapBuffers@4 + wglSwapLayerBuffers = wglSwapLayerBuffers@8 + wglSwapMultipleBuffers = wglSwapMultipleBuffers@8 + wglUseFontBitmapsA = wglUseFontBitmapsA@16 + wglUseFontBitmapsW = wglUseFontBitmapsW@16 + wglUseFontOutlinesA = wglUseFontOutlinesA@32 + wglUseFontOutlinesW = wglUseFontOutlinesW@32 + DrvCopyContext = DrvCopyContext@12 + DrvCreateContext = DrvCreateContext@4 + DrvCreateLayerContext = DrvCreateLayerContext@8 + DrvDeleteContext = DrvDeleteContext@4 + DrvDescribeLayerPlane = DrvDescribeLayerPlane@20 + DrvDescribePixelFormat = DrvDescribePixelFormat@16 + DrvGetLayerPaletteEntries = DrvGetLayerPaletteEntries@20 + DrvGetProcAddress = DrvGetProcAddress@4 + DrvPresentBuffers = DrvPresentBuffers@8 + DrvRealizeLayerPalette = DrvRealizeLayerPalette@12 + DrvReleaseContext = DrvReleaseContext@4 + DrvSetCallbackProcs = DrvSetCallbackProcs@8 + DrvSetContext = DrvSetContext@12 + DrvSetLayerPaletteEntries = DrvSetLayerPaletteEntries@20 + DrvSetPixelFormat = DrvSetPixelFormat@8 + DrvShareLists = DrvShareLists@8 + DrvSwapBuffers = DrvSwapBuffers@4 + DrvSwapLayerBuffers = DrvSwapLayerBuffers@8 + DrvValidateVersion = DrvValidateVersion@4 --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/p_texture.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/p_texture.i @@ -0,0 +1,156 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + +/** + * @file + * SWIG interface definion for Gallium types. + * + * @author Jose Fonseca + */ + + +%nodefaultctor pipe_resource; +%nodefaultctor st_surface; + +%nodefaultdtor pipe_resource; +%nodefaultdtor st_surface; + +%ignore pipe_resource::screen; + +%immutable st_surface::texture; +%immutable st_surface::face; +%immutable st_surface::level; +%immutable st_surface::zslice; + +%newobject pipe_resource::get_surface; + +/* Avoid naming conflict with p_inlines.h's pipe_buffer_read/write */ +%rename(read) read_; +%rename(write) write_; + +%extend pipe_resource { + + ~pipe_resource() { + struct pipe_resource *ptr = $self; + pipe_resource_reference(&ptr, NULL); + } + + unsigned get_width(unsigned level=0) { + return u_minify($self->width0, level); + } + + unsigned get_height(unsigned level=0) { + return u_minify($self->height0, level); + } + + unsigned get_depth(unsigned level=0) { + return u_minify($self->depth0, level); + } + + /** Get a surface which is a "view" into a texture */ + struct st_surface * + get_surface(unsigned face=0, unsigned level=0, unsigned zslice=0) + { + struct st_surface *surface; + + if(face >= ($self->target == PIPE_TEXTURE_CUBE ? 6U : 1U)) + SWIG_exception(SWIG_ValueError, "face out of bounds"); + if(level > $self->last_level) + SWIG_exception(SWIG_ValueError, "level out of bounds"); + if(zslice >= u_minify($self->depth0, level)) + SWIG_exception(SWIG_ValueError, "zslice out of bounds"); + + surface = CALLOC_STRUCT(st_surface); + if(!surface) + return NULL; + + pipe_resource_reference(&surface->texture, $self); + surface->face = face; + surface->level = level; + surface->zslice = zslice; + + return surface; + + fail: + return NULL; + } + + unsigned __len__(void) + { + assert($self->target == PIPE_BUFFER); + assert(p_atomic_read(&$self->reference.count) > 0); + return $self->width0; + } + +}; + +struct st_surface +{ + %immutable; + + struct pipe_resource *texture; + unsigned face; + unsigned level; + unsigned zslice; + +}; + +%extend st_surface { + + %immutable; + + unsigned format; + unsigned width; + unsigned height; + + ~st_surface() { + pipe_resource_reference(&$self->texture, NULL); + FREE($self); + } + + +}; + +%{ + static enum pipe_format + st_surface_format_get(struct st_surface *surface) + { + return surface->texture->format; + } + + static unsigned + st_surface_width_get(struct st_surface *surface) + { + return u_minify(surface->texture->width0, surface->level); + } + + static unsigned + st_surface_height_get(struct st_surface *surface) + { + return u_minify(surface->texture->height0, surface->level); + } +%} --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/p_compiler.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/p_compiler.i @@ -0,0 +1,29 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + + +typedef unsigned char ubyte; --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/p_context.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/p_context.i @@ -0,0 +1,765 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + +/** + * @file + * SWIG interface definion for Gallium types. + * + * @author Jose Fonseca + */ + +%nodefaultctor st_context; +%nodefaultdtor st_context; + +struct st_context { +}; + +%extend st_context { + + ~st_context() { + st_context_destroy($self); + } + + /* + * State functions (create/bind/destroy state objects) + */ + + void set_blend( const struct pipe_blend_state *state ) { + cso_set_blend($self->cso, state); + } + + void set_fragment_sampler( unsigned index, const struct pipe_sampler_state *state ) { + cso_single_sampler($self->cso, index, state); + cso_single_sampler_done($self->cso); + } + + void set_vertex_sampler( unsigned index, const struct pipe_sampler_state *state ) { + cso_single_vertex_sampler($self->cso, index, state); + cso_single_vertex_sampler_done($self->cso); + } + + void set_rasterizer( const struct pipe_rasterizer_state *state ) { + cso_set_rasterizer($self->cso, state); + } + + void set_depth_stencil_alpha(const struct pipe_depth_stencil_alpha_state *state) { + cso_set_depth_stencil_alpha($self->cso, state); + } + + void set_fragment_shader( const struct pipe_shader_state *state ) { + void *fs; + + if(!state) { + cso_set_fragment_shader_handle($self->cso, NULL); + return; + } + + fs = $self->pipe->create_fs_state($self->pipe, state); + if(!fs) + return; + + if(cso_set_fragment_shader_handle($self->cso, fs) != PIPE_OK) + return; + + cso_delete_fragment_shader($self->cso, $self->fs); + $self->fs = fs; + } + + void set_vertex_shader( const struct pipe_shader_state *state ) { + void *vs; + + if(!state) { + cso_set_vertex_shader_handle($self->cso, NULL); + return; + } + + vs = $self->pipe->create_vs_state($self->pipe, state); + if(!vs) + return; + + if(cso_set_vertex_shader_handle($self->cso, vs) != PIPE_OK) + return; + + cso_delete_vertex_shader($self->cso, $self->vs); + $self->vs = vs; + } + + void set_geometry_shader( const struct pipe_shader_state *state ) { + void *gs; + + if(!state) { + cso_set_geometry_shader_handle($self->cso, NULL); + return; + } + + gs = $self->pipe->create_gs_state($self->pipe, state); + if(!gs) + return; + + if(cso_set_geometry_shader_handle($self->cso, gs) != PIPE_OK) + return; + + cso_delete_geometry_shader($self->cso, $self->gs); + $self->gs = gs; + } + + struct pipe_sampler_view * + create_sampler_view(struct pipe_resource *texture, + enum pipe_format format = PIPE_FORMAT_NONE, + unsigned first_level = 0, + unsigned last_level = ~0, + unsigned swizzle_r = 0, + unsigned swizzle_g = 1, + unsigned swizzle_b = 2, + unsigned swizzle_a = 3) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_sampler_view templat; + + memset(&templat, 0, sizeof templat); + if (format == PIPE_FORMAT_NONE) { + templat.format = texture->format; + } else { + templat.format = format; + } + templat.last_level = MIN2(last_level, texture->last_level); + templat.first_level = first_level; + templat.last_level = last_level; + templat.swizzle_r = swizzle_r; + templat.swizzle_g = swizzle_g; + templat.swizzle_b = swizzle_b; + templat.swizzle_a = swizzle_a; + + return pipe->create_sampler_view(pipe, texture, &templat); + } + + void + sampler_view_destroy(struct pipe_context *ctx, + struct pipe_sampler_view *view) + { + struct pipe_context *pipe = $self->pipe; + + pipe->sampler_view_destroy(pipe, view); + } + + /* + * Parameter-like state (or properties) + */ + + void set_blend_color(const struct pipe_blend_color *state ) { + cso_set_blend_color($self->cso, state); + } + + void set_stencil_ref(const struct pipe_stencil_ref *state ) { + cso_set_stencil_ref($self->cso, state); + } + + void set_clip(const struct pipe_clip_state *state ) { + $self->pipe->set_clip_state($self->pipe, state); + } + + void set_constant_buffer(unsigned shader, unsigned index, + struct pipe_resource *buffer ) + { + $self->pipe->set_constant_buffer($self->pipe, shader, index, buffer); + } + + void set_framebuffer(const struct pipe_framebuffer_state *state ) + { + memcpy(&$self->framebuffer, state, sizeof *state); + cso_set_framebuffer($self->cso, state); + } + + void set_polygon_stipple(const struct pipe_poly_stipple *state ) { + $self->pipe->set_polygon_stipple($self->pipe, state); + } + + void set_scissor(const struct pipe_scissor_state *state ) { + $self->pipe->set_scissor_state($self->pipe, state); + } + + void set_viewport(const struct pipe_viewport_state *state) { + cso_set_viewport($self->cso, state); + } + + void set_fragment_sampler_view(unsigned index, + struct pipe_sampler_view *view) + { + pipe_sampler_view_reference(&$self->fragment_sampler_views[index], view); + + $self->pipe->set_fragment_sampler_views($self->pipe, + PIPE_MAX_SAMPLERS, + $self->fragment_sampler_views); + } + + void set_vertex_sampler_view(unsigned index, + struct pipe_sampler_view *view) + { + pipe_sampler_view_reference(&$self->vertex_sampler_views[index], view); + + $self->pipe->set_vertex_sampler_views($self->pipe, + PIPE_MAX_VERTEX_SAMPLERS, + $self->vertex_sampler_views); + } + + void set_fragment_sampler_texture(unsigned index, + struct pipe_resource *texture) { + struct pipe_sampler_view templ; + + if(!texture) + texture = $self->default_texture; + pipe_sampler_view_reference(&$self->fragment_sampler_views[index], NULL); + u_sampler_view_default_template(&templ, + texture, + texture->format); + $self->fragment_sampler_views[index] = $self->pipe->create_sampler_view($self->pipe, + texture, + &templ); + $self->pipe->set_fragment_sampler_views($self->pipe, + PIPE_MAX_SAMPLERS, + $self->fragment_sampler_views); + } + + void set_vertex_sampler_texture(unsigned index, + struct pipe_resource *texture) { + struct pipe_sampler_view templ; + + if(!texture) + texture = $self->default_texture; + pipe_sampler_view_reference(&$self->vertex_sampler_views[index], NULL); + u_sampler_view_default_template(&templ, + texture, + texture->format); + $self->vertex_sampler_views[index] = $self->pipe->create_sampler_view($self->pipe, + texture, + &templ); + + $self->pipe->set_vertex_sampler_views($self->pipe, + PIPE_MAX_VERTEX_SAMPLERS, + $self->vertex_sampler_views); + } + + void set_vertex_buffer(unsigned index, + unsigned stride, + unsigned max_index, + unsigned buffer_offset, + struct pipe_resource *buffer) + { + unsigned i; + struct pipe_vertex_buffer state; + + memset(&state, 0, sizeof(state)); + state.stride = stride; + state.max_index = max_index; + state.buffer_offset = buffer_offset; + state.buffer = buffer; + + memcpy(&$self->vertex_buffers[index], &state, sizeof(state)); + + for(i = 0; i < PIPE_MAX_ATTRIBS; ++i) + if(self->vertex_buffers[i].buffer) + $self->num_vertex_buffers = i + 1; + + $self->pipe->set_vertex_buffers($self->pipe, + $self->num_vertex_buffers, + $self->vertex_buffers); + } + + void set_index_buffer(unsigned index_size, + unsigned offset, + struct pipe_resource *buffer) + { + struct pipe_index_buffer ib; + + memset(&ib, 0, sizeof(ib)); + ib.index_size = index_size; + ib.offset = offset; + ib.buffer = buffer; + + $self->pipe->set_index_buffer($self->pipe, &ib); + } + + void set_vertex_element(unsigned index, + const struct pipe_vertex_element *element) + { + memcpy(&$self->vertex_elements[index], element, sizeof(*element)); + } + + void set_vertex_elements(unsigned num) + { + $self->num_vertex_elements = num; + cso_set_vertex_elements($self->cso, + $self->num_vertex_elements, + $self->vertex_elements); + } + + /* + * Draw functions + */ + + void draw_arrays(unsigned mode, unsigned start, unsigned count) { + util_draw_arrays($self->pipe, mode, start, count); + } + + void draw_vbo(const struct pipe_draw_info *info) + { + $self->pipe->draw_vbo($self->pipe, info); + } + + void draw_vertices(unsigned prim, + unsigned num_verts, + unsigned num_attribs, + const float *vertices) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_screen *screen = pipe->screen; + struct pipe_resource *vbuf; + struct pipe_transfer *transfer; + struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; + struct pipe_vertex_buffer vbuffer; + float *map; + unsigned size; + unsigned i; + + size = num_verts * num_attribs * 4 * sizeof(float); + + vbuf = pipe_buffer_create(screen, + PIPE_BIND_VERTEX_BUFFER, + size); + if(!vbuf) + goto error1; + + map = pipe_buffer_map(pipe, vbuf, PIPE_TRANSFER_WRITE, &transfer); + if (!map) + goto error2; + memcpy(map, vertices, size); + pipe_buffer_unmap(pipe, vbuf, transfer); + + cso_save_vertex_elements($self->cso); + + /* tell pipe about the vertex attributes */ + for (i = 0; i < num_attribs; i++) { + velements[i].src_offset = i * 4 * sizeof(float); + velements[i].instance_divisor = 0; + velements[i].vertex_buffer_index = 0; + velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + cso_set_vertex_elements($self->cso, num_attribs, velements); + + /* tell pipe about the vertex buffer */ + memset(&vbuffer, 0, sizeof(vbuffer)); + vbuffer.buffer = vbuf; + vbuffer.stride = num_attribs * 4 * sizeof(float); /* vertex size */ + vbuffer.buffer_offset = 0; + vbuffer.max_index = num_verts - 1; + pipe->set_vertex_buffers(pipe, 1, &vbuffer); + + /* draw */ + util_draw_arrays(pipe, prim, 0, num_verts); + + cso_restore_vertex_elements($self->cso); + +error2: + pipe_resource_reference(&vbuf, NULL); +error1: + ; + } + + void + clear(unsigned buffers, const float *rgba, double depth = 0.0f, + unsigned stencil = 0) + { + $self->pipe->clear($self->pipe, buffers, rgba, depth, stencil); + } + + void + flush(unsigned flags = 0) { + struct pipe_fence_handle *fence = NULL; + $self->pipe->flush($self->pipe, flags | PIPE_FLUSH_RENDER_CACHE, &fence); + if(fence) { + /* TODO: allow asynchronous operation */ + $self->pipe->screen->fence_finish( $self->pipe->screen, fence, 0 ); + $self->pipe->screen->fence_reference( $self->pipe->screen, &fence, NULL ); + } + } + + /* + * Surface functions + */ + + void resource_copy_region(struct pipe_resource *dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, + unsigned width, unsigned height) + { + $self->pipe->resource_copy_region($self->pipe, + dst, subdst, dstx, dsty, dstz, + src, subsrc, srcx, srcy, srcz, + width, height); + } + + + void clear_render_target(struct st_surface *dst, + float *rgba, + unsigned x, unsigned y, + unsigned width, unsigned height) + { + struct pipe_surface *_dst = NULL; + + _dst = st_pipe_surface(dst, PIPE_BIND_RENDER_TARGET); + if(!_dst) + SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing"); + + $self->pipe->clear_render_target($self->pipe, _dst, rgba, x, y, width, height); + + fail: + pipe_surface_reference(&_dst, NULL); + } + + void clear_depth_stencil(struct st_surface *dst, + unsigned clear_flags, + double depth, + unsigned stencil, + unsigned x, unsigned y, + unsigned width, unsigned height) + { + struct pipe_surface *_dst = NULL; + + _dst = st_pipe_surface(dst, PIPE_BIND_DEPTH_STENCIL); + if(!_dst) + SWIG_exception(SWIG_ValueError, "couldn't acquire destination surface for writing"); + + $self->pipe->clear_depth_stencil($self->pipe, _dst, clear_flags, depth, stencil, + x, y, width, height); + + fail: + pipe_surface_reference(&_dst, NULL); + } + + %cstring_output_allocate_size(char **STRING, int *LENGTH, free(*$1)); + void + surface_read_raw(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + char **STRING, int *LENGTH) + { + struct pipe_resource *texture = surface->texture; + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + unsigned stride; + + stride = util_format_get_stride(texture->format, w); + *LENGTH = util_format_get_nblocksy(texture->format, h) * stride; + *STRING = (char *) malloc(*LENGTH); + if(!*STRING) + return; + + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_READ, + x, y, w, h); + if(transfer) { + pipe_get_tile_raw(pipe, transfer, 0, 0, w, h, *STRING, stride); + pipe->transfer_destroy(pipe, transfer); + } + } + + %cstring_input_binary(const char *STRING, unsigned LENGTH); + void + surface_write_raw(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + const char *STRING, unsigned LENGTH, unsigned stride = 0) + { + struct pipe_resource *texture = surface->texture; + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + + if(stride == 0) + stride = util_format_get_stride(texture->format, w); + + if(LENGTH < util_format_get_nblocksy(texture->format, h) * stride) + SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size"); + + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_WRITE, + x, y, w, h); + if(!transfer) + SWIG_exception(SWIG_MemoryError, "couldn't initiate transfer"); + + pipe_put_tile_raw(pipe, transfer, 0, 0, w, h, STRING, stride); + pipe->transfer_destroy(pipe, transfer); + + fail: + return; + } + + void + surface_read_rgba(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + float *rgba) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_READ, + x, y, w, h); + if(transfer) { + pipe_get_tile_rgba(pipe, transfer, 0, 0, w, h, rgba); + pipe->transfer_destroy(pipe, transfer); + } + } + + void + surface_write_rgba(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + const float *rgba) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_WRITE, + x, y, w, h); + if(transfer) { + pipe_put_tile_rgba(pipe, transfer, 0, 0, w, h, rgba); + pipe->transfer_destroy(pipe, transfer); + } + } + + %cstring_output_allocate_size(char **STRING, int *LENGTH, free(*$1)); + void + surface_read_rgba8(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + char **STRING, int *LENGTH) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + float *rgba; + unsigned char *rgba8; + unsigned i, j, k; + + *LENGTH = 0; + *STRING = NULL; + + if (!surface) + return; + + *LENGTH = h*w*4; + *STRING = (char *) malloc(*LENGTH); + if(!*STRING) + return; + + rgba = malloc(h*w*4*sizeof(float)); + if(!rgba) + return; + + rgba8 = (unsigned char *) *STRING; + + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_READ, + x, y, w, h); + if(transfer) { + pipe_get_tile_rgba(pipe, transfer, 0, 0, w, h, rgba); + for(j = 0; j < h; ++j) { + for(i = 0; i < w; ++i) + for(k = 0; k <4; ++k) + rgba8[j*w*4 + i*4 + k] = float_to_ubyte(rgba[j*w*4 + i*4 + k]); + } + pipe->transfer_destroy(pipe, transfer); + } + + free(rgba); + } + + void + surface_read_z(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + unsigned *z) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_READ, + x, y, w, h); + if(transfer) { + pipe_get_tile_z(pipe, transfer, 0, 0, w, h, z); + pipe->transfer_destroy(pipe, transfer); + } + } + + void + surface_write_z(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + const unsigned *z) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_WRITE, + x, y, w, h); + if(transfer) { + pipe_put_tile_z(pipe, transfer, 0, 0, w, h, z); + pipe->transfer_destroy(pipe, transfer); + } + } + + void + surface_sample_rgba(struct st_surface *surface, + float *rgba, + int norm = 0) + { + st_sample_surface($self->pipe, surface, rgba, norm != 0); + } + + unsigned + surface_compare_rgba(struct st_surface *surface, + unsigned x, unsigned y, unsigned w, unsigned h, + const float *rgba, float tol = 0.0) + { + struct pipe_context *pipe = $self->pipe; + struct pipe_transfer *transfer; + float *rgba2; + const float *p1; + const float *p2; + unsigned i, j, n; + + rgba2 = MALLOC(h*w*4*sizeof(float)); + if(!rgba2) + return ~0; + + transfer = pipe_get_transfer(pipe, + surface->texture, + surface->face, + surface->level, + surface->zslice, + PIPE_TRANSFER_READ, + x, y, w, h); + if(!transfer) { + FREE(rgba2); + return ~0; + } + + pipe_get_tile_rgba(pipe, transfer, 0, 0, w, h, rgba2); + pipe->transfer_destroy(pipe, transfer); + + p1 = rgba; + p2 = rgba2; + n = 0; + for(i = h*w; i; --i) { + unsigned differs = 0; + for(j = 4; j; --j) { + float delta = *p2++ - *p1++; + if (delta < -tol || delta > tol) + differs = 1; + } + n += differs; + } + + FREE(rgba2); + + return n; + } + + %cstring_input_binary(const char *STRING, unsigned LENGTH); + void + transfer_inline_write(struct pipe_resource *resource, + struct pipe_subresource *sr, + unsigned usage, + const struct pipe_box *box, + const char *STRING, unsigned LENGTH, + unsigned stride, + unsigned slice_stride) + { + struct pipe_context *pipe = $self->pipe; + + pipe->transfer_inline_write(pipe, resource, *sr, usage, box, STRING, stride, slice_stride); + } + + %cstring_output_allocate_size(char **STRING, int *LENGTH, free(*$1)); + void buffer_read(struct pipe_resource *buffer, + char **STRING, int *LENGTH) + { + struct pipe_context *pipe = $self->pipe; + + assert(buffer->target == PIPE_BUFFER); + + *LENGTH = buffer->width0; + *STRING = (char *) malloc(buffer->width0); + if(!*STRING) + return; + + pipe_buffer_read(pipe, buffer, 0, buffer->width0, *STRING); + } + + void buffer_write(struct pipe_resource *buffer, + const char *STRING, unsigned LENGTH, unsigned offset = 0) + { + struct pipe_context *pipe = $self->pipe; + + assert(buffer->target == PIPE_BUFFER); + + if(offset > buffer->width0) + SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size"); + + if(offset + LENGTH > buffer->width0) + SWIG_exception(SWIG_ValueError, "data length must fit inside the buffer"); + + pipe_buffer_write(pipe, buffer, offset, LENGTH, STRING); + +fail: + return; + } + +}; --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/p_state.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/p_state.i @@ -0,0 +1,184 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + +/** + * @file + * SWIG interface definion for Gallium types. + * + * @author Jose Fonseca + */ + +%module gallium; + +%ignore winsys; +%ignore pipe_vertex_buffer::buffer; + +%include "pipe/p_compiler.h"; +%include "pipe/p_state.h"; + + +%array_class(struct pipe_stencil_state, StencilArray); + + +%extend pipe_rt_blend_state +{ + struct pipe_rt_blend_state * + __getitem__(int index) + { + if(index < 0 || index >= PIPE_MAX_COLOR_BUFS) + SWIG_exception(SWIG_ValueError, "index out of bounds"); + return $self + index; + fail: + return NULL; + }; +}; + + +%extend pipe_blend_state +{ + pipe_blend_state(void) + { + return CALLOC_STRUCT(pipe_blend_state); + } + + %cstring_input_binary(const char *STRING, unsigned LENGTH); + pipe_blend_state(const char *STRING, unsigned LENGTH) + { + struct pipe_blend_state *state; + state = CALLOC_STRUCT(pipe_blend_state); + if (state) { + LENGTH = MIN2(sizeof *state, LENGTH); + memcpy(state, STRING, LENGTH); + } + return state; + } + + %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1)); + void __str__(char **STRING, int *LENGTH) + { + struct os_stream *stream; + + stream = os_str_stream_create(1); + util_dump_blend_state(stream, $self); + + *STRING = os_str_stream_get_and_close(stream); + *LENGTH = strlen(*STRING); + } +}; + + +%extend pipe_framebuffer_state { + + pipe_framebuffer_state(void) { + return CALLOC_STRUCT(pipe_framebuffer_state); + } + + ~pipe_framebuffer_state() { + unsigned index; + for(index = 0; index < PIPE_MAX_COLOR_BUFS; ++index) + pipe_surface_reference(&$self->cbufs[index], NULL); + pipe_surface_reference(&$self->zsbuf, NULL); + FREE($self); + } + + void + set_cbuf(unsigned index, struct st_surface *surface) + { + struct pipe_surface *_surface = NULL; + + if(index >= PIPE_MAX_COLOR_BUFS) + SWIG_exception(SWIG_ValueError, "index out of bounds"); + + if(surface) { + _surface = st_pipe_surface(surface, PIPE_BIND_RENDER_TARGET); + if(!_surface) + SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + } + + pipe_surface_reference(&$self->cbufs[index], _surface); + + fail: + return; + } + + void + set_zsbuf(struct st_surface *surface) + { + struct pipe_surface *_surface = NULL; + + if(surface) { + _surface = st_pipe_surface(surface, PIPE_BIND_DEPTH_STENCIL); + if(!_surface) + SWIG_exception(SWIG_ValueError, "couldn't acquire surface for writing"); + } + + pipe_surface_reference(&$self->zsbuf, _surface); + + fail: + return; + } + +}; + + +%extend pipe_shader_state { + + pipe_shader_state(const char *text, unsigned num_tokens = 1024) { + struct tgsi_token *tokens; + struct pipe_shader_state *shader; + + tokens = MALLOC(num_tokens * sizeof(struct tgsi_token)); + if(!tokens) + goto error1; + + if(tgsi_text_translate(text, tokens, num_tokens ) != TRUE) + goto error2; + + shader = CALLOC_STRUCT(pipe_shader_state); + if(!shader) + goto error3; + + shader->tokens = tokens; + + return shader; + +error3: +error2: + FREE(tokens); +error1: + return NULL; + } + + ~pipe_shader_state() { + FREE((void*)$self->tokens); + FREE($self); + } + + void dump(unsigned flags = 0) { + tgsi_dump($self->tokens, flags); + } +} --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/p_device.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/p_device.i @@ -0,0 +1,140 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + +/** + * @file + * SWIG interface definion for Gallium types. + * + * @author Jose Fonseca + */ + + +%nodefaultctor st_device; +%nodefaultdtor st_device; + + +struct st_device { +}; + +%newobject st_device::texture_create; +%newobject st_device::context_create; +%newobject st_device::buffer_create; + +%extend st_device { + + st_device(int hardware = 1) { + return st_device_create(hardware ? TRUE : FALSE); + } + + ~st_device() { + st_device_destroy($self); + } + + const char * get_name( void ) { + return $self->screen->get_name($self->screen); + } + + const char * get_vendor( void ) { + return $self->screen->get_vendor($self->screen); + } + + /** + * Query an integer-valued capability/parameter/limit + * \param param one of PIPE_CAP_x + */ + int get_param( int param ) { + return $self->screen->get_param($self->screen, param); + } + + /** + * Query a float-valued capability/parameter/limit + * \param param one of PIPE_CAP_x + */ + float get_paramf( int param ) { + return $self->screen->get_paramf($self->screen, param); + } + + /** + * Check if the given pipe_format is supported as a texture or + * drawing surface. + * \param bind bitmask of PIPE_BIND flags + */ + int is_format_supported( enum pipe_format format, + enum pipe_texture_target target, + unsigned sample_count, + unsigned bind, + unsigned geom_flags ) { + /* We can't really display surfaces with the python statetracker so mask + * out that usage */ + bind &= ~PIPE_BIND_DISPLAY_TARGET; + + return $self->screen->is_format_supported( $self->screen, + format, + target, + sample_count, + bind, + geom_flags ); + } + + struct st_context * + context_create(void) { + return st_context_create($self); + } + + struct pipe_resource * + resource_create( + enum pipe_format format, + unsigned width, + unsigned height, + unsigned depth = 1, + unsigned last_level = 0, + enum pipe_texture_target target = PIPE_TEXTURE_2D, + unsigned bind = 0 + ) { + struct pipe_resource templat; + + /* We can't really display surfaces with the python statetracker so mask + * out that usage */ + bind &= ~PIPE_BIND_DISPLAY_TARGET; + + memset(&templat, 0, sizeof(templat)); + templat.format = format; + templat.width0 = width; + templat.height0 = height; + templat.depth0 = depth; + templat.last_level = last_level; + templat.target = target; + templat.bind = bind; + + return $self->screen->resource_create($self->screen, &templat); + } + + struct pipe_resource * + buffer_create(unsigned size, unsigned bind = 0) { + return pipe_buffer_create($self->screen, bind, size); + } +}; --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/README +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/README @@ -0,0 +1,43 @@ +This directory contains Python bindings to Gallium3D. It looks like a state +tracker from the pipe driver perspective, and it looks like a pipe driver from +the python script perspective. + + +To build you'll need: +* Python (with development packages) +* SCons +* SWIG, http://www.swig.org/download.html +* Python Imaging Library with TK support, http://www.pythonware.com/products/pil/, + for the samples + +On a debian-based distro you can simply do: + + aptitude install python-dev scons swig python-imaging python-imaging-tk + +On a Windows machine ensure the swig command is in your PATH. + +Invoke scons on the top dir as + + scons debug=yes statetrackers=python drivers=softpipe winsys=none + +To use it set PYTHONPATH appropriately, e.g, in Linux do: + + export PYTHONPATH=$PWD/build/linux-x86-debug/gallium/state_trackers/python + +or (in Windows) + + set PYTHONPATH=%CD%\build\windows-x86-debug\gallium\state_trackers\python + +and then try running + + python progs/gallium/python/samples/tri.py + +which should show a triangle. + + +This is still work in progress: +- errors are not handled properly and almost always result in crash +- state atoms with array members are awkward to set + +-- +Jose Fonseca --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/gallium.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/gallium.i @@ -0,0 +1,105 @@ + /************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. + * + **************************************************************************/ + +/** + * @file + * SWIG interface definion for Gallium types. + * + * @author Jose Fonseca + */ + +%module gallium; + +%{ + +#include + +#include "pipe/p_screen.h" +#include "pipe/p_context.h" +#include "pipe/p_shader_tokens.h" +#include "os/os_stream.h" +#include "util/u_inlines.h" +#include "util/u_draw_quad.h" +#include "util/u_tile.h" +#include "util/u_math.h" +#include "util/u_format.h" +#include "util/u_dump.h" +#include "util/u_memory.h" +#include "util/u_sampler.h" +#include "cso_cache/cso_context.h" +#include "tgsi/tgsi_text.h" +#include "tgsi/tgsi_dump.h" + +#include "st_device.h" +#include "st_sample.h" + +%} + +%include "typemaps.i" +%include "exception.i" +%include "cstring.i" + +%include "carrays.i" +%array_class(unsigned char, ByteArray); +%array_class(int, IntArray); +%array_class(unsigned, UnsignedArray); +%array_class(float, FloatArray); + + +%rename(Device) st_device; +%rename(Context) st_context; +%rename(Resource) pipe_resource; +%rename(Surface) st_surface; + +%rename(BlendColor) pipe_blend_color; +%rename(Blend) pipe_blend_state; +%rename(Clip) pipe_clip_state; +%rename(Depth) pipe_depth_state; +%rename(Stencil) pipe_stencil_state; +%rename(Alpha) pipe_alpha_state; +%rename(DepthStencilAlpha) pipe_depth_stencil_alpha_state; +%rename(Framebuffer) pipe_framebuffer_state; +%rename(PolyStipple) pipe_poly_stipple; +%rename(Rasterizer) pipe_rasterizer_state; +%rename(Sampler) pipe_sampler_state; +%rename(Scissor) pipe_scissor_state; +%rename(Shader) pipe_shader_state; +%rename(VertexBuffer) pipe_vertex_buffer; +%rename(VertexElement) pipe_vertex_element; +%rename(Viewport) pipe_viewport_state; + + +%include "p_compiler.i" +%include "p_defines.h" +%include "p_format.h" + +%include "p_device.i" +%include "p_context.i" +%include "p_texture.i" +%include "p_state.i" + +%include "u_format.i" --- mesa-7.9~git20100924.orig/src/gallium/state_trackers/python/u_format.i +++ mesa-7.9~git20100924/src/gallium/state_trackers/python/u_format.i @@ -0,0 +1,88 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. + * All Rights Reserved. + * + * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + + +static INLINE const char * +util_format_name(enum pipe_format format); + +static INLINE boolean +util_format_is_s3tc(enum pipe_format format); + +static INLINE boolean +util_format_is_depth_or_stencil(enum pipe_format format); + +static INLINE boolean +util_format_is_depth_and_stencil(enum pipe_format format); + + +uint +util_format_get_blocksizebits(enum pipe_format format); + +uint +util_format_get_blocksize(enum pipe_format format); + +uint +util_format_get_blockwidth(enum pipe_format format); + +uint +util_format_get_blockheight(enum pipe_format format); + +unsigned +util_format_get_nblocksx(enum pipe_format format, + unsigned x); + +unsigned +util_format_get_nblocksy(enum pipe_format format, + unsigned y); + +unsigned +util_format_get_nblocks(enum pipe_format format, + unsigned width, + unsigned height); + +size_t +util_format_get_stride(enum pipe_format format, + unsigned width); + +size_t +util_format_get_2d_size(enum pipe_format format, + size_t stride, + unsigned height); + +uint +util_format_get_component_bits(enum pipe_format format, + enum util_format_colorspace colorspace, + uint component); + +boolean +util_format_has_alpha(enum pipe_format format); + + +unsigned +util_format_get_nr_components(enum pipe_format format); + + --- mesa-7.9~git20100924.orig/src/gallium/docs/make.bat +++ mesa-7.9~git20100924/src/gallium/docs/make.bat @@ -0,0 +1,113 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Gallium.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Gallium.ghc + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end --- mesa-7.9~git20100924.orig/src/gallium/docs/d3d11ddi.txt +++ mesa-7.9~git20100924/src/gallium/docs/d3d11ddi.txt @@ -0,0 +1,475 @@ +This document compares the D3D10/D3D11 device driver interface with Gallium. +It is written from the perspective of a developer implementing a D3D10/D3D11 driver as a Gallium state tracker. + +Note that naming and other cosmetic differences are not noted, since they don't really matter and would severely clutter the document. +Gallium/OpenGL terminology is used in preference to D3D terminology. + +NOTE: this document tries to be complete but most likely isn't fully complete and also not fully correct: please submit patches if you spot anything incorrect + +Also note that this is specifically for the DirectX 10/11 Windows Vista/7 DDI interfaces. +DirectX 9 has both user-mode (for Vista) and kernel mode (pre-Vista) interfaces, but they are significantly different from Gallium due to the presence of a lot of fixed function functionality. + +The user-visible DirectX 10/11 interfaces are distinct from the kernel DDI, but they match very closely. + +* Accessing Microsoft documentation + +See http://msdn.microsoft.com/en-us/library/dd445501.aspx ("D3D11DDI_DEVICEFUNCS") for D3D documentation. + +Also see http://download.microsoft.com/download/f/2/d/f2d5ee2c-b7ba-4cd0-9686-b6508b5479a1/direct3d10_web.pdf ("The Direct3D 10 System" by David Blythe) for an introduction to Direct3D 10 and the rationale for its design. + +The Windows Driver Kit contains the actual headers, as well as shader bytecode documentation. + +To get the headers from Linux, run the following, in a dedicated directory: +wget http://download.microsoft.com/download/4/A/2/4A25C7D5-EFBE-4182-B6A9-AE6850409A78/GRMWDK_EN_7600_1.ISO +sudo mount -o loop GRMWDK_EN_7600_1.ISO /mnt/tmp +cabextract -x /mnt/tmp/wdk/headers_cab001.cab +rename 's/^_(.*)_[0-9]*$/$1/' * +sudo umount /mnt/tmp + +d3d10umddi.h contains the DDI interface analyzed in this document: note that it is much easier to read this online on MSDN. +d3d{10,11}TokenizedProgramFormat.hpp contains the shader bytecode definitions: this is not available on MSDN. +d3d9types.h contains DX9 shader bytecode, and DX9 types +d3dumddi.h contains the DirectX 9 DDI interface + +* Glossary + +BC1: DXT1 +BC2: DXT3 +BC3: DXT5 +BC5: RGTC +BC6H: BPTC float +BC7: BPTC +CS = compute shader: OpenCL-like shader +DS = domain shader: tessellation evaluation shader +HS = hull shader: tessellation control shader +IA = input assembler: primitive assembly +Input layout: vertex elements +OM = output merger: blender +PS = pixel shader: fragment shader +Primitive topology: primitive type +Resource: buffer or texture +Shader resource (view): sampler view +SO = stream out: transform feedback +Unordered access view: view supporting random read/write access (usually from compute shaders) + +* Legend + +-: features D3D11 has and Gallium lacks ++: features Gallium has and D3D11 lacks +!: differences between D3D11 and Gallium +*: possible improvements to Gallium +>: references to comparisons of special enumerations +#: comment + +* Gallium functions with no direct D3D10/D3D11 equivalent + +clear + + Gallium supports clearing both render targets and depth/stencil with a single call + +fence_signalled +fence_finish + + D3D10/D3D11 don't appear to support explicit fencing; queries can often substitute though, and flushing is supported + +set_clip_state + + Gallium supports fixed function user clip planes, D3D10/D3D11 only support using the vertex shader for them + +set_polygon_stipple + + Gallium supports polygon stipple + +clearRT/clearDS + + Gallium supports subrectangle fills of surfaces, D3D10 only supports full clears of views + +* DirectX 10/11 DDI functions and Gallium equivalents + +AbandonCommandList (D3D11 only) + - Gallium does not support deferred contexts + +CalcPrivateBlendStateSize +CalcPrivateDepthStencilStateSize +CalcPrivateDepthStencilViewSize +CalcPrivateElementLayoutSize +CalcPrivateGeometryShaderWithStreamOutput +CalcPrivateOpenedResourceSize +CalcPrivateQuerySize +CalcPrivateRasterizerStateSize +CalcPrivateRenderTargetViewSize +CalcPrivateResourceSize +CalcPrivateSamplerSize +CalcPrivateShaderResourceViewSize +CalcPrivateShaderSize +CalcDeferredContextHandleSize (D3D11 only) +CalcPrivateCommandListSize (D3D11 only) +CalcPrivateDeferredContextSize (D3D11 only) +CalcPrivateTessellationShaderSize (D3D11 only) +CalcPrivateUnorderedAccessViewSize (D3D11 only) + ! D3D11 allocates private objects itself, using the size computed here + * Gallium could do something similar to be able to put the private data inline into state tracker objects: this would allow them to fit in the same cacheline and improve performance + +CheckDeferredContextHandleSizes (D3D11 only) + - Gallium does not support deferred contexts + +CheckFormatSupport -> screen->is_format_supported + ! Gallium passes usages to this function, D3D11 returns them + - Gallium does not differentiate between blendable and non-blendable render targets + ! Gallium includes sample count directly, D3D11 uses additional query + +CheckMultisampleQualityLevels + ! is merged with is_format_supported + +CommandListExecute (D3D11 only) + - Gallium does not support command lists + +CopyStructureCount (D3D11 only) + - Gallium does not support unordered access views (views that can be written to arbitrarily from compute shaders) + +ClearDepthStencilView -> clear +ClearRenderTargetView -> clear + # D3D11 is not totally clear about whether this applies to any view or only a "currently-bound view" + + Gallium allows to clear both depth/stencil and render target(s) in a single operation + + Gallium supports double-precision depth values (but not rgba values!) + * May want to also support double-precision rgba or use "float" for "depth" + +ClearUnorderedAccessViewFloat (D3D11 only) +ClearUnorderedAccessViewUint (D3D11 only) + - Gallium does not support unordered access views (views that can be written to arbitrarily from compute shaders) + +CreateBlendState (extended in D3D10.1) -> create_blend_state + # D3D10 does not support per-RT blend modes (but per-RT blending), only D3D10.1 does + + Gallium supports logic ops + + Gallium supports dithering + + Gallium supports using the broadcast alpha component of the blend constant color + +CreateCommandList (D3D11 only) + - Gallium does not support command lists + +CreateComputeShader (D3D11 only) + - Gallium does not support compute shaders + +CreateDeferredContext (D3D11 only) + - Gallium does not support deferred contexts + +CreateDomainShader (D3D11 only) + - Gallium does not support domain shaders + +CreateHullShader (D3D11 only) + - Gallium does not support hull shaders + +CreateUnorderedAccessView (D3D11 only) + - Gallium does not support unordered access views + +CreateDepthStencilState -> create_depth_stencil_alpha_state + ! D3D11 has both a global stencil enable, and front/back enables; Gallium has only front/back enables + + Gallium has per-face writemask/valuemasks, D3D11 uses the same value for back and front + + Gallium supports the alpha test, which D3D11 lacks + +CreateDepthStencilView -> get_tex_surface +CreateRenderTargetView -> get_tex_surface + ! Gallium merges depthstencil and rendertarget views into pipe_surface, which also doubles as a 2D surface abstraction + - lack of texture array support + - lack of render-to-buffer support + + Gallium supports using 3D texture zslices as a depth/stencil buffer (in theory) + +CreateElementLayout -> create_vertex_elements_state + ! D3D11 allows sparse vertex elements (via InputRegister); in Gallium they must be specified sequentially + ! D3D11 has an extra flag (InputSlotClass) that is the same as instance_divisor == 0 + +CreateGeometryShader -> create_gs_state +CreateGeometryShaderWithStreamOutput -> create_gs_state + create_stream_output_state +CreatePixelShader -> create_fs_state +CreateVertexShader -> create_vs_state + > bytecode is different (see D3d10tokenizedprogramformat.hpp) + ! D3D11 describes input/outputs separately from bytecode; Gallium has the tgsi_scan.c module to extract it from TGSI + @ TODO: look into DirectX 10/11 semantics specification and bytecode + +CheckCounter +CheckCounterInfo +CreateQuery -> create_query + - Gallium only supports occlusion, primitives generated and primitives emitted queries + ! D3D11 implements fences with "event" queries + * TIMESTAMP could be implemented as an additional fields for other queries: some cards have hardware support for exactly this + * OCCLUSIONPREDICATE is required for the OpenGL v2 occlusion query functionality + * others are performance counters, we may want them but they are not critical + +CreateRasterizerState + - Gallium lacks clamping of polygon offset depth biases + - Gallium lacks support to disable depth clipping + + Gallium, like OpenGL, supports PIPE_POLYGON_MODE_POINT + + Gallium, like OpenGL, supports per-face polygon fill modes + + Gallium, like OpenGL, supports culling everything + + Gallium, like OpenGL, supports two-side lighting; D3D11 only has the facing attribute + + Gallium, like OpenGL, supports per-fill-mode polygon offset enables + + Gallium, like OpenGL, supports polygon smoothing + + Gallium, like OpenGL, supports polygon stipple + + Gallium, like OpenGL, supports point smoothing + + Gallium, like OpenGL, supports point sprites + + Gallium supports specifying point quad rasterization + + Gallium, like OpenGL, supports per-point point size + + Gallium, like OpenGL, supports line smoothing + + Gallium, like OpenGL, supports line stipple + + Gallium supports line last pixel rule specification + + Gallium, like OpenGL, supports provoking vertex convention + + Gallium supports D3D9 rasterization rules + + Gallium supports fixed line width + + Gallium supports fixed point size + +CreateResource -> texture_create or buffer_create + ! D3D11 passes the dimensions of all mipmap levels to the create call, while Gallium has an implicit floor(x/2) rule + # Note that hardware often has the implicit rule, so the D3D11 interface seems to make little sense + # Also, the D3D11 API does not allow the user to specify mipmap sizes, so this really seems a dubious decision on Microsoft's part + - D3D11 supports specifying initial data to write in the resource + - Gallium does not support unordered access buffers + ! D3D11 specifies mapping flags (i.e. read/write/discard);:it's unclear what they are used for here + - D3D11 supports odd things in the D3D10_DDI_RESOURCE_MISC_FLAG enum (D3D10_DDI_RESOURCE_MISC_DISCARD_ON_PRESENT, D3D11_DDI_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS, D3D11_DDI_RESOURCE_MISC_BUFFER_STRUCTURED) + - Gallium does not support indirect draw call parameter buffers + - Gallium lacks array textures + ! D3D11 supports specifying hardware modes and other stuff here for scanout resources + + Gallium allows specifying minimum buffer alignment + ! D3D11 implements cube maps as 2D array textures + +CreateSampler + - D3D11 supports a monochrome convolution filter for "text filtering" + + Gallium supports non-normalized coordinates + + Gallium supports CLAMP, MIRROR_CLAMP and MIRROR_CLAMP_TO_BORDER + + Gallium supports setting min/max/mip filters and anisotropy independently + +CreateShaderResourceView (extended in D3D10.1) -> create_sampler_view + - Gallium lacks sampler views over buffers + - Gallium lacks texture arrays, and cube map views over texture arrays + + Gallium supports specifying a swizzle + ! D3D11 implements "cube views" as views into a 2D array texture + +CsSetConstantBuffers (D3D11 only) +CsSetSamplers (D3D11 only) +CsSetShader (D3D11 only) +CsSetShaderResources (D3D11 only) +CsSetShaderWithIfaces (D3D11 only) +CsSetUnorderedAccessViews (D3D11 only) + - Gallium does not support compute shaders + +DestroyBlendState +DestroyCommandList (D3D11 only) +DestroyDepthStencilState +DestroyDepthStencilView +DestroyDevice +DestroyElementLayout +DestroyQuery +DestroyRasterizerState +DestroyRenderTargetView +DestroyResource +DestroySampler +DestroyShader +DestroyShaderResourceView +DestroyUnorderedAccessView (D3D11 only) + # these are trivial + +Dispatch (D3D11 only) + - Gallium does not support compute shaders + +DispatchIndirect (D3D11 only) + - Gallium does not support compute shaders + +Draw -> draw_vbo + ! D3D11 sets primitive modes separately with IaSetTopology: it's not obvious which is better + +DrawAuto -> draw_auto + +DrawIndexed -> draw_vbo + ! D3D11 sets primitive modes separately with IaSetTopology: it's not obvious which is better + + D3D11 lacks explicit range, which is required for OpenGL + +DrawIndexedInstanced -> draw_vbo + ! D3D11 sets primitive modes separately with IaSetTopology: it's not obvious which is better + +DrawIndexedInstancedIndirect (D3D11 only) + # this allows to use an hardware buffer to specify the parameters for multiple draw_vbo calls + - Gallium does not support draw call parameter buffers and indirect draw + +DrawInstanced -> draw_vbo + ! D3D11 sets primitive modes separately with IaSetTopology: it's not obvious which is better + +DrawInstancedIndirect (D3D11 only) + # this allows to use an hardware buffer to specify the parameters for multiple draw_vbo calls + - Gallium does not support draw call parameter buffers and indirect draws + +DsSetConstantBuffers (D3D11 only) +DsSetSamplers (D3D11 only) +DsSetShader (D3D11 only) +DsSetShaderResources (D3D11 only) +DsSetShaderWithIfaces (D3D11 only) + - Gallium does not support domain shaders + +Flush -> flush + ! Gallium supports fencing and several kinds of flushing here, D3D11 just has a dumb glFlush-like function + +GenMips + - Gallium lacks a mipmap generation interface, and does this manually with the 3D engine + * it may be useful to add a mipmap generation interface, since the hardware (especially older cards) may have a better way than using the 3D engine + +GsSetConstantBuffers -> for(i = StartBuffer; i < NumBuffers; ++i) set_constant_buffer(PIPE_SHADER_GEOMETRY, i, phBuffers[i]) + +GsSetSamplers + - Gallium does not support sampling in geometry shaders + +GsSetShader -> bind_gs_state + +GsSetShaderWithIfaces (D3D11 only) + - Gallium does not support shader interfaces + +GsSetShaderResources + - Gallium does not support sampling in geometry shaders + +HsSetConstantBuffers (D3D11 only) +HsSetSamplers (D3D11 only) +HsSetShader (D3D11 only) +HsSetShaderResources (D3D11 only) +HsSetShaderWithIfaces (D3D11 only) + - Gallium does not support hull shaders + +IaSetIndexBuffer -> set_index_buffer + + Gallium supports 8-bit indices + # the D3D11 interface allows index-size-unaligned byte offsets into the index buffer; most drivers will abort with an assertion + +IaSetInputLayout -> bind_vertex_elements_state + +IaSetTopology + ! Gallium passes the topology = primitive type to the draw calls + * may want to add an interface for this + - Gallium lacks support for DirectX 11 tessellated primitives + + Gallium supports line loops, triangle fans, quads, quad strips and polygons + +IaSetVertexBuffers -> set_vertex_buffers + + Gallium allows to specify a max_index here + - Gallium only allows setting all vertex buffers at once, while D3D11 supports setting a subset + +OpenResource -> texture_from_handle + +PsSetConstantBuffers -> for(i = StartBuffer; i < NumBuffers; ++i) set_constant_buffer(PIPE_SHADER_FRAGMENT, i, phBuffers[i]) + * may want to split into fragment/vertex-specific versions + +PsSetSamplers -> bind_fragment_sampler_states + * may want to allow binding subsets instead of all at once + +PsSetShader -> bind_fs_state + +PsSetShaderWithIfaces (D3D11 only) + - Gallium does not support shader interfaces + +PsSetShaderResources -> set_fragment_sampler_views + * may want to allow binding subsets instead of all at once + +QueryBegin -> begin_query + +QueryEnd -> end_query + +QueryGetData -> get_query_result + - D3D11 supports reading an arbitrary data chunk for query results, Gallium only supports reading a 64-bit integer + + D3D11 doesn't seem to support actually waiting for the query result (?!) + - D3D11 supports optionally not flushing command buffers here and instead returning DXGI_DDI_ERR_WASSTILLDRAWING + +RecycleCommandList (D3D11 only) +RecycleCreateCommandList (D3D11 only) +RecycleDestroyCommandList (D3D11 only) + - Gallium does not support command lists + +RecycleCreateDeferredContext (D3D11 only) + - Gallium does not support deferred contexts + +RelocateDeviceFuncs + - Gallium does not support moving pipe_context, while D3D11 seems to, using this + +ResetPrimitiveID (D3D10.1+ only, #ifdef D3D10PSGP) + # used to do vertex processing on the GPU on Intel G45 chipsets when it is faster this way (see www.intel.com/Assets/PDF/whitepaper/322931.pdf) + # presumably this resets the primitive id system value + - Gallium does not support vertex pipeline bypass anymore + +ResourceCopy +ResourceCopyRegion +ResourceConvert (D3D10.1+ only) +ResourceConvertRegion (D3D10.1+ only) + -> resource_copy_region + - Gallium does not support hardware buffer copies + - Gallium does not support copying 3D texture subregions in a single call + +ResourceIsStagingBusy -> is_texture_referenced, is_buffer_referenced + - Gallium does not support checking reference for a whole texture, but only a specific surface + +ResourceReadAfterWriteHazard + ! Gallium specifies hides this, except for the render and texture caches + +ResourceResolveSubresource -> resource_resolve + +ResourceMap +ResourceUnmap +DynamicConstantBufferMapDiscard +DynamicConstantBufferUnmap +DynamicIABufferMapDiscard +DynamicIABufferMapNoOverwrite +DynamicIABufferUnmap +DynamicResourceMapDiscard +DynamicResourceUnmap +StagingResourceMap +StagingResourceUnmap + -> buffer_map / buffer_unmap + -> transfer functions + ! Gallium and D3D have different semantics for transfers + * D3D separates vertex/index buffers from constant buffers + ! D3D separates some buffer flags into specialized calls + +ResourceUpdateSubresourceUP -> transfer functionality, transfer_inline_write in gallium-resources +DefaultConstantBufferUpdateSubresourceUP -> transfer functionality, transfer_inline_write in gallium-resources + +SetBlendState -> bind_blend_state, set_blend_color and set_sample_mask + ! D3D11 fuses bind_blend_state, set_blend_color and set_sample_mask in a single function + +SetDepthStencilState -> bind_depth_stencil_alpha_state and set_stencil_ref + ! D3D11 fuses bind_depth_stencil_alpha_state and set_stencil_ref in a single function + +SetPredication -> render_condition + # here both D3D11 and Gallium seem very limited (hardware is too, probably though) + # ideally, we should support nested conditional rendering, as well as more complex tests (checking for an arbitrary range, after an AND with arbitrary mask ) + # of couse, hardware support is probably as limited as OpenGL/D3D11 + + Gallium, like NV_conditional_render, supports by-region and wait flags + - D3D11 supports predication conditional on being equal any value (along with occlusion predicates); Gallium only supports on non-zero + +SetRasterizerState -> bind_rasterizer_state + +SetRenderTargets (extended in D3D11) -> set_framebuffer_state + ! Gallium passed a width/height here, D3D11 does not + ! Gallium lacks ClearTargets (but this is redundant and the driver can trivially compute this if desired) + - Gallium does not support unordered access views + - Gallium does not support geometry shader selection of texture array image / 3D texture zslice + +SetResourceMinLOD (D3D11 only) + - Gallium does not support min lod directly on textures + +SetScissorRects + - Gallium lacks support for multiple geometry-shader-selectable scissor rectangles D3D11 has + +SetTextFilterSize + - Gallium lacks support for text filters + +SetVertexPipelineOutput (D3D10.1+ only) + # used to do vertex processing on the GPU on Intel G45 chipsets when it is faster this way (see www.intel.com/Assets/PDF/whitepaper/322931.pdf) + - Gallium does not support vertex pipeline bypass anymore + +SetViewports + - Gallium lacks support for multiple geometry-shader-selectable viewports D3D11 has + +ShaderResourceViewReadAfterWriteHazard -> flush(PIPE_FLUSH_RENDER_CACHE) + - Gallium does not support specifying this per-render-target/view + +SoSetTargets -> set_stream_output_buffers + +VsSetConstantBuffers -> for(i = StartBuffer; i < NumBuffers; ++i) set_constant_buffer(PIPE_SHADER_VERTEX, i, phBuffers[i]) + * may want to split into fragment/vertex-specific versions + +VsSetSamplers -> bind_vertex_sampler_states + * may want to allow binding subsets instead of all at once + +VsSetShader -> bind_vs_state + +VsSetShaderWithIfaces (D3D11 only) + - Gallium does not support shader interfaces + +VsSetShaderResources -> set_fragment_sampler_views + * may want to allow binding subsets instead of all at once --- mesa-7.9~git20100924.orig/src/gallium/docs/source/context.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/context.rst @@ -0,0 +1,348 @@ +.. _context: + +Context +======= + +The context object represents the purest, most directly accessible, abilities +of the device's 3D rendering pipeline. + +Methods +------- + +CSO State +^^^^^^^^^ + +All CSO state is created, bound, and destroyed, with triplets of methods that +all follow a specific naming scheme. For example, ``create_blend_state``, +``bind_blend_state``, and ``destroy_blend_state``. + +CSO objects handled by the context object: + +* :ref:`Blend`: ``*_blend_state`` +* :ref:`Sampler`: These are special; they can be bound to either vertex or + fragment samplers, and they are bound in groups. + ``bind_fragment_sampler_states``, ``bind_vertex_sampler_states`` +* :ref:`Rasterizer`: ``*_rasterizer_state`` +* :ref:`Depth, Stencil, & Alpha`: ``*_depth_stencil_alpha_state`` +* :ref:`Shader`: These have two sets of methods. ``*_fs_state`` is for + fragment shaders, and ``*_vs_state`` is for vertex shaders. +* :ref:`Vertex Elements`: ``*_vertex_elements_state`` + + +Resource Binding State +^^^^^^^^^^^^^^^^^^^^^^ + +This state describes how resources in various flavours (textures, +buffers, surfaces) are bound to the driver. + + +* ``set_constant_buffer`` sets a constant buffer to be used for a given shader + type. index is used to indicate which buffer to set (some apis may allow + multiple ones to be set, and binding a specific one later, though drivers + are mostly restricted to the first one right now). + +* ``set_framebuffer_state`` + +* ``set_vertex_buffers`` + +* ``set_index_buffer`` + +Non-CSO State +^^^^^^^^^^^^^ + +These pieces of state are too small, variable, and/or trivial to have CSO +objects. They all follow simple, one-method binding calls, e.g. +``set_blend_color``. + +* ``set_stencil_ref`` sets the stencil front and back reference values + which are used as comparison values in stencil test. +* ``set_blend_color`` +* ``set_sample_mask`` +* ``set_clip_state`` +* ``set_polygon_stipple`` +* ``set_scissor_state`` sets the bounds for the scissor test, which culls + pixels before blending to render targets. If the :ref:`Rasterizer` does + not have the scissor test enabled, then the scissor bounds never need to + be set since they will not be used. Note that scissor xmin and ymin are + inclusive, but xmax and ymax are exclusive. The inclusive ranges in x + and y would be [xmin..xmax-1] and [ymin..ymax-1]. +* ``set_viewport_state`` + + +Sampler Views +^^^^^^^^^^^^^ + +These are the means to bind textures to shader stages. To create one, specify +its format, swizzle and LOD range in sampler view template. + +If texture format is different than template format, it is said the texture +is being cast to another format. Casting can be done only between compatible +formats, that is formats that have matching component order and sizes. + +Swizzle fields specify they way in which fetched texel components are placed +in the result register. For example, ``swizzle_r`` specifies what is going to be +placed in first component of result register. + +The ``first_level`` and ``last_level`` fields of sampler view template specify +the LOD range the texture is going to be constrained to. + +* ``set_fragment_sampler_views`` binds an array of sampler views to + fragment shader stage. Every binding point acquires a reference + to a respective sampler view and releases a reference to the previous + sampler view. + +* ``set_vertex_sampler_views`` binds an array of sampler views to vertex + shader stage. Every binding point acquires a reference to a respective + sampler view and releases a reference to the previous sampler view. + +* ``create_sampler_view`` creates a new sampler view. ``texture`` is associated + with the sampler view which results in sampler view holding a reference + to the texture. Format specified in template must be compatible + with texture format. + +* ``sampler_view_destroy`` destroys a sampler view and releases its reference + to associated texture. + + +Clearing +^^^^^^^^ + +Clear is one of the most difficult concepts to nail down to a single +interface (due to both different requirements from APIs and also driver/hw +specific differences). + +``clear`` initializes some or all of the surfaces currently bound to +the framebuffer to particular RGBA, depth, or stencil values. +Currently, this does not take into account color or stencil write masks (as +used by GL), and always clears the whole surfaces (no scissoring as used by +GL clear or explicit rectangles like d3d9 uses). It can, however, also clear +only depth or stencil in a combined depth/stencil surface, if the driver +supports PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE. +If a surface includes several layers/slices (XXX: not yet...) then all layers +will be cleared. + +``clear_render_target`` clears a single color rendertarget with the specified +color value. While it is only possible to clear one surface at a time (which can +include several layers), this surface need not be bound to the framebuffer. + +``clear_depth_stencil`` clears a single depth, stencil or depth/stencil surface +with the specified depth and stencil values (for combined depth/stencil buffers, +is is also possible to only clear one or the other part). While it is only +possible to clear one surface at a time (which can include several layers), +this surface need not be bound to the framebuffer. + + +Drawing +^^^^^^^ + +``draw_vbo`` draws a specified primitive. The primitive mode and other +properties are described by ``pipe_draw_info``. + +The ``mode``, ``start``, and ``count`` fields of ``pipe_draw_info`` specify the +the mode of the primitive and the vertices to be fetched, in the range between +``start`` to ``start``+``count``-1, inclusive. + +Every instance with instanceID in the range between ``start_instance`` and +``start_instance``+``instance_count``-1, inclusive, will be drawn. + +All vertex indices must fall inside the range given by ``min_index`` and +``max_index``. In case non-indexed draw, ``min_index`` should be set to +``start`` and ``max_index`` should be set to ``start``+``count``-1. + +``index_bias`` is a value added to every vertex index before fetching vertex +attributes. It does not affect ``min_index`` and ``max_index``. + +If there is an index buffer bound, and ``indexed`` field is true, all vertex +indices will be looked up in the index buffer. ``min_index``, ``max_index``, +and ``index_bias`` apply after index lookup. + +If a given vertex element has ``instance_divisor`` set to 0, it is said +it contains per-vertex data and effective vertex attribute address needs +to be recalculated for every index. + + attribAddr = ``stride`` * index + ``src_offset`` + +If a given vertex element has ``instance_divisor`` set to non-zero, +it is said it contains per-instance data and effective vertex attribute +address needs to recalculated for every ``instance_divisor``-th instance. + + attribAddr = ``stride`` * instanceID / ``instance_divisor`` + ``src_offset`` + +In the above formulas, ``src_offset`` is taken from the given vertex element +and ``stride`` is taken from a vertex buffer associated with the given +vertex element. + +The calculated attribAddr is used as an offset into the vertex buffer to +fetch the attribute data. + +The value of ``instanceID`` can be read in a vertex shader through a system +value register declared with INSTANCEID semantic name. + + +Queries +^^^^^^^ + +Queries gather some statistic from the 3D pipeline over one or more +draws. Queries may be nested, though no state tracker currently +exercises this. + +Queries can be created with ``create_query`` and deleted with +``destroy_query``. To start a query, use ``begin_query``, and when finished, +use ``end_query`` to end the query. + +``get_query_result`` is used to retrieve the results of a query. If +the ``wait`` parameter is TRUE, then the ``get_query_result`` call +will block until the results of the query are ready (and TRUE will be +returned). Otherwise, if the ``wait`` parameter is FALSE, the call +will not block and the return value will be TRUE if the query has +completed or FALSE otherwise. + +The most common type of query is the occlusion query, +``PIPE_QUERY_OCCLUSION_COUNTER``, which counts the number of fragments which +are written to the framebuffer without being culled by +:ref:`Depth, Stencil, & Alpha` testing or shader KILL instructions. + +Another type of query, ``PIPE_QUERY_TIME_ELAPSED``, returns the amount of +time, in nanoseconds, the context takes to perform operations. + +Gallium does not guarantee the availability of any query types; one must +always check the capabilities of the :ref:`Screen` first. + + +Conditional Rendering +^^^^^^^^^^^^^^^^^^^^^ + +A drawing command can be skipped depending on the outcome of a query +(typically an occlusion query). The ``render_condition`` function specifies +the query which should be checked prior to rendering anything. + +If ``render_condition`` is called with ``query`` = NULL, conditional +rendering is disabled and drawing takes place normally. + +If ``render_condition`` is called with a non-null ``query`` subsequent +drawing commands will be predicated on the outcome of the query. If +the query result is zero subsequent drawing commands will be skipped. + +If ``mode`` is PIPE_RENDER_COND_WAIT the driver will wait for the +query to complete before deciding whether to render. + +If ``mode`` is PIPE_RENDER_COND_NO_WAIT and the query has not yet +completed, the drawing command will be executed normally. If the query +has completed, drawing will be predicated on the outcome of the query. + +If ``mode`` is PIPE_RENDER_COND_BY_REGION_WAIT or +PIPE_RENDER_COND_BY_REGION_NO_WAIT rendering will be predicated as above +for the non-REGION modes but in the case that an occulusion query returns +a non-zero result, regions which were occluded may be ommitted by subsequent +drawing commands. This can result in better performance with some GPUs. +Normally, if the occlusion query returned a non-zero result subsequent +drawing happens normally so fragments may be generated, shaded and +processed even where they're known to be obscured. + + +Flushing +^^^^^^^^ + +``flush`` + + +Resource Busy Queries +^^^^^^^^^^^^^^^^^^^^^ + +``is_resource_referenced`` + + + +Blitting +^^^^^^^^ + +These methods emulate classic blitter controls. + +These methods operate directly on ``pipe_resource`` objects, and stand +apart from any 3D state in the context. Blitting functionality may be +moved to a separate abstraction at some point in the future. + +``resource_copy_region`` blits a region of a subresource of a resource to a +region of another subresource of a resource, provided that both resources have +the same format, or compatible formats, i.e., formats for which copying the +bytes from the source resource unmodified to the destination resource will +achieve the same effect of a textured quad blitter. The source and destination +may be the same resource, but overlapping blits are not permitted. + +``resource_resolve`` resolves a multisampled resource into a non-multisampled +one. Formats and dimensions must match. This function must be present if a driver +supports multisampling. + +The interfaces to these calls are likely to change to make it easier +for a driver to batch multiple blits with the same source and +destination. + + +Stream Output +^^^^^^^^^^^^^ + +Stream output, also known as transform feedback allows writing the results of the +vertex pipeline (after the geometry shader or vertex shader if no geometry shader +is present) to be written to a buffer created with a ``PIPE_BIND_STREAM_OUTPUT`` +flag. + +First a stream output state needs to be created with the +``create_stream_output_state`` call. It specific the details of what's being written, +to which buffer and with what kind of a writemask. + +Then target buffers needs to be set with the call to ``set_stream_output_buffers`` +which sets the buffers and the offsets from the start of those buffer to where +the data will be written to. + + +Transfers +^^^^^^^^^ + +These methods are used to get data to/from a resource. + +``get_transfer`` creates a transfer object. + +``transfer_destroy`` destroys the transfer object. May cause +data to be written to the resource at this point. + +``transfer_map`` creates a memory mapping for the transfer object. +The returned map points to the start of the mapped range according to +the box region, not the beginning of the resource. + +``transfer_unmap`` remove the memory mapping for the transfer object. +Any pointers into the map should be considered invalid and discarded. + +``transfer_inline_write`` performs a simplified transfer for simple writes. +Basically get_transfer, transfer_map, data write, transfer_unmap, and +transfer_destroy all in one. + +.. _transfer_flush_region: + +transfer_flush_region +%%%%%%%%%%%%%%%%%%%%% + +If a transfer was created with ``FLUSH_EXPLICIT``, it will not automatically +be flushed on write or unmap. Flushes must be requested with +``transfer_flush_region``. Flush ranges are relative to the mapped range, not +the beginning of the resource. + +.. _pipe_transfer: + +PIPE_TRANSFER +^^^^^^^^^^^^^ + +These flags control the behavior of a transfer object. + +* ``READ``: resource contents are read at transfer create time. +* ``WRITE``: resource contents will be written back at transfer destroy time. +* ``MAP_DIRECTLY``: a transfer should directly map the resource. May return + NULL if not supported. +* ``DISCARD``: The memory within the mapped region is discarded. + Cannot be used with ``READ``. +* ``DONTBLOCK``: Fail if the resource cannot be mapped immediately. +* ``UNSYNCHRONIZED``: Do not synchronize pending operations on the resource + when mapping. The interaction of any writes to the map and any + operations pending on the resource are undefined. Cannot be used with + ``READ``. +* ``FLUSH_EXPLICIT``: Written ranges will be notified later with + :ref:`transfer_flush_region`. Cannot be used with ``READ``. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/glossary.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/glossary.rst @@ -0,0 +1,27 @@ +Glossary +======== + +.. glossary:: + :sorted: + + MSAA + Multi-Sampled Anti-Aliasing. A basic anti-aliasing technique that takes + multiple samples of the depth buffer, and uses this information to + smooth the edges of polygons. + + TCL + Transform, Clipping, & Lighting. The three stages of preparation in a + rasterizing pipeline prior to the actual rasterization of vertices into + fragments. + + NPOT + Non-power-of-two. Usually applied to textures which have at least one + dimension which is not a power of two. + + LOD + Level of Detail. Also spelled "LoD." The value that determines when the + switches between mipmaps occur during texture sampling. + + GLSL + GL Shading Language. The official, common high-level shader language used + in GL 2.0 and above. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/index.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/index.rst @@ -0,0 +1,30 @@ +.. Gallium documentation master file, created by + sphinx-quickstart on Sun Dec 20 14:09:05 2009. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Gallium's documentation! +=================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + intro + debugging + tgsi + screen + resources + context + cso + distro + glossary + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + --- mesa-7.9~git20100924.orig/src/gallium/docs/source/debugging.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/debugging.rst @@ -0,0 +1,105 @@ +Debugging +========= + +Debugging utilities in gallium. + +Debug Variables +^^^^^^^^^^^^^^^ + +All drivers respond to a set of common debug environment variables, as well as +some driver-specific variables. Set them as normal environment variables for +the platform or operating system you are running. For example, for Linux this +can be done by typing "export var=value" into a console and then running the +program from that console. + +Common +"""""" + +.. envvar:: GALLIUM_PRINT_OPTIONS (false) + +This option controls if the debug variables should be printed to stderr. This +is probably the most useful variable, since it allows you to find which +variables a driver uses. + +.. envvar:: GALLIUM_GALAHAD (false) + +Controls if the :ref:`galahad` sanity checker module should be used. + +.. envvar:: GALLIUM_RBUG (false) + +Controls if the :ref:`rbug` should be used. + +.. envvar:: GALLIUM_TRACE ("") + +If set, this variable will cause the :ref:`Trace` output to be written to the +specified file. Paths may be relative or absolute; relative paths are relative +to the working directory. For example, setting it to "trace.xml" will cause +the trace to be written to a file of the same name in the working directory. + +.. envvar:: GALLIUM_DUMP_CPU (false) + +Dump information about the current CPU that the driver is running on. + +.. envvar:: TGSI_PRINT_SANITY (false) + +Gallium has a built-in shader sanity checker. This option controls whether +the shader sanity checker prints its warnings and errors to stderr. + +.. envvar:: DRAW_USE_LLVM (false) + +Whether the :ref:`Draw` module will attempt to use LLVM for vertex and geometry shaders. + + +State tracker-specific +"""""""""""""""""""""" + +.. envvar:: ST_DEBUG (0x0) + +Debug :ref:`flags` for the GL state tracker. + + +Driver-specific +""""""""""""""" + +.. envvar:: I915_DEBUG (0x0) + +Debug :ref:`flags` for the i915 driver. + +.. envvar:: I915_NO_HW (false) + +Stop the i915 driver from submitting commands to the hardware. + +.. envvar:: I915_DUMP_CMD (false) + +Dump all commands going to the hardware. + +.. envvar:: LP_DEBUG (0x0) + +Debug :ref:`flags` for the llvmpipe driver. + +.. envvar:: LP_NUM_THREADS (number of CPUs) + +Number of threads that the llvmpipe driver should use. + + +.. _flags: + +Flags +""""" + +The variables of type "flags" all take a string with comma-separated flags to +enable different debugging for different parts of the drivers or state +tracker. If set to "help", the driver will print a list of flags which the +variable accepts. Order does not matter. + + +.. _rbug: + +Remote Debugger +^^^^^^^^^^^^^^^ + +The remote debugger, commonly known as rbug, allows for runtime inspections of +:ref:`Context`, :ref:`Screen`, :ref:`Resource` and :ref:`Shader` objects; and +pausing and stepping of :ref:`Draw` calls. Is used with rbug-gui which is +hosted outside of the main mesa repository. rbug is can be used over a network +connection, so the debugger does not need to be on the same machine. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/tgsi.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/tgsi.rst @@ -0,0 +1,1501 @@ +TGSI +==== + +TGSI, Tungsten Graphics Shader Infrastructure, is an intermediate language +for describing shaders. Since Gallium is inherently shaderful, shaders are +an important part of the API. TGSI is the only intermediate representation +used by all drivers. + +Basics +------ + +All TGSI instructions, known as *opcodes*, operate on arbitrary-precision +floating-point four-component vectors. An opcode may have up to one +destination register, known as *dst*, and between zero and three source +registers, called *src0* through *src2*, or simply *src* if there is only +one. + +Some instructions, like :opcode:`I2F`, permit re-interpretation of vector +components as integers. Other instructions permit using registers as +two-component vectors with double precision; see :ref:`Double Opcodes`. + +When an instruction has a scalar result, the result is usually copied into +each of the components of *dst*. When this happens, the result is said to be +*replicated* to *dst*. :opcode:`RCP` is one such instruction. + +Instruction Set +--------------- + +Core ISA +^^^^^^^^^^^^^^^^^^^^^^^^^ + +These opcodes are guaranteed to be available regardless of the driver being +used. + +.. opcode:: ARL - Address Register Load + +.. math:: + + dst.x = \lfloor src.x\rfloor + + dst.y = \lfloor src.y\rfloor + + dst.z = \lfloor src.z\rfloor + + dst.w = \lfloor src.w\rfloor + + +.. opcode:: MOV - Move + +.. math:: + + dst.x = src.x + + dst.y = src.y + + dst.z = src.z + + dst.w = src.w + + +.. opcode:: LIT - Light Coefficients + +.. math:: + + dst.x = 1 + + dst.y = max(src.x, 0) + + dst.z = (src.x > 0) ? max(src.y, 0)^{clamp(src.w, -128, 128))} : 0 + + dst.w = 1 + + +.. opcode:: RCP - Reciprocal + +This instruction replicates its result. + +.. math:: + + dst = \frac{1}{src.x} + + +.. opcode:: RSQ - Reciprocal Square Root + +This instruction replicates its result. + +.. math:: + + dst = \frac{1}{\sqrt{|src.x|}} + + +.. opcode:: EXP - Approximate Exponential Base 2 + +.. math:: + + dst.x = 2^{\lfloor src.x\rfloor} + + dst.y = src.x - \lfloor src.x\rfloor + + dst.z = 2^{src.x} + + dst.w = 1 + + +.. opcode:: LOG - Approximate Logarithm Base 2 + +.. math:: + + dst.x = \lfloor\log_2{|src.x|}\rfloor + + dst.y = \frac{|src.x|}{2^{\lfloor\log_2{|src.x|}\rfloor}} + + dst.z = \log_2{|src.x|} + + dst.w = 1 + + +.. opcode:: MUL - Multiply + +.. math:: + + dst.x = src0.x \times src1.x + + dst.y = src0.y \times src1.y + + dst.z = src0.z \times src1.z + + dst.w = src0.w \times src1.w + + +.. opcode:: ADD - Add + +.. math:: + + dst.x = src0.x + src1.x + + dst.y = src0.y + src1.y + + dst.z = src0.z + src1.z + + dst.w = src0.w + src1.w + + +.. opcode:: DP3 - 3-component Dot Product + +This instruction replicates its result. + +.. math:: + + dst = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + + +.. opcode:: DP4 - 4-component Dot Product + +This instruction replicates its result. + +.. math:: + + dst = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src0.w \times src1.w + + +.. opcode:: DST - Distance Vector + +.. math:: + + dst.x = 1 + + dst.y = src0.y \times src1.y + + dst.z = src0.z + + dst.w = src1.w + + +.. opcode:: MIN - Minimum + +.. math:: + + dst.x = min(src0.x, src1.x) + + dst.y = min(src0.y, src1.y) + + dst.z = min(src0.z, src1.z) + + dst.w = min(src0.w, src1.w) + + +.. opcode:: MAX - Maximum + +.. math:: + + dst.x = max(src0.x, src1.x) + + dst.y = max(src0.y, src1.y) + + dst.z = max(src0.z, src1.z) + + dst.w = max(src0.w, src1.w) + + +.. opcode:: SLT - Set On Less Than + +.. math:: + + dst.x = (src0.x < src1.x) ? 1 : 0 + + dst.y = (src0.y < src1.y) ? 1 : 0 + + dst.z = (src0.z < src1.z) ? 1 : 0 + + dst.w = (src0.w < src1.w) ? 1 : 0 + + +.. opcode:: SGE - Set On Greater Equal Than + +.. math:: + + dst.x = (src0.x >= src1.x) ? 1 : 0 + + dst.y = (src0.y >= src1.y) ? 1 : 0 + + dst.z = (src0.z >= src1.z) ? 1 : 0 + + dst.w = (src0.w >= src1.w) ? 1 : 0 + + +.. opcode:: MAD - Multiply And Add + +.. math:: + + dst.x = src0.x \times src1.x + src2.x + + dst.y = src0.y \times src1.y + src2.y + + dst.z = src0.z \times src1.z + src2.z + + dst.w = src0.w \times src1.w + src2.w + + +.. opcode:: SUB - Subtract + +.. math:: + + dst.x = src0.x - src1.x + + dst.y = src0.y - src1.y + + dst.z = src0.z - src1.z + + dst.w = src0.w - src1.w + + +.. opcode:: LRP - Linear Interpolate + +.. math:: + + dst.x = src0.x \times src1.x + (1 - src0.x) \times src2.x + + dst.y = src0.y \times src1.y + (1 - src0.y) \times src2.y + + dst.z = src0.z \times src1.z + (1 - src0.z) \times src2.z + + dst.w = src0.w \times src1.w + (1 - src0.w) \times src2.w + + +.. opcode:: CND - Condition + +.. math:: + + dst.x = (src2.x > 0.5) ? src0.x : src1.x + + dst.y = (src2.y > 0.5) ? src0.y : src1.y + + dst.z = (src2.z > 0.5) ? src0.z : src1.z + + dst.w = (src2.w > 0.5) ? src0.w : src1.w + + +.. opcode:: DP2A - 2-component Dot Product And Add + +.. math:: + + dst.x = src0.x \times src1.x + src0.y \times src1.y + src2.x + + dst.y = src0.x \times src1.x + src0.y \times src1.y + src2.x + + dst.z = src0.x \times src1.x + src0.y \times src1.y + src2.x + + dst.w = src0.x \times src1.x + src0.y \times src1.y + src2.x + + +.. opcode:: FRC - Fraction + +.. math:: + + dst.x = src.x - \lfloor src.x\rfloor + + dst.y = src.y - \lfloor src.y\rfloor + + dst.z = src.z - \lfloor src.z\rfloor + + dst.w = src.w - \lfloor src.w\rfloor + + +.. opcode:: CLAMP - Clamp + +.. math:: + + dst.x = clamp(src0.x, src1.x, src2.x) + + dst.y = clamp(src0.y, src1.y, src2.y) + + dst.z = clamp(src0.z, src1.z, src2.z) + + dst.w = clamp(src0.w, src1.w, src2.w) + + +.. opcode:: FLR - Floor + +This is identical to :opcode:`ARL`. + +.. math:: + + dst.x = \lfloor src.x\rfloor + + dst.y = \lfloor src.y\rfloor + + dst.z = \lfloor src.z\rfloor + + dst.w = \lfloor src.w\rfloor + + +.. opcode:: ROUND - Round + +.. math:: + + dst.x = round(src.x) + + dst.y = round(src.y) + + dst.z = round(src.z) + + dst.w = round(src.w) + + +.. opcode:: EX2 - Exponential Base 2 + +This instruction replicates its result. + +.. math:: + + dst = 2^{src.x} + + +.. opcode:: LG2 - Logarithm Base 2 + +This instruction replicates its result. + +.. math:: + + dst = \log_2{src.x} + + +.. opcode:: POW - Power + +This instruction replicates its result. + +.. math:: + + dst = src0.x^{src1.x} + +.. opcode:: XPD - Cross Product + +.. math:: + + dst.x = src0.y \times src1.z - src1.y \times src0.z + + dst.y = src0.z \times src1.x - src1.z \times src0.x + + dst.z = src0.x \times src1.y - src1.x \times src0.y + + dst.w = 1 + + +.. opcode:: ABS - Absolute + +.. math:: + + dst.x = |src.x| + + dst.y = |src.y| + + dst.z = |src.z| + + dst.w = |src.w| + + +.. opcode:: RCC - Reciprocal Clamped + +This instruction replicates its result. + +XXX cleanup on aisle three + +.. math:: + + dst = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020) + + +.. opcode:: DPH - Homogeneous Dot Product + +This instruction replicates its result. + +.. math:: + + dst = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + + +.. opcode:: COS - Cosine + +This instruction replicates its result. + +.. math:: + + dst = \cos{src.x} + + +.. opcode:: DDX - Derivative Relative To X + +.. math:: + + dst.x = partialx(src.x) + + dst.y = partialx(src.y) + + dst.z = partialx(src.z) + + dst.w = partialx(src.w) + + +.. opcode:: DDY - Derivative Relative To Y + +.. math:: + + dst.x = partialy(src.x) + + dst.y = partialy(src.y) + + dst.z = partialy(src.z) + + dst.w = partialy(src.w) + + +.. opcode:: KILP - Predicated Discard + + discard + + +.. opcode:: PK2H - Pack Two 16-bit Floats + + TBD + + +.. opcode:: PK2US - Pack Two Unsigned 16-bit Scalars + + TBD + + +.. opcode:: PK4B - Pack Four Signed 8-bit Scalars + + TBD + + +.. opcode:: PK4UB - Pack Four Unsigned 8-bit Scalars + + TBD + + +.. opcode:: RFL - Reflection Vector + +.. math:: + + dst.x = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.x - src1.x + + dst.y = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.y - src1.y + + dst.z = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.z - src1.z + + dst.w = 1 + +.. note:: + + Considered for removal. + + +.. opcode:: SEQ - Set On Equal + +.. math:: + + dst.x = (src0.x == src1.x) ? 1 : 0 + + dst.y = (src0.y == src1.y) ? 1 : 0 + + dst.z = (src0.z == src1.z) ? 1 : 0 + + dst.w = (src0.w == src1.w) ? 1 : 0 + + +.. opcode:: SFL - Set On False + +This instruction replicates its result. + +.. math:: + + dst = 0 + +.. note:: + + Considered for removal. + + +.. opcode:: SGT - Set On Greater Than + +.. math:: + + dst.x = (src0.x > src1.x) ? 1 : 0 + + dst.y = (src0.y > src1.y) ? 1 : 0 + + dst.z = (src0.z > src1.z) ? 1 : 0 + + dst.w = (src0.w > src1.w) ? 1 : 0 + + +.. opcode:: SIN - Sine + +This instruction replicates its result. + +.. math:: + + dst = \sin{src.x} + + +.. opcode:: SLE - Set On Less Equal Than + +.. math:: + + dst.x = (src0.x <= src1.x) ? 1 : 0 + + dst.y = (src0.y <= src1.y) ? 1 : 0 + + dst.z = (src0.z <= src1.z) ? 1 : 0 + + dst.w = (src0.w <= src1.w) ? 1 : 0 + + +.. opcode:: SNE - Set On Not Equal + +.. math:: + + dst.x = (src0.x != src1.x) ? 1 : 0 + + dst.y = (src0.y != src1.y) ? 1 : 0 + + dst.z = (src0.z != src1.z) ? 1 : 0 + + dst.w = (src0.w != src1.w) ? 1 : 0 + + +.. opcode:: STR - Set On True + +This instruction replicates its result. + +.. math:: + + dst = 1 + + +.. opcode:: TEX - Texture Lookup + + TBD + + +.. opcode:: TXD - Texture Lookup with Derivatives + + TBD + + +.. opcode:: TXP - Projective Texture Lookup + + TBD + + +.. opcode:: UP2H - Unpack Two 16-Bit Floats + + TBD + +.. note:: + + Considered for removal. + +.. opcode:: UP2US - Unpack Two Unsigned 16-Bit Scalars + + TBD + +.. note:: + + Considered for removal. + +.. opcode:: UP4B - Unpack Four Signed 8-Bit Values + + TBD + +.. note:: + + Considered for removal. + +.. opcode:: UP4UB - Unpack Four Unsigned 8-Bit Scalars + + TBD + +.. note:: + + Considered for removal. + +.. opcode:: X2D - 2D Coordinate Transformation + +.. math:: + + dst.x = src0.x + src1.x \times src2.x + src1.y \times src2.y + + dst.y = src0.y + src1.x \times src2.z + src1.y \times src2.w + + dst.z = src0.x + src1.x \times src2.x + src1.y \times src2.y + + dst.w = src0.y + src1.x \times src2.z + src1.y \times src2.w + +.. note:: + + Considered for removal. + + +.. opcode:: ARA - Address Register Add + + TBD + +.. note:: + + Considered for removal. + +.. opcode:: ARR - Address Register Load With Round + +.. math:: + + dst.x = round(src.x) + + dst.y = round(src.y) + + dst.z = round(src.z) + + dst.w = round(src.w) + + +.. opcode:: BRA - Branch + + pc = target + +.. note:: + + Considered for removal. + +.. opcode:: CAL - Subroutine Call + + push(pc) + pc = target + + +.. opcode:: RET - Subroutine Call Return + + pc = pop() + + Potential restrictions: + * Only occurs at end of function. + +.. opcode:: SSG - Set Sign + +.. math:: + + dst.x = (src.x > 0) ? 1 : (src.x < 0) ? -1 : 0 + + dst.y = (src.y > 0) ? 1 : (src.y < 0) ? -1 : 0 + + dst.z = (src.z > 0) ? 1 : (src.z < 0) ? -1 : 0 + + dst.w = (src.w > 0) ? 1 : (src.w < 0) ? -1 : 0 + + +.. opcode:: CMP - Compare + +.. math:: + + dst.x = (src0.x < 0) ? src1.x : src2.x + + dst.y = (src0.y < 0) ? src1.y : src2.y + + dst.z = (src0.z < 0) ? src1.z : src2.z + + dst.w = (src0.w < 0) ? src1.w : src2.w + + +.. opcode:: KIL - Conditional Discard + +.. math:: + + if (src.x < 0 || src.y < 0 || src.z < 0 || src.w < 0) + discard + endif + + +.. opcode:: SCS - Sine Cosine + +.. math:: + + dst.x = \cos{src.x} + + dst.y = \sin{src.x} + + dst.z = 0 + + dst.y = 1 + + +.. opcode:: TXB - Texture Lookup With Bias + + TBD + + +.. opcode:: NRM - 3-component Vector Normalise + +.. math:: + + dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + + dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + + dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + + dst.w = 1 + + +.. opcode:: DIV - Divide + +.. math:: + + dst.x = \frac{src0.x}{src1.x} + + dst.y = \frac{src0.y}{src1.y} + + dst.z = \frac{src0.z}{src1.z} + + dst.w = \frac{src0.w}{src1.w} + + +.. opcode:: DP2 - 2-component Dot Product + +This instruction replicates its result. + +.. math:: + + dst = src0.x \times src1.x + src0.y \times src1.y + + +.. opcode:: TXL - Texture Lookup With LOD + + TBD + + +.. opcode:: BRK - Break + + TBD + + +.. opcode:: IF - If + + TBD + + +.. opcode:: ELSE - Else + + TBD + + +.. opcode:: ENDIF - End If + + TBD + + +.. opcode:: PUSHA - Push Address Register On Stack + + push(src.x) + push(src.y) + push(src.z) + push(src.w) + +.. note:: + + Considered for cleanup. + +.. note:: + + Considered for removal. + +.. opcode:: POPA - Pop Address Register From Stack + + dst.w = pop() + dst.z = pop() + dst.y = pop() + dst.x = pop() + +.. note:: + + Considered for cleanup. + +.. note:: + + Considered for removal. + + +Compute ISA +^^^^^^^^^^^^^^^^^^^^^^^^ + +These opcodes are primarily provided for special-use computational shaders. +Support for these opcodes indicated by a special pipe capability bit (TBD). + +XXX so let's discuss it, yeah? + +.. opcode:: CEIL - Ceiling + +.. math:: + + dst.x = \lceil src.x\rceil + + dst.y = \lceil src.y\rceil + + dst.z = \lceil src.z\rceil + + dst.w = \lceil src.w\rceil + + +.. opcode:: I2F - Integer To Float + +.. math:: + + dst.x = (float) src.x + + dst.y = (float) src.y + + dst.z = (float) src.z + + dst.w = (float) src.w + + +.. opcode:: NOT - Bitwise Not + +.. math:: + + dst.x = ~src.x + + dst.y = ~src.y + + dst.z = ~src.z + + dst.w = ~src.w + + +.. opcode:: TRUNC - Truncate + +.. math:: + + dst.x = trunc(src.x) + + dst.y = trunc(src.y) + + dst.z = trunc(src.z) + + dst.w = trunc(src.w) + + +.. opcode:: SHL - Shift Left + +.. math:: + + dst.x = src0.x << src1.x + + dst.y = src0.y << src1.x + + dst.z = src0.z << src1.x + + dst.w = src0.w << src1.x + + +.. opcode:: SHR - Shift Right + +.. math:: + + dst.x = src0.x >> src1.x + + dst.y = src0.y >> src1.x + + dst.z = src0.z >> src1.x + + dst.w = src0.w >> src1.x + + +.. opcode:: AND - Bitwise And + +.. math:: + + dst.x = src0.x & src1.x + + dst.y = src0.y & src1.y + + dst.z = src0.z & src1.z + + dst.w = src0.w & src1.w + + +.. opcode:: OR - Bitwise Or + +.. math:: + + dst.x = src0.x | src1.x + + dst.y = src0.y | src1.y + + dst.z = src0.z | src1.z + + dst.w = src0.w | src1.w + + +.. opcode:: MOD - Modulus + +.. math:: + + dst.x = src0.x \bmod src1.x + + dst.y = src0.y \bmod src1.y + + dst.z = src0.z \bmod src1.z + + dst.w = src0.w \bmod src1.w + + +.. opcode:: XOR - Bitwise Xor + +.. math:: + + dst.x = src0.x \oplus src1.x + + dst.y = src0.y \oplus src1.y + + dst.z = src0.z \oplus src1.z + + dst.w = src0.w \oplus src1.w + + +.. opcode:: SAD - Sum Of Absolute Differences + +.. math:: + + dst.x = |src0.x - src1.x| + src2.x + + dst.y = |src0.y - src1.y| + src2.y + + dst.z = |src0.z - src1.z| + src2.z + + dst.w = |src0.w - src1.w| + src2.w + + +.. opcode:: TXF - Texel Fetch + + TBD + + +.. opcode:: TXQ - Texture Size Query + + TBD + + +.. opcode:: CONT - Continue + + TBD + +.. note:: + + Support for CONT is determined by a special capability bit, + ``TGSI_CONT_SUPPORTED``. See :ref:`Screen` for more information. + + +Geometry ISA +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +These opcodes are only supported in geometry shaders; they have no meaning +in any other type of shader. + +.. opcode:: EMIT - Emit + + TBD + + +.. opcode:: ENDPRIM - End Primitive + + TBD + + +GLSL ISA +^^^^^^^^^^ + +These opcodes are part of :term:`GLSL`'s opcode set. Support for these +opcodes is determined by a special capability bit, ``GLSL``. + +.. opcode:: BGNLOOP - Begin a Loop + + TBD + + +.. opcode:: BGNSUB - Begin Subroutine + + TBD + + +.. opcode:: ENDLOOP - End a Loop + + TBD + + +.. opcode:: ENDSUB - End Subroutine + + TBD + + +.. opcode:: NOP - No Operation + + Do nothing. + + +.. opcode:: NRM4 - 4-component Vector Normalise + +This instruction replicates its result. + +.. math:: + + dst = \frac{src.x}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w} + + +ps_2_x +^^^^^^^^^^^^ + +XXX wait what + +.. opcode:: CALLNZ - Subroutine Call If Not Zero + + TBD + + +.. opcode:: IFC - If + + TBD + + +.. opcode:: BREAKC - Break Conditional + + TBD + +.. _doubleopcodes: + +Double ISA +^^^^^^^^^^^^^^^ + +The double-precision opcodes reinterpret four-component vectors into +two-component vectors with doubled precision in each component. + +Support for these opcodes is XXX undecided. :T + +.. opcode:: DADD - Add + +.. math:: + + dst.xy = src0.xy + src1.xy + + dst.zw = src0.zw + src1.zw + + +.. opcode:: DDIV - Divide + +.. math:: + + dst.xy = src0.xy / src1.xy + + dst.zw = src0.zw / src1.zw + +.. opcode:: DSEQ - Set on Equal + +.. math:: + + dst.xy = src0.xy == src1.xy ? 1.0F : 0.0F + + dst.zw = src0.zw == src1.zw ? 1.0F : 0.0F + +.. opcode:: DSLT - Set on Less than + +.. math:: + + dst.xy = src0.xy < src1.xy ? 1.0F : 0.0F + + dst.zw = src0.zw < src1.zw ? 1.0F : 0.0F + +.. opcode:: DFRAC - Fraction + +.. math:: + + dst.xy = src.xy - \lfloor src.xy\rfloor + + dst.zw = src.zw - \lfloor src.zw\rfloor + + +.. opcode:: DFRACEXP - Convert Number to Fractional and Integral Components + +Like the ``frexp()`` routine in many math libraries, this opcode stores the +exponent of its source to ``dst0``, and the significand to ``dst1``, such that +:math:`dst1 \times 2^{dst0} = src` . + +.. math:: + + dst0.xy = exp(src.xy) + + dst1.xy = frac(src.xy) + + dst0.zw = exp(src.zw) + + dst1.zw = frac(src.zw) + +.. opcode:: DLDEXP - Multiply Number by Integral Power of 2 + +This opcode is the inverse of :opcode:`DFRACEXP`. + +.. math:: + + dst.xy = src0.xy \times 2^{src1.xy} + + dst.zw = src0.zw \times 2^{src1.zw} + +.. opcode:: DMIN - Minimum + +.. math:: + + dst.xy = min(src0.xy, src1.xy) + + dst.zw = min(src0.zw, src1.zw) + +.. opcode:: DMAX - Maximum + +.. math:: + + dst.xy = max(src0.xy, src1.xy) + + dst.zw = max(src0.zw, src1.zw) + +.. opcode:: DMUL - Multiply + +.. math:: + + dst.xy = src0.xy \times src1.xy + + dst.zw = src0.zw \times src1.zw + + +.. opcode:: DMAD - Multiply And Add + +.. math:: + + dst.xy = src0.xy \times src1.xy + src2.xy + + dst.zw = src0.zw \times src1.zw + src2.zw + + +.. opcode:: DRCP - Reciprocal + +.. math:: + + dst.xy = \frac{1}{src.xy} + + dst.zw = \frac{1}{src.zw} + +.. opcode:: DSQRT - Square Root + +.. math:: + + dst.xy = \sqrt{src.xy} + + dst.zw = \sqrt{src.zw} + + +Explanation of symbols used +------------------------------ + + +Functions +^^^^^^^^^^^^^^ + + + :math:`|x|` Absolute value of `x`. + + :math:`\lceil x \rceil` Ceiling of `x`. + + clamp(x,y,z) Clamp x between y and z. + (x < y) ? y : (x > z) ? z : x + + :math:`\lfloor x\rfloor` Floor of `x`. + + :math:`\log_2{x}` Logarithm of `x`, base 2. + + max(x,y) Maximum of x and y. + (x > y) ? x : y + + min(x,y) Minimum of x and y. + (x < y) ? x : y + + partialx(x) Derivative of x relative to fragment's X. + + partialy(x) Derivative of x relative to fragment's Y. + + pop() Pop from stack. + + :math:`x^y` `x` to the power `y`. + + push(x) Push x on stack. + + round(x) Round x. + + trunc(x) Truncate x, i.e. drop the fraction bits. + + +Keywords +^^^^^^^^^^^^^ + + + discard Discard fragment. + + pc Program counter. + + target Label of target instruction. + + +Other tokens +--------------- + + +Declaration +^^^^^^^^^^^ + + +Declares a register that is will be referenced as an operand in Instruction +tokens. + +File field contains register file that is being declared and is one +of TGSI_FILE. + +UsageMask field specifies which of the register components can be accessed +and is one of TGSI_WRITEMASK. + +Interpolate field is only valid for fragment shader INPUT register files. +It specifes the way input is being interpolated by the rasteriser and is one +of TGSI_INTERPOLATE. + +If Dimension flag is set to 1, a Declaration Dimension token follows. + +If Semantic flag is set to 1, a Declaration Semantic token follows. + +CylindricalWrap bitfield is only valid for fragment shader INPUT register +files. It specifies which register components should be subject to cylindrical +wrapping when interpolating by the rasteriser. If TGSI_CYLINDRICAL_WRAP_X +is set to 1, the X component should be interpolated according to cylindrical +wrapping rules. + + +Declaration Semantic +^^^^^^^^^^^^^^^^^^^^^^^^ + + Vertex and fragment shader input and output registers may be labeled + with semantic information consisting of a name and index. + + Follows Declaration token if Semantic bit is set. + + Since its purpose is to link a shader with other stages of the pipeline, + it is valid to follow only those Declaration tokens that declare a register + either in INPUT or OUTPUT file. + + SemanticName field contains the semantic name of the register being declared. + There is no default value. + + SemanticIndex is an optional subscript that can be used to distinguish + different register declarations with the same semantic name. The default value + is 0. + + The meanings of the individual semantic names are explained in the following + sections. + +TGSI_SEMANTIC_POSITION +"""""""""""""""""""""" + +For vertex shaders, TGSI_SEMANTIC_POSITION indicates the vertex shader +output register which contains the homogeneous vertex position in the clip +space coordinate system. After clipping, the X, Y and Z components of the +vertex will be divided by the W value to get normalized device coordinates. + +For fragment shaders, TGSI_SEMANTIC_POSITION is used to indicate that +fragment shader input contains the fragment's window position. The X +component starts at zero and always increases from left to right. +The Y component starts at zero and always increases but Y=0 may either +indicate the top of the window or the bottom depending on the fragment +coordinate origin convention (see TGSI_PROPERTY_FS_COORD_ORIGIN). +The Z coordinate ranges from 0 to 1 to represent depth from the front +to the back of the Z buffer. The W component contains the reciprocol +of the interpolated vertex position W component. + +Fragment shaders may also declare an output register with +TGSI_SEMANTIC_POSITION. Only the Z component is writable. This allows +the fragment shader to change the fragment's Z position. + + + +TGSI_SEMANTIC_COLOR +""""""""""""""""""" + +For vertex shader outputs or fragment shader inputs/outputs, this +label indicates that the resister contains an R,G,B,A color. + +Several shader inputs/outputs may contain colors so the semantic index +is used to distinguish them. For example, color[0] may be the diffuse +color while color[1] may be the specular color. + +This label is needed so that the flat/smooth shading can be applied +to the right interpolants during rasterization. + + + +TGSI_SEMANTIC_BCOLOR +"""""""""""""""""""" + +Back-facing colors are only used for back-facing polygons, and are only valid +in vertex shader outputs. After rasterization, all polygons are front-facing +and COLOR and BCOLOR end up occupying the same slots in the fragment shader, +so all BCOLORs effectively become regular COLORs in the fragment shader. + + +TGSI_SEMANTIC_FOG +""""""""""""""""" + +Vertex shader inputs and outputs and fragment shader inputs may be +labeled with TGSI_SEMANTIC_FOG to indicate that the register contains +a fog coordinate in the form (F, 0, 0, 1). Typically, the fragment +shader will use the fog coordinate to compute a fog blend factor which +is used to blend the normal fragment color with a constant fog color. + +Only the first component matters when writing from the vertex shader; +the driver will ensure that the coordinate is in this format when used +as a fragment shader input. + + +TGSI_SEMANTIC_PSIZE +""""""""""""""""""" + +Vertex shader input and output registers may be labeled with +TGIS_SEMANTIC_PSIZE to indicate that the register contains a point size +in the form (S, 0, 0, 1). The point size controls the width or diameter +of points for rasterization. This label cannot be used in fragment +shaders. + +When using this semantic, be sure to set the appropriate state in the +:ref:`rasterizer` first. + + +TGSI_SEMANTIC_GENERIC +""""""""""""""""""""" + +All vertex/fragment shader inputs/outputs not labeled with any other +semantic label can be considered to be generic attributes. Typical +uses of generic inputs/outputs are texcoords and user-defined values. + + +TGSI_SEMANTIC_NORMAL +"""""""""""""""""""" + +Indicates that a vertex shader input is a normal vector. This is +typically only used for legacy graphics APIs. + + +TGSI_SEMANTIC_FACE +"""""""""""""""""" + +This label applies to fragment shader inputs only and indicates that +the register contains front/back-face information of the form (F, 0, +0, 1). The first component will be positive when the fragment belongs +to a front-facing polygon, and negative when the fragment belongs to a +back-facing polygon. + + +TGSI_SEMANTIC_EDGEFLAG +"""""""""""""""""""""" + +For vertex shaders, this sematic label indicates that an input or +output is a boolean edge flag. The register layout is [F, x, x, x] +where F is 0.0 or 1.0 and x = don't care. Normally, the vertex shader +simply copies the edge flag input to the edgeflag output. + +Edge flags are used to control which lines or points are actually +drawn when the polygon mode converts triangles/quads/polygons into +points or lines. + + + +Properties +^^^^^^^^^^^^^^^^^^^^^^^^ + + + Properties are general directives that apply to the whole TGSI program. + +FS_COORD_ORIGIN +""""""""""""""" + +Specifies the fragment shader TGSI_SEMANTIC_POSITION coordinate origin. +The default value is UPPER_LEFT. + +If UPPER_LEFT, the position will be (0,0) at the upper left corner and +increase downward and rightward. +If LOWER_LEFT, the position will be (0,0) at the lower left corner and +increase upward and rightward. + +OpenGL defaults to LOWER_LEFT, and is configurable with the +GL_ARB_fragment_coord_conventions extension. + +DirectX 9/10 use UPPER_LEFT. + +FS_COORD_PIXEL_CENTER +""""""""""""""""""""" + +Specifies the fragment shader TGSI_SEMANTIC_POSITION pixel center convention. +The default value is HALF_INTEGER. + +If HALF_INTEGER, the fractionary part of the position will be 0.5 +If INTEGER, the fractionary part of the position will be 0.0 + +Note that this does not affect the set of fragments generated by +rasterization, which is instead controlled by gl_rasterization_rules in the +rasterizer. + +OpenGL defaults to HALF_INTEGER, and is configurable with the +GL_ARB_fragment_coord_conventions extension. + +DirectX 9 uses INTEGER. +DirectX 10 uses HALF_INTEGER. + + + +Texture Sampling and Texture Formats +------------------------------------ + +This table shows how texture image components are returned as (x,y,z,w) tuples +by TGSI texture instructions, such as :opcode:`TEX`, :opcode:`TXD`, and +:opcode:`TXP`. For reference, OpenGL and Direct3D conventions are shown as +well. + ++--------------------+--------------+--------------------+--------------+ +| Texture Components | Gallium | OpenGL | Direct3D 9 | ++====================+==============+====================+==============+ +| R | (r, 0, 0, 1) | (r, 0, 0, 1) | (r, 1, 1, 1) | ++--------------------+--------------+--------------------+--------------+ +| RG | (r, g, 0, 1) | (r, g, 0, 1) | (r, g, 1, 1) | ++--------------------+--------------+--------------------+--------------+ +| RGB | (r, g, b, 1) | (r, g, b, 1) | (r, g, b, 1) | ++--------------------+--------------+--------------------+--------------+ +| RGBA | (r, g, b, a) | (r, g, b, a) | (r, g, b, a) | ++--------------------+--------------+--------------------+--------------+ +| A | (0, 0, 0, a) | (0, 0, 0, a) | (0, 0, 0, a) | ++--------------------+--------------+--------------------+--------------+ +| L | (l, l, l, 1) | (l, l, l, 1) | (l, l, l, 1) | ++--------------------+--------------+--------------------+--------------+ +| LA | (l, l, l, a) | (l, l, l, a) | (l, l, l, a) | ++--------------------+--------------+--------------------+--------------+ +| I | (i, i, i, i) | (i, i, i, i) | N/A | ++--------------------+--------------+--------------------+--------------+ +| UV | XXX TBD | (0, 0, 0, 1) | (u, v, 1, 1) | +| | | [#envmap-bumpmap]_ | | ++--------------------+--------------+--------------------+--------------+ +| Z | XXX TBD | (z, z, z, 1) | (0, z, 0, 1) | +| | | [#depth-tex-mode]_ | | ++--------------------+--------------+--------------------+--------------+ + +.. [#envmap-bumpmap] http://www.opengl.org/registry/specs/ATI/envmap_bumpmap.txt +.. [#depth-tex-mode] the default is (z, z, z, 1) but may also be (0, 0, 0, z) + or (z, z, z, z) depending on the value of GL_DEPTH_TEXTURE_MODE. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/resources.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/resources.rst @@ -0,0 +1,195 @@ +Resources and derived objects +============================= + +Resources represent objects that hold data: textures and buffers. + +They are mostly modelled after the resources in Direct3D 10/11, but with a +different transfer/update mechanism, and more features for OpenGL support. + +Resources can be used in several ways, and it is required to specify all planned uses through an appropriate set of bind flags. + +TODO: write much more on resources + +Transfers +--------- + +Transfers are the mechanism used to access resources with the CPU. + +OpenGL: OpenGL supports mapping buffers and has inline transfer functions for both buffers and textures + +D3D11: D3D11 lacks transfers, but has special resource types that are mappable to the CPU address space + +TODO: write much more on transfers + +Resource targets +---------------- + +Resource targets determine the type of a resource. + +Note that drivers may not actually have the restrictions listed regarding +coordinate normalization and wrap modes, and in fact efficient OpenCL +support will probably require drivers that don't have any of them, which +will probably be advertised with an appropriate cap. + +TODO: document all targets. Note that both 3D and cube have restrictions +that depend on the hardware generation. + +TODO: can buffers have a non-R8 format? + +PIPE_BUFFER +^^^^^^^^^^^ + +Buffer resource: can be used as a vertex, index, constant buffer (appropriate bind flags must be requested). + +They can be bound to stream output if supported. +TODO: what about the restrictions lifted by the several later GL transform feedback extensions? How does one advertise that in Gallium? + +They can be also be bound to a shader stage as usual. +TODO: are all drivers supposed to support this? how does this work exactly? are there size limits? + +They can be also be bound to the framebuffer as usual. +TODO: are all drivers supposed to support this? how does this work exactly? are there size limits? +TODO: is there any chance of supporting GL pixel buffer object acceleration with this? + +- depth0 must be 1 +- last_level must be 0 +- TODO: what about normalization? +- TODO: wrap modes/other sampling state? +- TODO: are arbitrary formats supported? in which cases? + +OpenGL: vertex buffers in GL 1.5 or GL_ARB_vertex_buffer_object + +- Binding to stream out requires GL 3.0 or GL_NV_transform_feedback +- Binding as constant buffers requires GL 3.1 or GL_ARB_uniform_buffer_object +- Binding to a sampling stage requires GL 3.1 or GL_ARB_texture_buffer_object +- TODO: can they be bound to an FBO? + +D3D11: buffer resources +- Binding to a render target requires D3D_FEATURE_LEVEL_10_0 + +PIPE_TEXTURE_1D +^^^^^^^^^^^^^^^ +1D surface accessed with normalized coordinates. + +UNIMPLEMENTED: 1D texture arrays not supported + +- If PIPE_CAP_NPOT_TEXTURES is not supported, + width must be a power of two +- height0 must be 1 +- depth0 must be 1 +- Mipmaps can be used +- Must use normalized coordinates + +OpenGL: GL_TEXTURE_1D in GL 1.0 + +- PIPE_CAP_NPOT_TEXTURES is equivalent to GL 2.0 or GL_ARB_texture_non_power_of_two + +D3D11: 1D textures in D3D_FEATURE_LEVEL_10_0 + +PIPE_TEXTURE_RECT +^^^^^^^^^^^^^^^^^ +2D surface with OpenGL GL_TEXTURE_RECTANGLE semantics. + +- depth0 must be 1 +- last_level must be 0 +- Must use unnormalized coordinates +- Must use a clamp wrap mode + +OpenGL: GL_TEXTURE_RECTANGLE in GL 3.1 or GL_ARB_texture_rectangle or GL_NV_texture_rectangle + +OpenCL: can create OpenCL images based on this, that can then be sampled arbitrarily + +D3D11: not supported (only PIPE_TEXTURE_2D with normalized coordinates is supported) + +PIPE_TEXTURE_2D +^^^^^^^^^^^^^^^ +2D surface accessed with normalized coordinates. + +UNIMPLEMENTED: 2D texture arrays not supported + +- If PIPE_CAP_NPOT_TEXTURES is not supported, + width and height must be powers of two +- depth0 must be 1 +- Mipmaps can be used +- Must use normalized coordinates +- No special restrictions on wrap modes + +OpenGL: GL_TEXTURE_2D in GL 1.0 + +- PIPE_CAP_NPOT_TEXTURES is equivalent to GL 2.0 or GL_ARB_texture_non_power_of_two + +OpenCL: can create OpenCL images based on this, that can then be sampled arbitrarily + +D3D11: 2D textures + +- PIPE_CAP_NPOT_TEXTURES is equivalent to D3D_FEATURE_LEVEL_9_3 + +PIPE_TEXTURE_3D +^^^^^^^^^^^^^^^ + +3-dimensional array of texels. +Mipmap dimensions are reduced in all 3 coordinates. + +- If PIPE_CAP_NPOT_TEXTURES is not supported, + width, height and depth must be powers of two +- Must use normalized coordinates + +OpenGL: GL_TEXTURE_3D in GL 1.2 or GL_EXT_texture3D + +- PIPE_CAP_NPOT_TEXTURES is equivalent to GL 2.0 or GL_ARB_texture_non_power_of_two + +D3D11: 3D textures + +- PIPE_CAP_NPOT_TEXTURES is equivalent to D3D_FEATURE_LEVEL_10_0 + +PIPE_TEXTURE_CUBE +^^^^^^^^^^^^^^^^^ + +Cube maps consist of 6 2D faces. +The 6 surfaces form an imaginary cube, and sampling happens by mapping an +input 3-vector to the point of the cube surface in that direction. + +Sampling may be optionally seamless, resulting in filtering taking samples +from multiple surfaces near to the edge. +UNIMPLEMENTED: seamless cube map sampling not supported + +UNIMPLEMENTED: cube map arrays not supported + +- Width and height must be equal +- If PIPE_CAP_NPOT_TEXTURES is not supported, + width and height must be powers of two +- Must use normalized coordinates + +OpenGL: GL_TEXTURE_CUBE_MAP in GL 1.3 or EXT_texture_cube_map + +- PIPE_CAP_NPOT_TEXTURES is equivalent to GL 2.0 or GL_ARB_texture_non_power_of_two +- Seamless cube maps require GL 3.2 or GL_ARB_seamless_cube_map or GL_AMD_seamless_cubemap_per_texture +- Cube map arrays require GL 4.0 or GL_ARB_texture_cube_map_array + +D3D11: 2D array textures with the D3D11_RESOURCE_MISC_TEXTURECUBE flag + +- PIPE_CAP_NPOT_TEXTURES is equivalent to D3D_FEATURE_LEVEL_10_0 +- Cube map arrays require D3D_FEATURE_LEVEL_10_1 +- TODO: are (non)seamless cube maps supported in D3D11? how? + +Surfaces +-------- + +Surfaces are views of a resource that can be bound as a framebuffer to serve as the render target or depth buffer. + +TODO: write much more on surfaces + +OpenGL: FBOs are collections of surfaces in GL 3.0 or GL_ARB_framebuffer_object + +D3D11: render target views and depth/stencil views + +Sampler views +------------- + +Sampler views are views of a resource that can be bound to a pipeline stage to be sampled from shaders. + +TODO: write much more on sampler views + +OpenGL: texture objects are actually sampler view and resource in a single unit + +D3D11: shader resource views --- mesa-7.9~git20100924.orig/src/gallium/docs/source/screen.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/screen.rst @@ -0,0 +1,287 @@ +.. _screen: + +Screen +====== + +A screen is an object representing the context-independent part of a device. + +Flags and enumerations +---------------------- + +XXX some of these don't belong in this section. + + +.. _pipe_cap: + +PIPE_CAP_* +^^^^^^^^^^ + +Capability queries return information about the features and limits of the +driver/GPU. For floating-point values, use :ref:`get_paramf`, and for boolean +or integer values, use :ref:`get_param`. + +The integer capabilities: + +* ``MAX_TEXTURE_IMAGE_UNITS``: The maximum number of samplers available. +* ``NPOT_TEXTURES``: Whether :term:`NPOT` textures may have repeat modes, + normalized coordinates, and mipmaps. +* ``TWO_SIDED_STENCIL``: Whether the stencil test can also affect back-facing + polygons. +* ``GLSL``: Deprecated. +* ``DUAL_SOURCE_BLEND``: Whether dual-source blend factors are supported. See + :ref:`Blend` for more information. +* ``ANISOTROPIC_FILTER``: Whether textures can be filtered anisotropically. +* ``POINT_SPRITE``: Whether point sprites are available. +* ``MAX_RENDER_TARGETS``: The maximum number of render targets that may be + bound. +* ``OCCLUSION_QUERY``: Whether occlusion queries are available. +* ``TIMER_QUERY``: Whether timer queries are available. +* ``TEXTURE_SHADOW_MAP``: indicates whether the fragment shader hardware + can do the depth texture / Z comparison operation in TEX instructions + for shadow testing. +* ``MAX_TEXTURE_2D_LEVELS``: The maximum number of mipmap levels available + for a 2D texture. +* ``MAX_TEXTURE_3D_LEVELS``: The maximum number of mipmap levels available + for a 3D texture. +* ``MAX_TEXTURE_CUBE_LEVELS``: The maximum number of mipmap levels available + for a cubemap. +* ``TEXTURE_MIRROR_CLAMP``: Whether mirrored texture coordinates with clamp + are supported. +* ``TEXTURE_MIRROR_REPEAT``: Whether mirrored repeating texture coordinates + are supported. +* ``MAX_VERTEX_TEXTURE_UNITS``: The maximum number of samplers addressable + inside the vertex shader. If this is 0, then the vertex shader cannot + sample textures. +* ``TGSI_CONT_SUPPORTED``: Whether the TGSI CONT opcode is supported. +* ``BLEND_EQUATION_SEPARATE``: Whether alpha blend equations may be different + from color blend equations, in :ref:`Blend` state. +* ``SM3``: Whether the vertex shader and fragment shader support equivalent + opcodes to the Shader Model 3 specification. XXX oh god this is horrible +* ``MAX_PREDICATE_REGISTERS``: indicates the number of predicate registers + available. Predicate register may be set as a side-effect of ALU + instructions to indicate less than, greater than or equal to zero. + Later instructions can use a predicate register to control writing to + each channel of destination registers. NOTE: predicate registers have + not been fully implemented in Gallium at this time. See the + GL_NV_fragment_program extension for more info (look for "condition codes"). +* ``MAX_COMBINED_SAMPLERS``: The total number of samplers accessible from + the vertex and fragment shader, inclusive. +* ``MAX_CONST_BUFFERS``: Maximum number of constant buffers that can be bound + to any shader stage using ``set_constant_buffer``. If 0 or 1, the pipe will + only permit binding one constant buffer per shader, and the shaders will + not permit two-dimensional access to constants. + +If a value greater than 0 is returned, the driver can have multiple +constant buffers bound to shader stages. The CONST register file can +be accessed with two-dimensional indices, like in the example below. + +DCL CONST[0][0..7] # declare first 8 vectors of constbuf 0 +DCL CONST[3][0] # declare first vector of constbuf 3 +MOV OUT[0], CONST[0][3] # copy vector 3 of constbuf 0 + +For backwards compatibility, one-dimensional access to CONST register +file is still supported. In that case, the constbuf index is assumed +to be 0. + +* ``MAX_CONST_BUFFER_SIZE``: Maximum byte size of a single constant buffer. +* ``INDEP_BLEND_ENABLE``: Whether per-rendertarget blend enabling and channel + masks are supported. If 0, then the first rendertarget's blend mask is + replicated across all MRTs. +* ``INDEP_BLEND_FUNC``: Whether per-rendertarget blend functions are + available. If 0, then the first rendertarget's blend functions affect all + MRTs. +* ``PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT``: Whether the TGSI property + FS_COORD_ORIGIN with value UPPER_LEFT is supported. +* ``PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT``: Whether the TGSI property + FS_COORD_ORIGIN with value LOWER_LEFT is supported. +* ``PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER``: Whether the TGSI + property FS_COORD_PIXEL_CENTER with value HALF_INTEGER is supported. +* ``PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER``: Whether the TGSI + property FS_COORD_PIXEL_CENTER with value INTEGER is supported. + +The floating-point capabilities: + +* ``MAX_LINE_WIDTH``: The maximum width of a regular line. +* ``MAX_LINE_WIDTH_AA``: The maximum width of a smoothed line. +* ``MAX_POINT_WIDTH``: The maximum width and height of a point. +* ``MAX_POINT_WIDTH_AA``: The maximum width and height of a smoothed point. +* ``MAX_TEXTURE_ANISOTROPY``: The maximum level of anisotropy that can be + applied to anisotropically filtered textures. +* ``MAX_TEXTURE_LOD_BIAS``: The maximum :term:`LOD` bias that may be applied + to filtered textures. +* ``GUARD_BAND_LEFT``, ``GUARD_BAND_TOP``, ``GUARD_BAND_RIGHT``, + ``GUARD_BAND_BOTTOM``: XXX + +Fragment shader limits: + +* ``PIPE_CAP_MAX_FS_INSTRUCTIONS``: The maximum number of instructions. +* ``PIPE_CAP_MAX_FS_ALU_INSTRUCTIONS``: The maximum number of arithmetic instructions. +* ``PIPE_CAP_MAX_FS_TEX_INSTRUCTIONS``: The maximum number of texture instructions. +* ``PIPE_CAP_MAX_FS_TEX_INDIRECTIONS``: The maximum number of texture indirections. +* ``PIPE_CAP_MAX_FS_CONTROL_FLOW_DEPTH``: The maximum nested control flow depth. +* ``PIPE_CAP_MAX_FS_INPUTS``: The maximum number of input registers. +* ``PIPE_CAP_MAX_FS_CONSTS``: The maximum number of constants. +* ``PIPE_CAP_MAX_FS_TEMPS``: The maximum number of temporary registers. +* ``PIPE_CAP_MAX_FS_ADDRS``: The maximum number of address registers. +* ``PIPE_CAP_MAX_FS_PREDS``: The maximum number of predicate registers. + +Vertex shader limits: + +* ``PIPE_CAP_MAX_VS_*``: Identical to ``PIPE_CAP_MAX_FS_*``. + + +.. _pipe_bind: + +PIPE_BIND_* +^^^^^^^^^^^ + +These flags indicate how a resource will be used and are specified at resource +creation time. Resources may be used in different roles +during their lifecycle. Bind flags are cumulative and may be combined to create +a resource which can be used for multiple things. +Depending on the pipe driver's memory management and these bind flags, +resources might be created and handled quite differently. + +* ``PIPE_BIND_RENDER_TARGET``: A color buffer or pixel buffer which will be + rendered to. Any surface/resource attached to pipe_framebuffer_state::cbufs + must have this flag set. +* ``PIPE_BIND_DEPTH_STENCIL``: A depth (Z) buffer and/or stencil buffer. Any + depth/stencil surface/resource attached to pipe_framebuffer_state::zsbuf must + have this flag set. +* ``PIPE_BIND_DISPLAY_TARGET``: A surface that can be presented to screen. Arguments to + pipe_screen::flush_front_buffer must have this flag set. +* ``PIPE_BIND_SAMPLER_VIEW``: A texture that may be sampled from in a fragment + or vertex shader. +* ``PIPE_BIND_VERTEX_BUFFER``: A vertex buffer. +* ``PIPE_BIND_INDEX_BUFFER``: An vertex index/element buffer. +* ``PIPE_BIND_CONSTANT_BUFFER``: A buffer of shader constants. +* ``PIPE_BIND_TRANSFER_WRITE``: A transfer object which will be written to. +* ``PIPE_BIND_TRANSFER_READ``: A transfer object which will be read from. +* ``PIPE_BIND_CUSTOM``: +* ``PIPE_BIND_SCANOUT``: A front color buffer or scanout buffer. +* ``PIPE_BIND_SHARED``: A sharable buffer that can be given to another + process. + +.. _pipe_usage: + +PIPE_USAGE_* +^^^^^^^^^^^^ + +The PIPE_USAGE enums are hints about the expected usage pattern of a resource. + +* ``PIPE_USAGE_DEFAULT``: Expect many uploads to the resource, intermixed with draws. +* ``PIPE_USAGE_DYNAMIC``: Expect many uploads to the resource, intermixed with draws. +* ``PIPE_USAGE_STATIC``: Same as immutable (?) +* ``PIPE_USAGE_IMMUTABLE``: Resource will not be changed after first upload. +* ``PIPE_USAGE_STREAM``: Upload will be followed by draw, followed by upload, ... + + + +PIPE_TEXTURE_GEOM +^^^^^^^^^^^^^^^^^ + +These flags are used when querying whether a particular pipe_format is +supported by the driver (with the `is_format_supported` function). +Some formats may only be supported for certain kinds of textures. +For example, a compressed format might only be used for POT textures. + +* ``PIPE_TEXTURE_GEOM_NON_SQUARE``: The texture may not be square +* ``PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO``: The texture dimensions may not be + powers of two. + + +Methods +------- + +XXX to-do + +get_name +^^^^^^^^ + +Returns an identifying name for the screen. + +get_vendor +^^^^^^^^^^ + +Returns the screen vendor. + +.. _get_param: + +get_param +^^^^^^^^^ + +Get an integer/boolean screen parameter. + +**param** is one of the :ref:`PIPE_CAP` names. + +.. _get_paramf: + +get_paramf +^^^^^^^^^^ + +Get a floating-point screen parameter. + +**param** is one of the :ref:`PIPE_CAP` names. + +context_create +^^^^^^^^^^^^^^ + +Create a pipe_context. + +**priv** is private data of the caller, which may be put to various +unspecified uses, typically to do with implementing swapbuffers +and/or front-buffer rendering. + +is_format_supported +^^^^^^^^^^^^^^^^^^^ + +Determine if a resource in the given format can be used in a specific manner. + +**format** the resource format + +**target** one of the PIPE_TEXTURE_x flags + +**sample_count** the number of samples. 0 and 1 mean no multisampling, +the maximum allowed legal value is 32. + +**bindings** is a bitmask of :ref:`PIPE_BIND` flags. + +**geom_flags** is a bitmask of PIPE_TEXTURE_GEOM_x flags. + +Returns TRUE if all usages can be satisfied. + +.. _resource_create: + +resource_create +^^^^^^^^^^^^^^^ + +Create a new resource from a template. +The following fields of the pipe_resource must be specified in the template: + +target + +format + +width0 + +height0 + +depth0 + +last_level + +nr_samples + +usage + +bind + +flags + + + +resource_destroy +^^^^^^^^^^^^^^^^ + +Destroy a resource. A resource is destroyed if it has no more references. + --- mesa-7.9~git20100924.orig/src/gallium/docs/source/cso.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/cso.rst @@ -0,0 +1,14 @@ +CSO +=== + +CSO, Constant State Objects, are a core part of Gallium's API. + +CSO work on the principle of reusable state; they are created by filling +out a state object with the desired properties, then passing that object +to a context. The context returns an opaque context-specific handle which +can be bound at any time for the desired effect. + +.. toctree:: + :glob: + + cso/* --- mesa-7.9~git20100924.orig/src/gallium/docs/source/distro.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/distro.rst @@ -0,0 +1,201 @@ +Distribution +============ + +Along with the interface definitions, the following drivers, state trackers, +and auxiliary modules are shipped in the standard Gallium distribution. + +Drivers +------- + +Cell +^^^^ + +Simple driver for the IBM Cell architecture. Runs faster than :ref:`softpipe` +on Cell-based machines. + +Failover +^^^^^^^^ + +Broken and deprecated. + +Intel i915 +^^^^^^^^^^ + +Driver for Intel i915 and i945 chipsets. + +Intel i965 +^^^^^^^^^^ + +Highly experimental driver for Intel i965 chipsets. + +Identity +^^^^^^^^ + +Wrapper driver. The identity driver is a simple skeleton that passes through +all of its :ref:`Context` and :ref:`Screen` methods to an underlying Context +and Screen, and as such, it is an excellent starting point for new drivers. + +LLVM Softpipe +^^^^^^^^^^^^^ + +A version of :ref:`softpipe` that uses the Low-Level Virtual Machine to +dynamically generate optimized rasterizing pipelines. + +nVidia nvfx +^^^^^^^^^^^ + +Driver for the nVidia nv30 and nv40 families of GPUs. + +nVidia nv50 +^^^^^^^^^^^ + +Driver for the nVidia nv50 family of GPUs. + +VMware SVGA +^^^^^^^^^^^ + +Driver for VMware virtualized guest operating system graphics processing. + +ATI r300 +^^^^^^^^ + +Driver for the ATI/AMD r300, r400, and r500 families of GPUs. + +.. _softpipe: + +Softpipe +^^^^^^^^ + +Reference software rasterizer. Slow but accurate. + +Trace +^^^^^ + +Wrapper driver. Trace dumps an XML record of the calls made to the +:ref:`Context` and :ref:`Screen` objects that it wraps. + +Rbug +^^^^ + +Wrapper driver. :ref:`rbug` driver used with stand alone rbug-gui. + +.. _galahad: + +Galahad +^^^^^^^ + +Wrapper driver. Sanity checker for the internal gallium state. Normally +a driver should n't have to sanity check the input it gets from a state +tracker. Any wrong state received should be perceived as a state tracker bug. + +State Trackers +-------------- + +.. _dri: + +Direct Rendering Infrastructure +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tracker that implements the client-side DRI protocol, for providing direct +acceleration services to X11 servers with the DRI extension. Supports DRI1 +and DRI2. Only GL is supported. + +.. _egl: + +EGL +^^^ + +Tracker for the Khronos EGL standard, used to set up GL and GLES contexts +without extra knowledge of the underlying windowing system. + +GLX +^^^ + +MesaGL +^^^^^^ + +Tracker implementing a GL state machine. Not usable as a standalone tracker; +Mesa should be built with another state tracker, such as :ref:`DRI` or +:ref:`EGL`. + +Python +^^^^^^ + +OpenVG +^^^^^^ + +WGL +^^^ + +Xorg/XFree86 DDX +^^^^^^^^^^^^^^^^ + +Tracker for XFree86 and Xorg X11 servers. Provides device-dependent +modesetting and acceleration as a DDX driver. + +Auxiliary +--------- + +OS +^^ + +The OS module contains the abstractions for basic operating system services: + +* memory allocation +* simple message logging +* obtaining run-time configuration option +* threading primitives + +This is the bare minimum required to port Gallium to a new platform. + +The OS module already provides the implementations of these abstractions for +the most common platforms. When targeting an embedded platform no +implementation will be provided -- these must be provided separately. + +CSO Cache +^^^^^^^^^ + +The CSO cache is used to accelerate preparation of state by saving +driver-specific state structures for later use. + +.. _draw: + +Draw +^^^^ + +Draw is a software :term:`TCL` pipeline for hardware that lacks vertex shaders +or other essential parts of pre-rasterization vertex preparation. + +Gallivm +^^^^^^^ + +Indices +^^^^^^^ + +Indices provides tools for translating or generating element indices for +use with element-based rendering. + +Pipe Buffer Managers +^^^^^^^^^^^^^^^^^^^^ + +Each of these managers provides various services to drivers that are not +fully utilizing a memory manager. + +Remote Debugger +^^^^^^^^^^^^^^^ + +Runtime Assembly Emission +^^^^^^^^^^^^^^^^^^^^^^^^^ + +TGSI +^^^^ + +The TGSI auxiliary module provides basic utilities for manipulating TGSI +streams. + +Translate +^^^^^^^^^ + +Util +^^^^ + --- mesa-7.9~git20100924.orig/src/gallium/docs/source/intro.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/intro.rst @@ -0,0 +1,9 @@ +Introduction +============ + +What is Gallium? +---------------- + +Gallium is essentially an API for writing graphics drivers in a largely +device-agnostic fashion. It provides several objects which encapsulate the +core services of graphics hardware in a straightforward manner. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/cso/rasterizer.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/cso/rasterizer.rst @@ -0,0 +1,195 @@ +.. _rasterizer: + +Rasterizer +========== + +The rasterizer state controls the rendering of points, lines and triangles. +Attributes include polygon culling state, line width, line stipple, +multisample state, scissoring and flat/smooth shading. + +Shading +------- + +flatshade +^^^^^^^^^ + +If set, the provoking vertex of each polygon is used to determine the color +of the entire polygon. If not set, fragment colors will be interpolated +between the vertex colors. + +The actual interpolated shading algorithm is obviously +implementation-dependent, but will usually be Gourard for most hardware. + +.. note:: + + This is separate from the fragment shader input attributes + CONSTANT, LINEAR and PERSPECTIVE. The flatshade state is needed at + clipping time to determine how to set the color of new vertices. + + :ref:`Draw` can implement flat shading by copying the provoking vertex + color to all the other vertices in the primitive. + +flatshade_first +^^^^^^^^^^^^^^^ + +Whether the first vertex should be the provoking vertex, for most primitives. +If not set, the last vertex is the provoking vertex. + +There are several important exceptions to the specification of this rule. + +* ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first + vertex. If the caller wishes to change the provoking vertex, they merely + need to rotate the vertices themselves. +* ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: This option has no + effect; the provoking vertex is always the last vertex. +* ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the + second vertex, not the first. This permits each segment of the fan to have + a different color. + +Polygons +-------- + +light_twoside +^^^^^^^^^^^^^ + +If set, there are per-vertex back-facing colors. The hardware +(perhaps assisted by :ref:`Draw`) should be set up to use this state +along with the front/back information to set the final vertex colors +prior to rasterization. + +The frontface vertex shader color output is marked with TGSI semantic +COLOR[0], and backface COLOR[1]. + +front_ccw + Indicates whether the window order of front-facing polygons is + counter-clockwise (TRUE) or clockwise (FALSE). + +cull_mode + Indicates which faces of polygons to cull, either PIPE_FACE_NONE + (cull no polygons), PIPE_FACE_FRONT (cull front-facing polygons), + PIPE_FACE_BACK (cull back-facing polygons), or + PIPE_FACE_FRONT_AND_BACK (cull all polygons). + +fill_front + Indicates how to fill front-facing polygons, either + PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or + PIPE_POLYGON_MODE_POINT. +fill_back + Indicates how to fill back-facing polygons, either + PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or + PIPE_POLYGON_MODE_POINT. + +poly_stipple_enable + Whether polygon stippling is enabled. +poly_smooth + Controls OpenGL-style polygon smoothing/antialiasing + +offset_point + If set, point-filled polygons will have polygon offset factors applied +offset_line + If set, line-filled polygons will have polygon offset factors applied +offset_tri + If set, filled polygons will have polygon offset factors applied + +offset_units + Specifies the polygon offset bias +offset_scale + Specifies the polygon offset scale + + + +Lines +----- + +line_width + The width of lines. +line_smooth + Whether lines should be smoothed. Line smoothing is simply anti-aliasing. +line_stipple_enable + Whether line stippling is enabled. +line_stipple_pattern + 16-bit bitfield of on/off flags, used to pattern the line stipple. +line_stipple_factor + When drawing a stippled line, each bit in the stipple pattern is + repeated N times, where N = line_stipple_factor + 1. +line_last_pixel + Controls whether the last pixel in a line is drawn or not. OpenGL + omits the last pixel to avoid double-drawing pixels at the ends of lines + when drawing connected lines. + + +Points +------ + +sprite_coord_enable +^^^^^^^^^^^^^^^^^^^ + +Specifies if a texture unit has its texture coordinates replaced or not. This +is a packed bitfield containing the enable for all texcoords -- if all bits +are zero, point sprites are effectively disabled. + +If any bit is set, then point_smooth MUST be disabled (there are no +round sprites) and point_quad_rasterization MUST be true (sprites are +always rasterized as quads). Any mismatch between these states should +be considered a bug in the state-tracker. + +If enabled, the four vertices of the resulting quad will be assigned +texture coordinates, according to sprite_coord_mode. + +sprite_coord_mode +^^^^^^^^^^^^^^^^^ + +Specifies how the value for each shader output should be computed when drawing +point sprites. For PIPE_SPRITE_COORD_LOWER_LEFT, the lower-left vertex will +have coordinates (0,0,0,1). For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left +vertex will have coordinates (0,0,0,1). +This state is used by :ref:`Draw` to generate texcoords. + +point_quad_rasterization +^^^^^^^^^^^^^^^^^^^^^^^^ + +Determines if points should be rasterized according to quad or point +rasterization rules. + +OpenGL actually has quite different rasterization rules for points and +point sprites - hence this indicates if points should be rasterized as +points or according to point sprite (which decomposes them into quads, +basically) rules. + +Additionally Direct3D will always use quad rasterization rules for +points, regardless of whether point sprites are enabled or not. + +If this state is enabled, point smoothing and antialiasing are +disabled. If it is disabled, point sprite coordinates are not +generated. + +.. note:: + + Some renderers always internally translate points into quads; this state + still affects those renderers by overriding other rasterization state. + +point_smooth + Whether points should be smoothed. Point smoothing turns rectangular + points into circles or ovals. +point_size_per_vertex + Whether the vertex shader is expected to have a point size output. + Undefined behaviour is permitted if there is disagreement between + this flag and the actual bound shader. +point_size + The size of points, if not specified per-vertex. + + + +Other Members +------------- + +scissor + Whether the scissor test is enabled. + +multisample + Whether :term:`MSAA` is enabled. + +gl_rasterization_rules + Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set, + the rasterizer will use (0, 0) for pixel centers. + --- mesa-7.9~git20100924.orig/src/gallium/docs/source/cso/blend.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/cso/blend.rst @@ -0,0 +1,108 @@ +.. _blend: + +Blend +===== + +This state controls blending of the final fragments into the target rendering +buffers. + +Blend Factors +------------- + +The blend factors largely follow the same pattern as their counterparts +in other modern and legacy drawing APIs. + +XXX blurb about dual-source blends + +Logical Operations +------------------ + +Logical operations, also known as logicops, lops, or rops, are supported. +Only two-operand logicops are available. When logicops are enabled, all other +blend state is ignored, including per-render-target state, so logicops are +performed on all render targets. + +.. warning:: + The blend_enable flag is ignored for all render targets when logical + operations are enabled. + +For a source component `s` and destination component `d`, the logical +operations are defined as taking the bits of each channel of each component, +and performing one of the following operations per-channel: + +* ``CLEAR``: 0 +* ``NOR``: :math:`\lnot(s \lor d)` +* ``AND_INVERTED``: :math:`\lnot s \land d` +* ``COPY_INVERTED``: :math:`\lnot s` +* ``AND_REVERSE``: :math:`s \land \lnot d` +* ``INVERT``: :math:`\lnot d` +* ``XOR``: :math:`s \oplus d` +* ``NAND``: :math:`\lnot(s \land d)` +* ``AND``: :math:`s \land d` +* ``EQUIV``: :math:`\lnot(s \oplus d)` +* ``NOOP``: :math:`d` +* ``OR_INVERTED``: :math:`\lnot s \lor d` +* ``COPY``: :math:`s` +* ``OR_REVERSE``: :math:`s \lor \lnot d` +* ``OR``: :math:`s \lor d` +* ``SET``: 1 + +.. note:: + The logical operation names and definitions match those of the OpenGL API, + and are similar to the ROP2 and ROP3 definitions of GDI. This is + intentional, to ease transitions to Gallium. + +Members +------- + +These members affect all render targets. + +dither +%%%%%% + +Whether dithering is enabled. + +.. note:: + Dithering is completely implementation-dependent. It may be ignored by + drivers for any reason, and some render targets may always or never be + dithered depending on their format or usage flags. + +logicop_enable +%%%%%%%%%%%%%% + +Whether the blender should perform a logicop instead of blending. + +logicop_func +%%%%%%%%%%%% + +The logicop to use. One of ``PIPE_LOGICOP``. + +independent_blend_enable + If enabled, blend state is different for each render target, and + for each render target set in the respective member of the rt array. + If disabled, blend state is the same for all render targets, and only + the first member of the rt array contains valid data. +rt + Contains the per-rendertarget blend state. + +Per-rendertarget Members +------------------------ + +blend_enable + If blending is enabled, perform a blend calculation according to blend + functions and source/destination factors. Otherwise, the incoming fragment + color gets passed unmodified (but colormask still applies). +rgb_func + The blend function to use for rgb channels. One of PIPE_BLEND. +rgb_src_factor + The blend source factor to use for rgb channels. One of PIPE_BLENDFACTOR. +rgb_dst_factor + The blend destination factor to use for rgb channels. One of PIPE_BLENDFACTOR. +alpha_func + The blend function to use for the alpha channel. One of PIPE_BLEND. +alpha_src_factor + The blend source factor to use for the alpha channel. One of PIPE_BLENDFACTOR. +alpha_dst_factor + The blend destination factor to use for alpha channel. One of PIPE_BLENDFACTOR. +colormask + Bitmask of which channels to write. Combination of PIPE_MASK bits. --- mesa-7.9~git20100924.orig/src/gallium/docs/source/cso/velems.rst +++ mesa-7.9~git20100924/src/gallium/docs/source/cso/velems.rst @@ -0,0 +1,59 @@ +.. _vertexelements: + +Vertex Elements +=============== + +This state controls the format of the input attributes contained in +pipe_vertex_buffers. There is one pipe_vertex_element array member for each +input attribute. + +Input Formats +------------- + +Gallium supports a diverse range of formats for vertex data. Drivers are +guaranteed to support 32-bit floating-point vectors of one to four components. +Additionally, they may support the following formats: + +* Integers, signed or unsigned, normalized or non-normalized, 8, 16, or 32 + bits wide +* Floating-point, 16, 32, or 64 bits wide + +At this time, support for varied vertex data formats is limited by driver +deficiencies. It is planned to support a single uniform set of formats for all +Gallium drivers at some point. + +Rather than attempt to specify every small nuance of behavior, Gallium uses a +very simple set of rules for padding out unspecified components. If an input +uses less than four components, it will be padded out with the constant vector +``(0, 0, 0, 1)``. + +Fog, point size, the facing bit, and edgeflags, all are in the standard format +of ``(x, 0, 0, 1)``, and so only the first component of those inputs is used. + +Position +%%%%%%%% + +Vertex position may be specified with two to four components. Using less than +two components is not allowed. + +Colors +%%%%%% + +Colors, both front- and back-facing, may omit the alpha component, only using +three components. Using less than three components is not allowed. + +Members +------- + +src_offset + The byte offset of the attribute in the buffer given by + vertex_buffer_index for the first vertex. +instance_divisor + The instance data rate divisor, used for instancing. + 0 means this is per-vertex data, n means per-instance data used for + n consecutive instances (n > 0). +vertex_buffer_index + The vertex buffer this attribute lives in. Several attributes may + live in the same vertex buffer. +src_format + The format of the attribute data. One of the PIPE_FORMAT tokens. --- mesa-7.9~git20100924.orig/src/glsl/configure.ac +++ mesa-7.9~git20100924/src/glsl/configure.ac @@ -0,0 +1,69 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT(glsl, XXXXX, idr@freedesktop.org, glsl) +AC_CONFIG_SRCDIR([Makefile.am]) +AM_CONFIG_HEADER([config.h]) +AC_CONFIG_FILES([glcpp/Makefile]) + +AM_INIT_AUTOMAKE +LT_INIT + +AM_MAINTAINER_MODE + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_MAKE_SET +AC_PROG_YACC +AC_PROG_LEX + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_HEADER_STDC + +AH_TOP([#ifndef GLSL_CONFIG_H +#define GLSL_CONFIG_H]) +AH_BOTTOM([#endif /* GLSL_CONFIG_H */]) + +PKG_CHECK_MODULES([talloc], [talloc >= 2.0]) + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [use debug compiler flags and macros @<:@default=disabled@:>@])], + [enable_debug="$enableval"], + [enable_debug=no] +) +if test "x$enable_debug" = xyes; then + DEFINES="$DEFINES -DDEBUG" + if test "x$GCC" = xyes; then + # Remove any -g or -O flags from the command line + CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`] + CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2" + fi + if test "x$GXX" = xyes; then + # Remove any -g flags from the command line + CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`] + CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2" + fi +fi + +if test "x$GXX" = xyes ; then + WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector" +else + WARN="" +fi + +CFLAGS="$CFLAGS $WARN" +CXXFLAGS="$CXXFLAGS $WARN" +YFLAGS="-d -v" + +AC_OUTPUT([Makefile]) --- mesa-7.9~git20100924.orig/src/glsl/TODO +++ mesa-7.9~git20100924/src/glsl/TODO @@ -0,0 +1,38 @@ +- Detect code paths in non-void functions that don't reach a return statement + +- Improve handling of constants and their initializers. Constant initializers + should never generate any code. This is trival for scalar constants. It is + also trivial for arrays, matrices, and vectors that are accessed with + constant index values. For others it is more complicated. Perhaps these + cases should be silently converted to uniforms? + +- Implement support for ir_binop_dot in ir_algebraic.cpp. Perform + transformations such as "dot(v, vec3(0.0, 1.0, 0.0))" -> v.y. + +1.30 features: + +- Implement AST-to-HIR conversion of bit-shift operators. + +- Implement AST-to-HIR conversion of bit-wise {&,|,^,!} operators. + +- Implement AST-to-HIR conversion of switch-statements + - switch + - case + - Update break to correcly handle mixed nexting of switch-statements + and loops. + +- Handle currently unsupported constant expression types + - ir_unop_bit_not + - ir_binop_mod + - ir_binop_lshift + - ir_binop_rshift + - ir_binop_bit_and + - ir_binop_bit_xor + - ir_binop_bit_or + +- Implement support for 1.30 style shadow compares which only return a float + instead of a vec4. + +- Implement support for gl_ClipDistance. This is non-trivial because + gl_ClipDistance is exposed as a float[8], but all hardware actually + implements it as vec4[2]. \ No newline at end of file --- mesa-7.9~git20100924.orig/src/glsl/.dir-locals.el +++ mesa-7.9~git20100924/src/glsl/.dir-locals.el @@ -0,0 +1,3 @@ +((c-mode . ((c-basic-offset . 3))) + (c++-mode . ((c-basic-offset . 3))) +) --- mesa-7.9~git20100924.orig/src/glsl/autogen.sh +++ mesa-7.9~git20100924/src/glsl/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" --- mesa-7.9~git20100924.orig/src/glsl/Makefile.am +++ mesa-7.9~git20100924/src/glsl/Makefile.am @@ -0,0 +1,81 @@ +# Copyright © 2010 Intel Corporation +# All Rights Reserved. +# +# 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 +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL +# AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS 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. + +AUTOMAKE_OPTIONS = foreign +AM_CPPFLAGS = -I mesa + +SUBDIRS = glcpp + +bin_PROGRAMS = glsl + +glsl_LDADD = ./glcpp/libglcpp.la +glsl_LDFLAGS = @LDFLAGS@ $(talloc_LIBS) +glsl_SOURCES = \ + main.cpp \ + builtin_types.h \ + glsl_types.cpp \ + glsl_parser.ypp glsl_lexer.lpp glsl_parser_extras.cpp \ + ast_expr.cpp ast_to_hir.cpp ast_function.cpp ast_type.cpp \ + ir.cpp hir_field_selection.cpp builtin_function.cpp \ + ir_print_visitor.cpp ir_variable.cpp ir_function.cpp \ + ir_basic_block.cpp \ + ir_basic_block.h \ + ir_clone.cpp \ + ir_constant_expression.cpp \ + ir_constant_folding.cpp \ + ir_constant_variable.cpp \ + ir_copy_propagation.cpp \ + ir_copy_propagation.h \ + ir_dead_code.cpp \ + ir_dead_code.h \ + ir_dead_code_local.cpp \ + ir_expression_flattening.cpp \ + ir_function_can_inline.cpp \ + ir_function_inlining.cpp \ + ir_if_simplification.cpp \ + ir_optimization.h \ + ir_reader.cpp s_expression.cpp \ + ir_hv_accept.cpp \ + ir_hierarchical_visitor.h \ + ir_hierarchical_visitor.cpp \ + ir_swizzle_swizzle.cpp \ + ir_to_mesa.cpp \ + ir_to_mesa.h \ + ir_validate.cpp \ + ir_vec_index_to_swizzle.cpp \ + linker.cpp \ + loop_analysis.cpp \ + loop_controls.cpp \ + loop_unroll.cpp \ + lower_noise.cpp \ + lower_variable_index_to_cond_assign.cpp \ + opt_redundant_jumps.cpp + +BUILT_SOURCES = glsl_parser.h glsl_parser.cpp glsl_lexer.cpp +CLEANFILES = $(BUILT_SOURCES) + +builtin_function.cpp: builtins/*/* + ./builtins/tools/generate_builtins.pl > builtin_function.cpp +glsl_parser.h: glsl_parser.cpp + +.lpp.cpp: + $(LEXCOMPILE) --outfile="$@" $< --- mesa-7.9~git20100924.orig/src/glsl/tests/swiz-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/swiz-02.glsl @@ -0,0 +1,11 @@ +/* FAIL: assignment of a vec2 to a float */ +#version 120 + +void main() +{ + float a; + vec4 b; + + b.x = 6.0; + a = b.xy; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-06.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-06.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type bvec2 */ +attribute bvec2 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/parameters-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/parameters-03.glsl @@ -0,0 +1,9 @@ +/* FAIL - x is redeclared in the function body at the same scope as the + * parameter + */ +void a(float x, float y) +{ + float x; + + x = y; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-05.glsl @@ -0,0 +1,2 @@ +/* FAIL - array size type must be scalar */ +uniform vec4 a[ivec4(3)]; --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-01.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type int */ +attribute int i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/condition-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/condition-01.glsl @@ -0,0 +1,8 @@ +/* FAIL - :? condition is not bool scalar */ + +uniform bvec4 a; + +void main() +{ + gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-01.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat2x3 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-03.glsl @@ -0,0 +1,12 @@ +/* FAIL - cannot construct a matrix from a matrix in GLSL 1.10 */ + +uniform mat2 a; + +void main() +{ + mat2 b; + + b = mat2(a); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-11.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-11.glsl @@ -0,0 +1,8 @@ +#version 130 +/* FAIL - attribute cannot have array type in GLSL 1.30 */ +attribute vec4 i[10]; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-01.glsl @@ -0,0 +1,6 @@ +/* PASS */ + +void main() +{ + gl_Position = vec4(1.0, 1.0, 1.0, 0.0);; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-07.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-07.glsl @@ -0,0 +1,7 @@ +/* FAIL - out only allowed in parameter list in GLSL 1.10 */ +void main() +{ + out vec4 foo; + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-09.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-09.glsl @@ -0,0 +1,26 @@ +/* PASS */ + +uniform int a; +uniform float b; +uniform bool c; + +void main() +{ + float x; + int y; + bool z; + + x = float(a); + x = float(b); + x = float(c); + + y = int(a); + y = int(b); + y = int(c); + + z = bool(a); + z = bool(b); + z = bool(c); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-02.glsl @@ -0,0 +1,2 @@ +/* FAIL - in only allowed in parameter list in GLSL 1.10 */ +in foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/if-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/if-03.glsl @@ -0,0 +1,11 @@ +/* PASS */ + +uniform bool a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-07.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-07.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type bvec3 */ +attribute bvec3 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/function-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/function-04.glsl @@ -0,0 +1,15 @@ +/* FAIL - type mismatch in assignment */ + +vec3 foo(float x, float y, float z) +{ + vec3 v; + v.x = x; + v.y = y; + v.z = z; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-04.glsl @@ -0,0 +1,14 @@ +#version 120 +/* FAIL - matrix must be only parameter to matrix constructor */ + +uniform mat2 a; +uniform float x; + +void main() +{ + mat2 b; + + b = mat2(a, x); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-02.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type ivec2 */ +attribute ivec2 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/condition-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/condition-04.glsl @@ -0,0 +1,8 @@ +/* FAIL - type of second two operands must match */ + +uniform bool a; + +void main() +{ + gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-10.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-10.glsl @@ -0,0 +1,8 @@ +#version 120 +/* FAIL - attribute cannot have array type in GLSL 1.20 */ +attribute vec4 i[10]; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/condition-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/condition-03.glsl @@ -0,0 +1,8 @@ +/* PASS */ + +uniform bool a; + +void main() +{ + gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-07.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-07.glsl @@ -0,0 +1,2 @@ +/* FAIL - array size must be > 0 */ +uniform vec4 a[0]; --- mesa-7.9~git20100924.orig/src/glsl/tests/array-13.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-13.glsl @@ -0,0 +1,11 @@ +#version 120 +/* PASS */ + +void main() +{ + vec4 a[2]; + + a = vec4 [] (vec4(1.0), vec4(2.0)); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-03.glsl @@ -0,0 +1,2 @@ +/* FAIL - out only allowed in parameter list in GLSL 1.10 */ +out vec4 foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/if-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/if-01.glsl @@ -0,0 +1,11 @@ +/* FAIL - if-statement condition is not bool scalar */ + +uniform bvec4 a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-07.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-07.glsl @@ -0,0 +1,27 @@ +/* PASS */ + +uniform mat2 a; +uniform mat2 b; +uniform mat2 c; +uniform mat2 d; +uniform mat3 e; +uniform mat3 f; +uniform mat3 g; +uniform mat3 h; +uniform mat4 i; +uniform mat4 j; +uniform mat4 k; +uniform mat4 l; + +void main() +{ + mat2 x; + mat3 y; + mat4 z; + + x = a * b + c / d; + y = e * f + g / h; + z = i * j + k / l; + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-03.glsl @@ -0,0 +1,3 @@ +#version 120 +/* PASS */ +uniform vec4 [3] a; --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-04.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat3x4 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-05.glsl @@ -0,0 +1,13 @@ +/* FAIL - too few components supplied to constructor */ + +uniform vec2 a; +uniform float x; + +void main() +{ + mat2 b; + + b = mat2(a, x); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-06.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-06.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat4x3 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/function-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/function-05.glsl @@ -0,0 +1,26 @@ +/* PASS */ + +vec4 foo(in float x, in float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +vec4 foo(in float x) +{ + vec4 v; + v.x = x; + v.y = x; + v.z = x; + v.w = x; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); + gl_Position = foo(2.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-09.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-09.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have array type in GLSL 1.10 */ +attribute vec4 i[10]; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-01.glsl @@ -0,0 +1,3 @@ +#version 120 +/* FAIL - array size type must be int */ +uniform vec4 [3.2] a; --- mesa-7.9~git20100924.orig/src/glsl/tests/condition-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/condition-02.glsl @@ -0,0 +1,8 @@ +/* FAIL - :? condition is not bool scalar */ + +uniform float a; + +void main() +{ + gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-05.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type bool */ +attribute bool i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-02.glsl @@ -0,0 +1,3 @@ +#version 120 +/* FAIL - array size type must be scalar */ +uniform vec4 [ivec4(3)] a; --- mesa-7.9~git20100924.orig/src/glsl/tests/array-11.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-11.glsl @@ -0,0 +1,9 @@ +#version 120 +/* PASS */ + +void main() +{ + vec4 a[] = vec4 [] (vec4(1.0), vec4(2.0)); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-02.glsl @@ -0,0 +1,7 @@ +/* FAIL - cannot construct samplers */ +void main() +{ + int i; + + i = sampler2D(0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-06.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-06.glsl @@ -0,0 +1,13 @@ +#version 120 +/* PASS */ + +uniform mat2 a; + +void main() +{ + mat2 b; + + b = mat2(a); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/if-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/if-02.glsl @@ -0,0 +1,11 @@ +/* FAIL - if-statement condition is not bool scalar */ + +uniform float a; + +void main() +{ + if (a) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-05.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat4x2 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-08.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-08.glsl @@ -0,0 +1,2 @@ +/* FAIL - array size must be > 0 */ +uniform vec4 a[-1]; --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-09.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-09.glsl @@ -0,0 +1,11 @@ +/* FAIL - matrix-to-matrix constructors are not available in GLSL 1.10 */ + +uniform mat3 a; + +void main() +{ + mat2 m; + + m = mat2(a); + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/function-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/function-03.glsl @@ -0,0 +1,16 @@ +/* PASS */ + +vec4 foo(in float x, in float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-02.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat2x4 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-06.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-06.glsl @@ -0,0 +1,7 @@ +/* FAIL - in only allowed in parameter list in GLSL 1.10 */ +void main() +{ + in vec4 foo; + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/condition-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/condition-05.glsl @@ -0,0 +1,13 @@ +#version 120 +/* PASS */ + +uniform bool a; +uniform int b; + +void main() +{ + float x; + + x = (a) ? 2.0 : b; + gl_Position = vec4(x); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/function-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/function-01.glsl @@ -0,0 +1,16 @@ +/* FAIL - no function named 'foo' exists */ + +vec4 bar(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0, 0.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-04.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type ivec4 */ +attribute ivec4 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-09.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-09.glsl @@ -0,0 +1,9 @@ +#version 120 +/* PASS */ + +void main() +{ + vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0)); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/parameters-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/parameters-01.glsl @@ -0,0 +1,11 @@ +/* FAIL: redefinition of a() */ + +void a() +{ + ; +} + +void a() +{ + ; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-06.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-06.glsl @@ -0,0 +1,2 @@ +/* PASS */ +uniform vec4 a[3]; --- mesa-7.9~git20100924.orig/src/glsl/tests/parameters-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/parameters-02.glsl @@ -0,0 +1,11 @@ +/* PASS */ + +void a() +{ + ; +} + +void a(float x) +{ + ; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-07.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-07.glsl @@ -0,0 +1,13 @@ +/* PASS */ + +uniform ivec2 a; +uniform ivec2 b; + +void main() +{ + mat2 c; + + c = mat2(a, b); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-03.glsl @@ -0,0 +1,6 @@ +/* FAIL - non-square matrices are not available in GLSL 1.10 */ + +void main() +{ + mat3x2 m; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/constructor-08.glsl +++ mesa-7.9~git20100924/src/glsl/tests/constructor-08.glsl @@ -0,0 +1,13 @@ +/* PASS */ + +uniform float a; +uniform float b; + +void main() +{ + ivec2 c; + + c = ivec2(a, b); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/function-02.glsl +++ mesa-7.9~git20100924/src/glsl/tests/function-02.glsl @@ -0,0 +1,16 @@ +/* FAIL - no version of 'foo' matches the call to 'foo' */ + +vec4 foo(float x, float y, float z, float w) +{ + vec4 v; + v.x = x; + v.y = y; + v.z = z; + v.w = w; + return v; +} + +void main() +{ + gl_Position = foo(1.0, 1.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/if-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/if-04.glsl @@ -0,0 +1,11 @@ +/* PASS */ + +uniform bvec4 a; + +void main() +{ + if (a.x) + gl_Position = vec4(1.0, 0.0, 0.0, 1.0); + else + gl_Position = vec4(0.0, 1.0, 0.0, 1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-12.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-12.glsl @@ -0,0 +1,11 @@ +#version 120 +/* FAIL - array must have an implicit or explicit size */ + +void main() +{ + vec4 a[]; + + a = vec4 [2] (vec4(1.0), vec4(2.0)); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/swiz-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/swiz-01.glsl @@ -0,0 +1,11 @@ +/* PASS */ +#version 120 + +void main() +{ + float a; + vec4 b; + + b.x = 6.0; + a = b.x; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-08.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-08.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type bvec4 */ +attribute bvec4 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/attribute-03.glsl +++ mesa-7.9~git20100924/src/glsl/tests/attribute-03.glsl @@ -0,0 +1,7 @@ +/* FAIL - attribute cannot have type ivec3 */ +attribute ivec3 i; + +void main() +{ + gl_Position = vec4(1.0); +} --- mesa-7.9~git20100924.orig/src/glsl/tests/void-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/void-01.glsl @@ -0,0 +1,2 @@ +/* FAIL - cannot declare a variable as having type `void' */ +void foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-04.glsl @@ -0,0 +1,3 @@ +#version 130 +/* PASS */ +in vec4 foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-01.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-01.glsl @@ -0,0 +1,3 @@ +#version 130 +/* FAIL - inout only allowed in parameter list */ +inout vec4 foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-08.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-08.glsl @@ -0,0 +1,19 @@ +#version 120 +/* PASS */ + +uniform mat2x3 a; +uniform mat3x2 b; +uniform mat3x3 c; +uniform mat3x3 d; + +void main() +{ + mat3x3 x; + + /* Multiplying a 2 column, 3 row matrix with a 3 column, 2 row matrix + * results in a 3 column, 3 row matrix. + */ + x = (a * b) + c / d; + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/qualifier-05.glsl +++ mesa-7.9~git20100924/src/glsl/tests/qualifier-05.glsl @@ -0,0 +1,3 @@ +#version 130 +/* PASS */ +out vec4 foo; --- mesa-7.9~git20100924.orig/src/glsl/tests/matrix-10.glsl +++ mesa-7.9~git20100924/src/glsl/tests/matrix-10.glsl @@ -0,0 +1,12 @@ +#version 120 +/* PASS */ + +uniform mat3 a; + +void main() +{ + mat2 m; + + m = mat2(a); + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/tests/array-04.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-04.glsl @@ -0,0 +1,2 @@ +/* FAIL - array size type must be int */ +uniform vec4 a[3.2]; --- mesa-7.9~git20100924.orig/src/glsl/tests/array-10.glsl +++ mesa-7.9~git20100924/src/glsl/tests/array-10.glsl @@ -0,0 +1,11 @@ +/* FAIL - array constructors forbidden in GLSL 1.10 + * + * This can also generate an error because the 'vec4[]' style syntax is + * illegal in GLSL 1.10. + */ +void main() +{ + vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0)); + + gl_Position = gl_Vertex; +} --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/generate_builtins.py +++ mesa-7.9~git20100924/src/glsl/builtins/tools/generate_builtins.py @@ -0,0 +1,244 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import re +from glob import glob +from os import path +from subprocess import Popen, PIPE + +# Local module: generator for texture lookup builtins +from texture_builtins import generate_texture_functions + +builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") + +# Read the files in builtins/ir/*...add them to the supplied dictionary. +def read_ir_files(fs): + for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*')): + with open(filename) as f: + fs[path.basename(filename)] = f.read() + +# Return a dictionary containing all builtin definitions (even generated) +def get_builtin_definitions(): + fs = {} + generate_texture_functions(fs) + read_ir_files(fs) + return fs + +def stringify(s): + t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "') + return ' "' + t + '"\n' + +def write_function_definitions(): + fs = get_builtin_definitions() + for k, v in sorted(fs.iteritems()): + print 'static const char *builtin_' + k + ' =' + print stringify(v), ';' + +def run_compiler(args): + compiler_path = path.join(path.join(builtins_dir, '..'), 'glsl_compiler') + command = [compiler_path, '--dump-lir'] + args + p = Popen(command, 1, stdout=PIPE, shell=False) + output = p.communicate()[0] + + # Clean up output a bit by killing whitespace before a closing paren. + kill_paren_whitespace = re.compile(r'[ \n]*\)', re.MULTILINE); + output = kill_paren_whitespace.sub(')', output); + + # Also toss any duplicate newlines + output = output.replace('\n\n', '\n') + + return (output, p.returncode) + +def write_profile(filename, profile): + (proto_ir, returncode) = run_compiler([filename]) + + if returncode != 0: + print '#error builtins profile', profile, 'failed to compile' + return + + # Kill any global variable declarations. We don't want them. + kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE); + proto_ir = kill_globals.sub('', proto_ir) + + # Kill pointer addresses. They're not necessary in prototypes and just + # clutter the diff output. + proto_ir = re.sub(r'@0x[0-9a-f]+', '', proto_ir); + + print 'static const char *prototypes_for_' + profile + ' =' + print stringify(proto_ir), ';' + + # Print a table of all the functions (not signatures) referenced. + # This is done so we can avoid bothering with a hash table in the C++ code. + + function_names = set() + for func in re.finditer(r'\(function (.+)\n', proto_ir): + function_names.add(func.group(1)) + + print 'static const char *functions_for_' + profile + ' [] = {' + for func in sorted(function_names): + print ' builtin_' + func + ',' + print '};' + +def write_profiles(): + profiles = get_profile_list() + for (filename, profile) in profiles: + write_profile(filename, profile) + +def get_profile_list(): + profiles = [] + for pfile in sorted(glob(path.join(path.join(builtins_dir, 'profiles'), '*'))): + profiles.append((pfile, path.basename(pfile).replace('.', '_'))) + return profiles + +if __name__ == "__main__": + print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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. + */ + +#include +#include "main/core.h" /* for struct gl_shader */ +#include "glsl_parser_extras.h" +#include "ir_reader.h" +#include "program.h" +#include "ast.h" + +extern "C" struct gl_shader * +_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type); + +gl_shader * +read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) +{ + GLcontext fakeCtx; + fakeCtx.API = API_OPENGL; + gl_shader *sh = _mesa_new_shader(NULL, 0, target); + struct _mesa_glsl_parse_state *st = + new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh); + + st->language_version = 130; + st->symbols->language_version = 130; + st->ARB_texture_rectangle_enable = true; + st->EXT_texture_array_enable = true; + _mesa_glsl_initialize_types(st); + + sh->ir = new(sh) exec_list; + sh->symbols = st->symbols; + + /* Read the IR containing the prototypes */ + _mesa_glsl_read_ir(st, sh->ir, protos, true); + + /* Read ALL the function bodies, telling the IR reader not to scan for + * prototypes (we've already created them). The IR reader will skip any + * signature that does not already exist as a prototype. + */ + for (unsigned i = 0; i < count; i++) { + _mesa_glsl_read_ir(st, sh->ir, functions[i], false); + + if (st->error) { + printf("error reading builtin: %.35s ...\\n", functions[i]); + printf("Info log:\\n%s\\n", st->info_log); + talloc_free(sh); + return NULL; + } + } + + reparent_ir(sh->ir, sh); + delete st; + + return sh; +} +""" + + write_function_definitions() + write_profiles() + + profiles = get_profile_list() + + print 'static gl_shader *builtin_profiles[%d];' % len(profiles) + + print """ +void *builtin_mem_ctx = NULL; + +void +_mesa_glsl_release_functions(void) +{ + talloc_free(builtin_mem_ctx); + builtin_mem_ctx = NULL; + memset(builtin_profiles, 0, sizeof(builtin_profiles)); +} + +static void +_mesa_read_profile(struct _mesa_glsl_parse_state *state, + exec_list *instructions, + int profile_index, + const char *prototypes, + const char **functions, + int count) +{ + gl_shader *sh = builtin_profiles[profile_index]; + + if (sh == NULL) { + sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count); + talloc_steal(builtin_mem_ctx, sh); + builtin_profiles[profile_index] = sh; + } + + import_prototypes(sh->ir, instructions, state->symbols, state); + state->builtins_to_link[state->num_builtins_to_link] = sh; + state->num_builtins_to_link++; +} + +void +_mesa_glsl_initialize_functions(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + if (builtin_mem_ctx == NULL) { + builtin_mem_ctx = talloc_init("GLSL built-in functions"); + memset(&builtin_profiles, 0, sizeof(builtin_profiles)); + } + + state->num_builtins_to_link = 0; +""" + + i=0 + for (filename, profile) in profiles: + if profile.endswith('_vert'): + check = 'state->target == vertex_shader && ' + elif profile.endswith('_frag'): + check = 'state->target == fragment_shader && ' + + version = re.sub(r'_(vert|frag)$', '', profile) + if version.isdigit(): + check += 'state->language_version == ' + version + else: # an extension name + check += 'state->' + version + '_enable' + + print ' if (' + check + ') {' + print ' _mesa_read_profile(state, instructions, %d,' % i + print ' prototypes_for_' + profile + ',' + print ' functions_for_' + profile + ',' + print ' Elements(functions_for_' + profile + '));' + print ' }' + print + i = i + 1 + print '}' + --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/generate_outerProductGLSL.py +++ mesa-7.9~git20100924/src/glsl/builtins/tools/generate_outerProductGLSL.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +def gen(x, y): + type = "mat" + str(x) + if x != y: + type = type + "x" + str(y) + print type + " outerProduct(vec" + str(y) + " u, vec" + str(x) + " v)\n{" + print " " + type + " m;" + + for i in range(x): + print " m[" + str(i) + "] = u * v[" + str(i) + "];" + print " return m;\n}" + +print "#version 120" +gen(2,2) +gen(2,3) # mat2x3 means 2 columns, 3 rows +gen(2,4) +gen(3,2) +gen(3,3) +gen(3,4) +gen(4,2) +gen(4,3) +gen(4,4) --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/generate_transposeGLSL.py +++ mesa-7.9~git20100924/src/glsl/builtins/tools/generate_transposeGLSL.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +def gen(x, y): + origtype = "mat" + str(x) + trantype = "mat" + str(y) + if x != y: + origtype = origtype + "x" + str(y) + trantype = trantype + "x" + str(x) + print trantype + " transpose(" + origtype + " m)\n{" + print " " + trantype + " t;" + + # The obvious implementation of transpose + for i in range(x): + for j in range(y): + print " t[" + str(j) + "][" + str(i) + "] =", + print "m[" + str(i) + "][" + str(j) + "];" + print " return t;\n}" + +print "#version 120" +gen(2,2) +gen(2,3) # mat2x3 means 2 columns, 3 rows +gen(2,4) +gen(3,2) +gen(3,3) +gen(3,4) +gen(4,2) +gen(4,3) +gen(4,4) --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/texture_builtins.py +++ mesa-7.9~git20100924/src/glsl/builtins/tools/texture_builtins.py @@ -0,0 +1,349 @@ +#!/usr/bin/python + +import sys +import StringIO + +def vec_type(g, size): + if size == 1: + if g == "i": + return "int" + elif g == "u": + return "uint" + return "float" + return g + "vec" + str(size) + +# Get the base dimension - i.e. sampler3D gives 3 +# Array samplers also get +1 here since the layer is really an extra coordinate +def get_coord_dim(sampler_type): + if sampler_type[0].isdigit(): + coord_dim = int(sampler_type[0]) + elif sampler_type.startswith("Cube"): + coord_dim = 3 + else: + assert False ("coord_dim: invalid sampler_type: " + sampler_type) + + if sampler_type.find("Array") != -1: + coord_dim += 1 + return coord_dim + +# Get the number of extra vector components (i.e. shadow comparitor) +def get_extra_dim(sampler_type, use_proj, unused_fields): + extra_dim = unused_fields + if sampler_type.find("Shadow") != -1: + extra_dim += 1 + if use_proj: + extra_dim += 1 + return extra_dim + +def generate_sigs(g, tex_inst, sampler_type, use_proj = False, unused_fields = 0): + coord_dim = get_coord_dim(sampler_type) + extra_dim = get_extra_dim(sampler_type, use_proj, unused_fields) + + # Print parameters + print " (signature " + g + "vec4" + print " (parameters" + print " (declare (in) " + g + "sampler" + sampler_type + " sampler)" + print " (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)", + if tex_inst == "txb": + print "\n (declare (in) float bias)", + elif tex_inst == "txl": + print "\n (declare (in) float lod)", + elif tex_inst == "txf": + print "\n (declare (in) int lod)", + elif tex_inst == "txd": + grad_type = vec_type("", coord_dim) + print "\n (declare (in) " + grad_type + " dPdx)", + print "\n (declare (in) " + grad_type + " dPdy)", + + print ")\n ((return (" + tex_inst + " (var_ref sampler)", + + # Coordinate + if extra_dim > 0: + print "(swiz " + "xyzw"[:coord_dim] + " (var_ref P))", + else: + print "(var_ref P)", + + # Offset + print "(0 0 0)", + + if tex_inst != "txf": + # Projective divisor + if use_proj: + print "(swiz " + "xyzw"[coord_dim + extra_dim-1] + " (var_ref P))", + else: + print "1", + + # Shadow comparitor + if sampler_type == "2DArrayShadow": # a special case: + print "(swiz w (var_ref P))", # ...array layer is z; shadow is w + elif sampler_type.endswith("Shadow"): + print "(swiz z (var_ref P))", + else: + print "()", + + # Bias/explicit LOD/gradient: + if tex_inst == "txb": + print "(var_ref bias)", + elif tex_inst == "txl" or tex_inst == "txf": + print "(var_ref lod)", + elif tex_inst == "txd": + print "((var_ref dPdx) (var_ref dPdy))", + print "))))\n" + +def generate_fiu_sigs(tex_inst, sampler_type, use_proj = False, unused_fields = 0): + generate_sigs("", tex_inst, sampler_type, use_proj, unused_fields) + generate_sigs("i", tex_inst, sampler_type, use_proj, unused_fields) + generate_sigs("u", tex_inst, sampler_type, use_proj, unused_fields) + +def start_function(name): + sys.stdout = StringIO.StringIO() + print "((function " + name + +def end_function(fs, name): + print "))" + fs[name] = sys.stdout.getvalue(); + sys.stdout.close() + +# Generate all the functions and store them in the supplied dictionary. +# This is better than writing them to actual files since they should never be +# edited; it'd also be easy to confuse them with the many hand-generated files. +# +# Takes a dictionary as an argument. +def generate_texture_functions(fs): + start_function("texture") + generate_fiu_sigs("tex", "1D") + generate_fiu_sigs("tex", "2D") + generate_fiu_sigs("tex", "3D") + generate_fiu_sigs("tex", "Cube") + generate_fiu_sigs("tex", "1DArray") + generate_fiu_sigs("tex", "2DArray") + + generate_fiu_sigs("txb", "1D") + generate_fiu_sigs("txb", "2D") + generate_fiu_sigs("txb", "3D") + generate_fiu_sigs("txb", "Cube") + generate_fiu_sigs("txb", "1DArray") + generate_fiu_sigs("txb", "2DArray") + end_function(fs, "texture") + + start_function("textureProj") + generate_fiu_sigs("tex", "1D", True) + generate_fiu_sigs("tex", "1D", True, 2) + generate_fiu_sigs("tex", "2D", True) + generate_fiu_sigs("tex", "2D", True, 1) + generate_fiu_sigs("tex", "3D", True) + + generate_fiu_sigs("txb", "1D", True) + generate_fiu_sigs("txb", "1D", True, 2) + generate_fiu_sigs("txb", "2D", True) + generate_fiu_sigs("txb", "2D", True, 1) + generate_fiu_sigs("txb", "3D", True) + end_function(fs, "textureProj") + + start_function("textureLod") + generate_fiu_sigs("txl", "1D") + generate_fiu_sigs("txl", "2D") + generate_fiu_sigs("txl", "3D") + generate_fiu_sigs("txl", "Cube") + generate_fiu_sigs("txl", "1DArray") + generate_fiu_sigs("txl", "2DArray") + end_function(fs, "textureLod") + + start_function("texelFetch") + generate_fiu_sigs("txf", "1D") + generate_fiu_sigs("txf", "2D") + generate_fiu_sigs("txf", "3D") + generate_fiu_sigs("txf", "1DArray") + generate_fiu_sigs("txf", "2DArray") + end_function(fs, "texelFetch") + + start_function("textureProjLod") + generate_fiu_sigs("txl", "1D", True) + generate_fiu_sigs("txl", "1D", True, 2) + generate_fiu_sigs("txl", "2D", True) + generate_fiu_sigs("txl", "2D", True, 1) + generate_fiu_sigs("txl", "3D", True) + end_function(fs, "textureProjLod") + + start_function("textureGrad") + generate_fiu_sigs("txd", "1D") + generate_fiu_sigs("txd", "2D") + generate_fiu_sigs("txd", "3D") + generate_fiu_sigs("txd", "Cube") + generate_fiu_sigs("txd", "1DArray") + generate_fiu_sigs("txd", "2DArray") + end_function(fs, "textureGrad") + + start_function("textureProjGrad") + generate_fiu_sigs("txd", "1D", True) + generate_fiu_sigs("txd", "1D", True, 2) + generate_fiu_sigs("txd", "2D", True) + generate_fiu_sigs("txd", "2D", True, 1) + generate_fiu_sigs("txd", "3D", True) + end_function(fs, "textureProjGrad") + + # ARB_texture_rectangle extension + start_function("texture2DRect") + generate_sigs("", "tex", "2DRect") + end_function(fs, "texture2DRect") + + start_function("texture2DRectProj") + generate_sigs("", "tex", "2DRect", True) + generate_sigs("", "tex", "2DRect", True, 1) + end_function(fs, "texture2DRectProj") + + start_function("shadow2DRect") + generate_sigs("", "tex", "2DRectShadow") + end_function(fs, "shadow2DRect") + + start_function("shadow2DRectProj") + generate_sigs("", "tex", "2DRectShadow", True) + end_function(fs, "shadow2DRectProj") + + # EXT_texture_array extension + start_function("texture1DArray") + generate_sigs("", "tex", "1DArray") + generate_sigs("", "txb", "1DArray") + end_function(fs, "texture1DArray") + + start_function("texture1DArrayLod") + generate_sigs("", "txl", "1DArray") + end_function(fs, "texture1DArrayLod") + + start_function("texture2DArray") + generate_sigs("", "tex", "2DArray") + generate_sigs("", "txb", "2DArray") + end_function(fs, "texture2DArray") + + start_function("texture2DArrayLod") + generate_sigs("", "txl", "2DArray") + end_function(fs, "texture2DArrayLod") + + start_function("shadow1DArray") + generate_sigs("", "tex", "1DArrayShadow") + generate_sigs("", "txb", "1DArrayShadow") + end_function(fs, "shadow1DArray") + + start_function("shadow1DArrayLod") + generate_sigs("", "txl", "1DArrayShadow") + end_function(fs, "shadow1DArrayLod") + + start_function("shadow2DArray") + generate_sigs("", "tex", "2DArrayShadow") + end_function(fs, "shadow2DArray") + + # Deprecated (110/120 style) functions with silly names: + start_function("texture1D") + generate_sigs("", "tex", "1D") + generate_sigs("", "txb", "1D") + end_function(fs, "texture1D") + + start_function("texture1DLod") + generate_sigs("", "txl", "1D") + end_function(fs, "texture1DLod") + + start_function("texture1DProj") + generate_sigs("", "tex", "1D", True) + generate_sigs("", "tex", "1D", True, 2) + generate_sigs("", "txb", "1D", True) + generate_sigs("", "txb", "1D", True, 2) + end_function(fs, "texture1DProj") + + start_function("texture1DProjLod") + generate_sigs("", "txl", "1D", True) + generate_sigs("", "txl", "1D", True, 2) + end_function(fs, "texture1DProjLod") + + start_function("texture2D") + generate_sigs("", "tex", "2D") + generate_sigs("", "txb", "2D") + end_function(fs, "texture2D") + + start_function("texture2DLod") + generate_sigs("", "txl", "2D") + end_function(fs, "texture2DLod") + + start_function("texture2DProj") + generate_sigs("", "tex", "2D", True) + generate_sigs("", "tex", "2D", True, 1) + generate_sigs("", "txb", "2D", True) + generate_sigs("", "txb", "2D", True, 1) + end_function(fs, "texture2DProj") + + start_function("texture2DProjLod") + generate_sigs("", "txl", "2D", True) + generate_sigs("", "txl", "2D", True, 1) + end_function(fs, "texture2DProjLod") + + start_function("texture3D") + generate_sigs("", "tex", "3D") + generate_sigs("", "txb", "3D") + end_function(fs, "texture3D") + + start_function("texture3DLod") + generate_sigs("", "txl", "3D") + end_function(fs, "texture3DLod") + + start_function("texture3DProj") + generate_sigs("", "tex", "3D", True) + generate_sigs("", "txb", "3D", True) + end_function(fs, "texture3DProj") + + start_function("texture3DProjLod") + generate_sigs("", "txl", "3D", True) + end_function(fs, "texture3DProjLod") + + start_function("textureCube") + generate_sigs("", "tex", "Cube") + generate_sigs("", "txb", "Cube") + end_function(fs, "textureCube") + + start_function("textureCubeLod") + generate_sigs("", "txl", "Cube") + end_function(fs, "textureCubeLod") + + start_function("shadow1D") + generate_sigs("", "tex", "1DShadow", False, 1) + generate_sigs("", "txb", "1DShadow", False, 1) + end_function(fs, "shadow1D") + + start_function("shadow1DLod") + generate_sigs("", "txl", "1DShadow", False, 1) + end_function(fs, "shadow1DLod") + + start_function("shadow1DProj") + generate_sigs("", "tex", "1DShadow", True, 1) + generate_sigs("", "txb", "1DShadow", True, 1) + end_function(fs, "shadow1DProj") + + start_function("shadow1DProjLod") + generate_sigs("", "txl", "1DShadow", True, 1) + end_function(fs, "shadow1DProjLod") + + start_function("shadow2D") + generate_sigs("", "tex", "2DShadow") + generate_sigs("", "txb", "2DShadow") + end_function(fs, "shadow2D") + + start_function("shadow2DLod") + generate_sigs("", "txl", "2DShadow") + end_function(fs, "shadow2DLod") + + start_function("shadow2DProj") + generate_sigs("", "tex", "2DShadow", True) + generate_sigs("", "txb", "2DShadow", True) + end_function(fs, "shadow2DProj") + + start_function("shadow2DProjLod") + generate_sigs("", "txl", "2DShadow", True) + end_function(fs, "shadow2DProjLod") + + sys.stdout = sys.__stdout__ + return fs + +# If you actually run this script, it'll print out all the functions. +if __name__ == "__main__": + fs = {} + generate_texture_functions(fs); + for k, v in fs.iteritems(): + print v --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/builtin_function.cpp +++ mesa-7.9~git20100924/src/glsl/builtins/tools/builtin_function.cpp @@ -0,0 +1,39 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) 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. + */ + +#include +#include "glsl_parser_extras.h" + +/* A dummy file. When compiling prototypes, we don't care about builtins. + * We really don't want to half-compile builtin_functions.cpp and fail, though. + */ +void +_mesa_glsl_release_functions(void) +{ +} + +void +_mesa_glsl_initialize_functions(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ +} --- mesa-7.9~git20100924.orig/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py +++ mesa-7.9~git20100924/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +def gen_matrix(x, y = 0): + if y == 0: + y = x + type = "mat" + str(x) + if x != y: + type = type + "x" + str(y) + print type + " matrixCompMult(" + type + " x, " + type + " y)\n{" + print " " + type + " z;" + + for i in range(x): + print " z[" + str(i) + "] = x[" + str(i) + "] * y[" + str(i) + "];" + print " return z;\n}" + +print "#version 120" +# 1.10 +gen_matrix(2) +gen_matrix(3) +gen_matrix(4) + +# 1.20 +gen_matrix(2,3) # mat2x3 means 2 columns, 3 rows +gen_matrix(3,2) +gen_matrix(2,4) +gen_matrix(4,2) +gen_matrix(3,4) +gen_matrix(4,3) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/noise4 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/noise4 @@ -0,0 +1,97 @@ +((function noise4 + (signature vec4 + (parameters (declare (in) vec4 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec4 _p) + (assign (constant bool (1)) (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) ) + + (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0))))) + + (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) + (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) + (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) + (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) vec3 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec3 _p) + (assign (constant bool (1)) (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) ) + + (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0))))) + + (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) + (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) + (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) + (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) vec2 p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () vec2 _p) + (assign (constant bool (1)) (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) ) + + (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0))))) + + (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) + (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) + (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) + (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (return (var_ref _r)) + )) + + (signature vec4 + (parameters (declare (in) float p)) + ( + (declare () float _x) + (declare () float _y) + (declare () float _z) + (declare () float _w) + (declare () vec4 _r) + + (declare () float _p) + (assign (constant bool (1)) (xy) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) + + (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p))) + (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0 313.0 29.0 277.0))))) + (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p))) + (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0 313.0 29.0 277.0))))) + + (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x))) + (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y))) + (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z))) + (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w))) + (return (var_ref _r)) + )) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/faceforward +++ mesa-7.9~git20100924/src/glsl/builtins/ir/faceforward @@ -0,0 +1,37 @@ +((function faceforward + (signature float + (parameters + (declare (in) float N) + (declare (in) float I) + (declare (in) float Nref)) + ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression float neg (var_ref N))))))) + + (signature vec2 + (parameters + (declare (in) vec2 N) + (declare (in) vec2 I) + (declare (in) vec2 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec2 neg (var_ref N))))))) + + (signature vec3 + (parameters + (declare (in) vec3 N) + (declare (in) vec3 I) + (declare (in) vec3 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec3 neg (var_ref N))))))) + + (signature vec4 + (parameters + (declare (in) vec4 N) + (declare (in) vec4 I) + (declare (in) vec4 Nref)) + ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) + ((return (var_ref N))) + ((return (expression vec4 neg (var_ref N))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/sinh +++ mesa-7.9~git20100924/src/glsl/builtins/ir/sinh @@ -0,0 +1,30 @@ +((function sinh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/step +++ mesa-7.9~git20100924/src/glsl/builtins/ir/step @@ -0,0 +1,68 @@ +((function step + (signature float + (parameters + (declare (in) float edge) + (declare (in) float x)) + ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) + + (signature vec2 + (parameters + (declare (in) float edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) float edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) float edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) + (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) + (return (var_ref t)))) + + (signature vec2 + (parameters + (declare (in) vec2 edge) + (declare (in) vec2 x)) + ((declare () vec2 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (return (var_ref t)))) + + (signature vec3 + (parameters + (declare (in) vec3 edge) + (declare (in) vec3 x)) + ((declare () vec3 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) + (return (var_ref t)))) + + (signature vec4 + (parameters + (declare (in) vec4 edge) + (declare (in) vec4 x)) + ((declare () vec4 t) + (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) + (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) + (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) + (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) + (return (var_ref t)))) +)) + --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/greaterThanEqual +++ mesa-7.9~git20100924/src/glsl/builtins/ir/greaterThanEqual @@ -0,0 +1,55 @@ +((function greaterThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/length +++ mesa-7.9~git20100924/src/glsl/builtins/ir/length @@ -0,0 +1,21 @@ +((function length + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature float + (parameters + (declare (in) vec2 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec3 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) + + (signature float + (parameters + (declare (in) vec4 arg0)) + ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/smoothstep +++ mesa-7.9~git20100924/src/glsl/builtins/ir/smoothstep @@ -0,0 +1,153 @@ +((function smoothstep + (signature float + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) float x)) + ((declare () float t) + + (assign (constant bool (1)) (x) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (var_ref t)))))))) + + (signature vec2 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec2 x)) + ((declare () vec2 t) + (declare () vec2 retval) + + (assign (constant bool (1)) (x) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t))))))) + + (assign (constant bool (1)) (y) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t))))))) + (return (var_ref retval)) + )) + + (signature vec3 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec3 x)) + ((declare () vec3 t) + (declare () vec3 retval) + + (assign (constant bool (1)) (x) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t))))))) + + (assign (constant bool (1)) (y) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t))))))) + + (assign (constant bool (1)) (z) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t))))))) + (return (var_ref retval)) + )) + + + (signature vec4 + (parameters + (declare (in) float edge0) + (declare (in) float edge1) + (declare (in) vec4 x)) + ((declare () vec4 t) + (declare () vec4 retval) + + (assign (constant bool (1)) (x) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t))))))) + + (assign (constant bool (1)) (y) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t))))))) + + (assign (constant bool (1)) (z) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t))))))) + + (assign (constant bool (1)) (w) (var_ref t) + (expression float max + (expression float min + (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) + (constant float (1.0))) + (constant float (0.0)))) + (assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t))))))) + (return (var_ref retval)) + )) + + (signature vec2 + (parameters + (declare (in) vec2 edge0) + (declare (in) vec2 edge1) + (declare (in) vec2 x)) + ((return (expression vec2 max + (expression vec2 min + (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) + (constant vec2 (1.0 1.0))) + (constant vec2 (0.0 0.0)))))) + + (signature vec3 + (parameters + (declare (in) vec3 edge0) + (declare (in) vec3 edge1) + (declare (in) vec3 x)) + ((return (expression vec3 max + (expression vec3 min + (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) + (constant vec3 (1.0 1.0 1.0))) + (constant vec3 (0.0 0.0 0.0)))))) + + (signature vec4 + (parameters + (declare (in) vec4 edge0) + (declare (in) vec4 edge1) + (declare (in) vec4 x)) + ((return (expression vec4 max + (expression vec4 min + (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) + (constant vec4 (1.0 1.0 1.0 1.0))) + (constant vec4 (0.0 0.0 0.0 0.0)))))) +)) + --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/tan +++ mesa-7.9~git20100924/src/glsl/builtins/ir/tan @@ -0,0 +1,21 @@ +((function tan + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/exp +++ mesa-7.9~git20100924/src/glsl/builtins/ir/exp @@ -0,0 +1,21 @@ +((function exp + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/fract +++ mesa-7.9~git20100924/src/glsl/builtins/ir/fract @@ -0,0 +1,22 @@ +((function fract + (signature float + (parameters + (declare (in) float x)) + ((return (expression float fract (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 fract (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 fract (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 fract (var_ref x))))) +)) + --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/log +++ mesa-7.9~git20100924/src/glsl/builtins/ir/log @@ -0,0 +1,21 @@ +((function log + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/lessThanEqual +++ mesa-7.9~git20100924/src/glsl/builtins/ir/lessThanEqual @@ -0,0 +1,55 @@ +((function lessThanEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/dFdx +++ mesa-7.9~git20100924/src/glsl/builtins/ir/dFdx @@ -0,0 +1,21 @@ +((function dFdx + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdx (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdx (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdx (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdx (var_ref p))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/clamp +++ mesa-7.9~git20100924/src/glsl/builtins/ir/clamp @@ -0,0 +1,148 @@ +((function clamp + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float max (expression float min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec2 max (expression vec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec3 max (expression vec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression vec4 max (expression vec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression int max (expression int min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1) + (declare (in) ivec2 arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1) + (declare (in) ivec3 arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1) + (declare (in) ivec4 arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec2 max (expression ivec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec3 max (expression ivec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1) + (declare (in) int arg2)) + ((return (expression ivec4 max (expression ivec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uint max (expression uint min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1) + (declare (in) uvec2 arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1) + (declare (in) uvec3 arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1) + (declare (in) uvec4 arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec2 max (expression uvec2 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec3 max (expression uvec3 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1) + (declare (in) uint arg2)) + ((return (expression uvec4 max (expression uvec4 min (var_ref arg0) (var_ref arg2)) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/inversesqrt +++ mesa-7.9~git20100924/src/glsl/builtins/ir/inversesqrt @@ -0,0 +1,21 @@ +((function inversesqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float rsq (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 rsq (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 rsq (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 rsq (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/degrees +++ mesa-7.9~git20100924/src/glsl/builtins/ir/degrees @@ -0,0 +1,21 @@ +((function degrees + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/mod +++ mesa-7.9~git20100924/src/glsl/builtins/ir/mod @@ -0,0 +1,43 @@ +((function mod + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/cos +++ mesa-7.9~git20100924/src/glsl/builtins/ir/cos @@ -0,0 +1,21 @@ +((function cos + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float cos (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 cos (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 cos (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 cos (var_ref angle))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/mix +++ mesa-7.9~git20100924/src/glsl/builtins/ir/mix @@ -0,0 +1,88 @@ +((function mix + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1) + (declare (in) float arg2)) + ((return (expression float + (expression float * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression float * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) vec2 arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression vec2 - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) vec3 arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression vec3 - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) vec4 arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression vec4 - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1) + (declare (in) float arg2)) + ((return (expression vec2 + (expression vec2 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec2 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1) + (declare (in) float arg2)) + ((return (expression vec3 + (expression vec3 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec3 * (var_ref arg1) (var_ref arg2)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1) + (declare (in) float arg2)) + ((return (expression vec4 + (expression vec4 * (var_ref arg0) (expression float - (constant float (1.000000)) (var_ref arg2))) (expression vec4 * (var_ref arg1) (var_ref arg2)))))) + + (signature float + (parameters + (declare (in) float v1) + (declare (in) float v2) + (declare (in) bool a)) + ((assign (var_ref a) (var_ref v1) (var_ref v2)) + (return (var_ref v1)))) + + (signature vec2 + (parameters + (declare (in) vec2 v1) + (declare (in) vec2 v2) + (declare (in) bvec2 a)) + ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) + (return (var_ref v1)))) + + (signature vec3 + (parameters + (declare (in) vec3 v1) + (declare (in) vec3 v2) + (declare (in) bvec3 a)) + ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) + (return (var_ref v1)))) + + (signature vec4 + (parameters + (declare (in) vec4 v1) + (declare (in) vec4 v2) + (declare (in) bvec4 a)) + ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) + (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) + (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) + (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2))) + (return (var_ref v1)))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/radians +++ mesa-7.9~git20100924/src/glsl/builtins/ir/radians @@ -0,0 +1,21 @@ +((function radians + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (constant float (0.017453)))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (constant float (0.017453)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/reflect +++ mesa-7.9~git20100924/src/glsl/builtins/ir/reflect @@ -0,0 +1,58 @@ +((function reflect + (signature float + (parameters + (declare (in) float i) + (declare (in) float n)) + ((return (expression float - + (var_ref i) + (expression float * + (constant float (2.0)) + (expression float * + (expression float * + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n)) + ((return (expression vec2 - + (var_ref i) + (expression vec2 * + (constant float (2.0)) + (expression vec2 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n)) + ((return (expression vec3 - + (var_ref i) + (expression vec3 * + (constant float (2.0)) + (expression vec3 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n)) + ((return (expression vec4 - + (var_ref i) + (expression vec4 * + (constant float (2.0)) + (expression vec4 * + (expression float dot + (var_ref n) + (var_ref i)) + (var_ref n))))))) + +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/dot +++ mesa-7.9~git20100924/src/glsl/builtins/ir/dot @@ -0,0 +1,25 @@ +((function dot + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float * (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) + + (signature float + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression float dot (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/pow +++ mesa-7.9~git20100924/src/glsl/builtins/ir/pow @@ -0,0 +1,25 @@ +((function pow + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float pow (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/min +++ mesa-7.9~git20100924/src/glsl/builtins/ir/min @@ -0,0 +1,127 @@ +((function min + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/ftransform +++ mesa-7.9~git20100924/src/glsl/builtins/ir/ftransform @@ -0,0 +1,9 @@ +((declare (uniform) mat4 gl_ModelViewProjectionMatrix) + (declare (in) vec4 gl_Vertex) + (function ftransform + (signature vec4 + (parameters) + ((return (expression vec4 * + (var_ref gl_ModelViewProjectionMatrix) + (var_ref gl_Vertex))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/distance +++ mesa-7.9~git20100924/src/glsl/builtins/ir/distance @@ -0,0 +1,31 @@ +((function distance + (signature float + (parameters + (declare (in) float p0) + (declare (in) float p1)) + ((return (expression float abs (expression float - (var_ref p0) (var_ref p1)))))) + + (signature float + (parameters + (declare (in) vec2 p0) + (declare (in) vec2 p1)) + ((declare () vec2 p) + (assign (constant bool (1)) (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec3 p0) + (declare (in) vec3 p1)) + ((declare () vec3 p) + (assign (constant bool (1)) (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) + + (signature float + (parameters + (declare (in) vec4 p0) + (declare (in) vec4 p1)) + ((declare () vec4 p) + (assign (constant bool (1)) (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) + (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/sin +++ mesa-7.9~git20100924/src/glsl/builtins/ir/sin @@ -0,0 +1,21 @@ +((function sin + (signature float + (parameters + (declare (in) float angle)) + ((return (expression float sin (var_ref angle))))) + + (signature vec2 + (parameters + (declare (in) vec2 angle)) + ((return (expression vec2 sin (var_ref angle))))) + + (signature vec3 + (parameters + (declare (in) vec3 angle)) + ((return (expression vec3 sin (var_ref angle))))) + + (signature vec4 + (parameters + (declare (in) vec4 angle)) + ((return (expression vec4 sin (var_ref angle))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/noise3 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/noise3 @@ -0,0 +1,73 @@ +((function noise3 + (signature vec3 + (parameters (declare (in) vec4 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))))) + + (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) + (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) vec3 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))))) + + (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) + (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) vec2 p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))))) + + (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) + (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (return (var_ref t)) + )) + + (signature vec3 + (parameters (declare (in) float p)) + ( + (declare () float a) + (declare () float b) + (declare () float c) + (declare () vec3 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) + (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0))))) + + (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b))) + (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c))) + (return (var_ref t)) + )) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/asin +++ mesa-7.9~git20100924/src/glsl/builtins/ir/asin @@ -0,0 +1,97 @@ +((function asin + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * + (expression float sign (var_ref x)) + (expression float - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression float * + (expression float sqrt + (expression float - + (constant float (1.0)) + (expression float abs (var_ref x)))) + (expression float + + (constant float (1.5707288)) + (expression float * + (expression float abs (var_ref x)) + (expression float + + (constant float (-0.2121144)) + (expression float * + (constant float (0.0742610)) + (expression float abs (var_ref x)))))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * + (expression vec2 sign (var_ref x)) + (expression vec2 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec2 * + (expression vec2 sqrt + (expression vec2 - + (constant float (1.0)) + (expression vec2 abs (var_ref x)))) + (expression vec2 + + (constant float (1.5707288)) + (expression vec2 * + (expression vec2 abs (var_ref x)) + (expression vec2 + + (constant float (-0.2121144)) + (expression vec2 * + (constant float (0.0742610)) + (expression vec2 abs (var_ref x)))))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * + (expression vec3 sign (var_ref x)) + (expression vec3 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec3 * + (expression vec3 sqrt + (expression vec3 - + (constant float (1.0)) + (expression vec3 abs (var_ref x)))) + (expression vec3 + + (constant float (1.5707288)) + (expression vec3 * + (expression vec3 abs (var_ref x)) + (expression vec3 + + (constant float (-0.2121144)) + (expression vec3 * + (constant float (0.0742610)) + (expression vec3 abs (var_ref x)))))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * + (expression vec4 sign (var_ref x)) + (expression vec4 - + (expression float * + (constant float (3.1415926)) + (constant float (0.5))) + (expression vec4 * + (expression vec4 sqrt + (expression vec4 - + (constant float (1.0)) + (expression vec4 abs (var_ref x)))) + (expression vec4 + + (constant float (1.5707288)) + (expression vec4 * + (expression vec4 abs (var_ref x)) + (expression vec4 + + (constant float (-0.2121144)) + (expression vec4 * + (constant float (0.0742610)) + (expression vec4 abs (var_ref x)))))))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/greaterThan +++ mesa-7.9~git20100924/src/glsl/builtins/ir/greaterThan @@ -0,0 +1,55 @@ +((function greaterThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/acos +++ mesa-7.9~git20100924/src/glsl/builtins/ir/acos @@ -0,0 +1,22 @@ +((function acos + (signature float + (parameters + (declare (in) float x)) + ((return (expression float - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 - (constant float (1.5707963)) + (call asin ((var_ref x))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/floor +++ mesa-7.9~git20100924/src/glsl/builtins/ir/floor @@ -0,0 +1,21 @@ +((function floor + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float floor (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 floor (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 floor (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 floor (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/atan +++ mesa-7.9~git20100924/src/glsl/builtins/ir/atan @@ -0,0 +1,141 @@ +((function atan + (signature float + (parameters + (declare (in) float x)) + ((return (call asin ((expression float * + (var_ref x) + (expression float rsq + (expression float + + (expression float * + (var_ref x) + (var_ref x)) + (constant float (1.0)))))))))) + + (signature vec2 + (parameters + (declare (in) vec2 y_over_x)) + ((return (call asin ((expression vec2 * + (var_ref y_over_x) + (expression vec2 rsq + (expression vec2 + + (expression vec2 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec3 + (parameters + (declare (in) vec3 y_over_x)) + ((return (call asin ((expression vec3 * + (var_ref y_over_x) + (expression vec3 rsq + (expression vec3 + + (expression vec3 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature vec4 + (parameters + (declare (in) vec4 y_over_x)) + ((return (call asin ((expression vec4 * + (var_ref y_over_x) + (expression vec4 rsq + (expression vec4 + + (expression vec4 * + (var_ref y_over_x) + (var_ref y_over_x)) + (constant float (1.0)))))))))) + + (signature float + (parameters + (declare (in ) float y) + (declare (in ) float x) + ) + ( + (declare () float r) + (declare ( ) float abs_retval) + (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) )) +) + (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) ( + (declare ( ) float atan_retval) + (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) )) +) + (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) ) + (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( + (if (expression bool >= (var_ref y) (constant float (0.000000)) ) ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) ) + ) + ( + (declare ( ) float assignment_tmp) + (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) + (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) ) + )) + + ) + ( + )) + + ) + ( + (declare () float sgn) + (assign (constant bool (1)) (x) (var_ref sgn) (expression float sign (var_ref y))) + (assign (constant bool (1)) (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965)))) + )) + + (return (var_ref r) ) + )) + + + + (signature vec2 + (parameters + (declare (in) vec2 y) + (declare (in) vec2 x)) + ((declare () vec2 r) + (assign (constant bool (1)) (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (return (var_ref r)))) + + (signature vec3 + (parameters + (declare (in) vec3 y) + (declare (in) vec3 x)) + ((declare () vec3 r) + (assign (constant bool (1)) (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) (z) (var_ref r) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (return (var_ref r)))) + + (signature vec4 + (parameters + (declare (in) vec4 y) + (declare (in) vec4 x)) + ((declare () vec4 r) + (assign (constant bool (1)) (x) (var_ref r) + (call atan ((swiz x (var_ref y)) + (swiz x (var_ref x))))) + (assign (constant bool (1)) (y) (var_ref r) + (call atan ((swiz y (var_ref y)) + (swiz y (var_ref x))))) + (assign (constant bool (1)) (z) (var_ref r) + (call atan ((swiz z (var_ref y)) + (swiz z (var_ref x))))) + (assign (constant bool (1)) (w) (var_ref r) + (call atan ((swiz w (var_ref y)) + (swiz w (var_ref x))))) + (return (var_ref r))))) + +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/noise1 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/noise1 @@ -0,0 +1,18 @@ +((function noise1 + (signature float + (parameters + (declare (in) float x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec2 x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec3 x)) + ((return (expression float noise (var_ref x))))) + (signature float + (parameters + (declare (in) vec4 x)) + ((return (expression float noise (var_ref x))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/lessThan +++ mesa-7.9~git20100924/src/glsl/builtins/ir/lessThan @@ -0,0 +1,55 @@ +((function lessThan + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/sign +++ mesa-7.9~git20100924/src/glsl/builtins/ir/sign @@ -0,0 +1,42 @@ +((function sign + (signature float + (parameters + (declare (in) float x)) + ((return (expression float sign (var_ref x))))) + + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 sign (var_ref x))))) + + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 sign (var_ref x))))) + + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 sign (var_ref x))))) + + (signature int + (parameters + (declare (in) int x)) + ((return (expression int sign (var_ref x))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 x)) + ((return (expression ivec2 sign (var_ref x))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 x)) + ((return (expression ivec3 sign (var_ref x))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 x)) + ((return (expression ivec4 sign (var_ref x))))) +)) + --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/any +++ mesa-7.9~git20100924/src/glsl/builtins/ir/any @@ -0,0 +1,16 @@ +((function any + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool any (var_ref arg0))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool any (var_ref arg0))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool any (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/max +++ mesa-7.9~git20100924/src/glsl/builtins/ir/max @@ -0,0 +1,127 @@ +((function max + (signature float + (parameters + (declare (in) float arg0) + (declare (in) float arg1)) + ((return (expression float max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) float arg1)) + ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) float arg1)) + ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) float arg1)) + ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) + + (signature int + (parameters + (declare (in) int arg0) + (declare (in) int arg1)) + ((return (expression int max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) int arg1)) + ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) int arg1)) + ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) + + (signature ivec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) int arg1)) + ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uint + (parameters + (declare (in) uint arg0) + (declare (in) uint arg1)) + ((return (expression uint max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uint arg1)) + ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uint arg1)) + ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) + + (signature uvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uint arg1)) + ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/all +++ mesa-7.9~git20100924/src/glsl/builtins/ir/all @@ -0,0 +1,16 @@ +((function all + (signature bool + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) + + (signature bool + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/dFdy +++ mesa-7.9~git20100924/src/glsl/builtins/ir/dFdy @@ -0,0 +1,21 @@ +((function dFdy + (signature float + (parameters + (declare (in) float p)) + ((return (expression float dFdy (var_ref p))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 dFdy (var_ref p))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 dFdy (var_ref p))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 dFdy (var_ref p))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/sqrt +++ mesa-7.9~git20100924/src/glsl/builtins/ir/sqrt @@ -0,0 +1,21 @@ +((function sqrt + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sqrt (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 sqrt (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 sqrt (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 sqrt (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/normalize +++ mesa-7.9~git20100924/src/glsl/builtins/ir/normalize @@ -0,0 +1,21 @@ +((function normalize + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float sign (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/cross +++ mesa-7.9~git20100924/src/glsl/builtins/ir/cross @@ -0,0 +1,7 @@ +((function cross + (signature vec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression vec3 cross (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/fwidth +++ mesa-7.9~git20100924/src/glsl/builtins/ir/fwidth @@ -0,0 +1,29 @@ +((function fwidth + (signature float + (parameters + (declare (in) float p)) + ((return (expression float + + (expression float abs (expression float dFdx (var_ref p))) + (expression float abs (expression float dFdy (var_ref p))))))) + + (signature vec2 + (parameters + (declare (in) vec2 p)) + ((return (expression vec2 + + (expression vec2 abs (expression vec2 dFdx (var_ref p))) + (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) + + (signature vec3 + (parameters + (declare (in) vec3 p)) + ((return (expression vec3 + + (expression vec3 abs (expression vec3 dFdx (var_ref p))) + (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) + + (signature vec4 + (parameters + (declare (in) vec4 p)) + ((return (expression vec4 + + (expression vec4 abs (expression vec4 dFdx (var_ref p))) + (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/abs +++ mesa-7.9~git20100924/src/glsl/builtins/ir/abs @@ -0,0 +1,21 @@ +((function abs + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float abs (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 abs (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 abs (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 abs (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/transpose +++ mesa-7.9~git20100924/src/glsl/builtins/ir/transpose @@ -0,0 +1,139 @@ +((function transpose + (signature mat2 + (parameters + (declare (in) mat2 m)) + ((declare () mat2 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat3x2 + (parameters + (declare (in) mat2x3 m)) + ((declare () mat3x2 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat4x2 + (parameters + (declare (in) mat2x4 m)) + ((declare () mat4x2 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) +(return (var_ref t)))) + + (signature mat2x3 + (parameters + (declare (in) mat3x2 m)) + ((declare () mat2x3 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat3 + (parameters + (declare (in) mat3 m)) + ((declare () mat3 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat4x3 + (parameters + (declare (in) mat3x4 m)) + ((declare () mat4x3 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) +(return (var_ref t)))) + + (signature mat2x4 + (parameters + (declare (in) mat4x2 m)) + ((declare () mat2x4 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat3x4 + (parameters + (declare (in) mat4x3 m)) + ((declare () mat3x4 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) + + (signature mat4 + (parameters + (declare (in) mat4 m)) + ((declare () mat4 t) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) + (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3))))) +(return (var_ref t)))) +) + +) + --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/tanh +++ mesa-7.9~git20100924/src/glsl/builtins/ir/tanh @@ -0,0 +1,42 @@ +((function tanh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float / + (expression float - + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 / + (expression vec2 - + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 / + (expression vec3 - + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 / + (expression vec4 - + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/exp2 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/exp2 @@ -0,0 +1,21 @@ +((function exp2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float exp2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 exp2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 exp2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 exp2 (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/outerProduct +++ mesa-7.9~git20100924/src/glsl/builtins/ir/outerProduct @@ -0,0 +1,92 @@ +((function outerProduct + (signature mat2 + (parameters + (declare (in) vec2 u) + (declare (in) vec2 v)) + ((declare () mat2 m) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec2 v)) + ((declare () mat2x3 m) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat2x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec2 v)) + ((declare () mat2x4 m) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec3 v)) + ((declare () mat3x2 m) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)) + )) + + (signature mat3 + (parameters + (declare (in) vec3 u) + (declare (in) vec3 v)) + ((declare () mat3 m) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat3x4 + (parameters + (declare (in) vec4 u) + (declare (in) vec3 v)) + ((declare () mat3x4 m) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x2 + (parameters + (declare (in) vec2 u) + (declare (in) vec4 v)) + ((declare () mat4x2 m) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4x3 + (parameters + (declare (in) vec3 u) + (declare (in) vec4 v)) + ((declare () mat4x3 m) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) + + (signature mat4 + (parameters + (declare (in) vec4 u) + (declare (in) vec4 v)) + ((declare () mat4 m) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) + (return (var_ref m)))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/notEqual +++ mesa-7.9~git20100924/src/glsl/builtins/ir/notEqual @@ -0,0 +1,73 @@ +((function notEqual + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) bvec2 arg0) + (declare (in) bvec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0) + (declare (in) bvec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0) + (declare (in) bvec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/ceil +++ mesa-7.9~git20100924/src/glsl/builtins/ir/ceil @@ -0,0 +1,21 @@ +((function ceil + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float ceil (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 ceil (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 ceil (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 ceil (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/noise2 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/noise2 @@ -0,0 +1,61 @@ +((function noise2 + (signature vec2 + (parameters (declare (in) vec4 p)) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) + (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (return (var_ref t)) + )) + + (signature vec2 + (parameters (declare (in) vec3 p)) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) + (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (return (var_ref t)) + )) + + (signature vec2 + (parameters + (declare (in ) vec2 p) + ) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) + (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (return (var_ref t)) + )) + + (signature vec2 + (parameters + (declare (in ) float p) + ) + ( + (declare () float a) + (declare () float b) + (declare () vec2 t) + + (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p))) + (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) + (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a))) + (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b))) + (return (var_ref t)) + )) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/equal +++ mesa-7.9~git20100924/src/glsl/builtins/ir/equal @@ -0,0 +1,73 @@ +((function equal + (signature bvec2 + (parameters + (declare (in) vec2 arg0) + (declare (in) vec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) vec3 arg0) + (declare (in) vec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) vec4 arg0) + (declare (in) vec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) bvec2 arg0) + (declare (in) bvec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0) + (declare (in) bvec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0) + (declare (in) bvec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) ivec2 arg0) + (declare (in) ivec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) ivec3 arg0) + (declare (in) ivec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) ivec4 arg0) + (declare (in) ivec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec2 + (parameters + (declare (in) uvec2 arg0) + (declare (in) uvec2 arg1)) + ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec3 + (parameters + (declare (in) uvec3 arg0) + (declare (in) uvec3 arg1)) + ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) + + (signature bvec4 + (parameters + (declare (in) uvec4 arg0) + (declare (in) uvec4 arg1)) + ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/log2 +++ mesa-7.9~git20100924/src/glsl/builtins/ir/log2 @@ -0,0 +1,21 @@ +((function log2 + (signature float + (parameters + (declare (in) float arg0)) + ((return (expression float log2 (var_ref arg0))))) + + (signature vec2 + (parameters + (declare (in) vec2 arg0)) + ((return (expression vec2 log2 (var_ref arg0))))) + + (signature vec3 + (parameters + (declare (in) vec3 arg0)) + ((return (expression vec3 log2 (var_ref arg0))))) + + (signature vec4 + (parameters + (declare (in) vec4 arg0)) + ((return (expression vec4 log2 (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/not +++ mesa-7.9~git20100924/src/glsl/builtins/ir/not @@ -0,0 +1,16 @@ +((function not + (signature bvec2 + (parameters + (declare (in) bvec2 arg0)) + ((return (expression bvec2 ! (var_ref arg0))))) + + (signature bvec3 + (parameters + (declare (in) bvec3 arg0)) + ((return (expression bvec3 ! (var_ref arg0))))) + + (signature bvec4 + (parameters + (declare (in) bvec4 arg0)) + ((return (expression bvec4 ! (var_ref arg0))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/matrixCompMult +++ mesa-7.9~git20100924/src/glsl/builtins/ir/matrixCompMult @@ -0,0 +1,91 @@ +((function matrixCompMult + (signature mat2 + (parameters + (declare (in) mat2 x) + (declare (in) mat2 y)) + ((declare () mat2 z) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) +(return (var_ref z)))) + + (signature mat3 + (parameters + (declare (in) mat3 x) + (declare (in) mat3 y)) + ((declare () mat3 z) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) +(return (var_ref z)))) + + (signature mat4 + (parameters + (declare (in) mat4 x) + (declare (in) mat4 y)) + ((declare () mat4 z) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) + + (signature mat2x3 + (parameters + (declare (in) mat2x3 x) + (declare (in) mat2x3 y)) + ((declare () mat2x3 z) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) +(return (var_ref z)))) + + (signature mat3x2 + (parameters + (declare (in) mat3x2 x) + (declare (in) mat3x2 y)) + ((declare () mat3x2 z) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) +(return (var_ref z)))) + + (signature mat2x4 + (parameters + (declare (in) mat2x4 x) + (declare (in) mat2x4 y)) + ((declare () mat2x4 z) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) +(return (var_ref z)))) + + (signature mat4x2 + (parameters + (declare (in) mat4x2 x) + (declare (in) mat4x2 y)) + ((declare () mat4x2 z) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) + (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) + + (signature mat3x4 + (parameters + (declare (in) mat3x4 x) + (declare (in) mat3x4 y)) + ((declare () mat3x4 z) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) +(return (var_ref z)))) + + (signature mat4x3 + (parameters + (declare (in) mat4x3 x) + (declare (in) mat4x3 y)) + ((declare () mat4x3 z) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) + (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) +(return (var_ref z)))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/refract +++ mesa-7.9~git20100924/src/glsl/builtins/ir/refract @@ -0,0 +1,102 @@ +((function refract + (signature float + (parameters + (declare (in) float i) + (declare (in) float n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float * (var_ref n) (var_ref i)) + (expression float * (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant float (0.0)))) + ((return (expression float - + (expression float * (var_ref eta) (var_ref i)) + (expression float * + (expression float + + (expression float * (var_ref eta) + (expression float * (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec2 + (parameters + (declare (in) vec2 i) + (declare (in) vec2 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec2 (0.0 0.0)))) + ((return (expression vec2 - + (expression vec2 * (var_ref eta) (var_ref i)) + (expression vec2 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec3 + (parameters + (declare (in) vec3 i) + (declare (in) vec3 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec3 (0.0 0.0 0.0)))) + ((return (expression vec3 - + (expression vec3 * (var_ref eta) (var_ref i)) + (expression vec3 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + + (signature vec4 + (parameters + (declare (in) vec4 i) + (declare (in) vec4 n) + (declare (in) float eta)) + ((declare () float k) + (assign (constant bool (1)) (x) (var_ref k) + (expression float - (constant float (1.0)) + (expression float * (var_ref eta) + (expression float * (var_ref eta) + (expression float - (constant float (1.0)) + (expression float * + (expression float dot (var_ref n) (var_ref i)) + (expression float dot (var_ref n) (var_ref i)))))))) + (if (expression bool < (var_ref k) (constant float (0.0))) + ((return (constant vec4 (0.0 0.0 0.0 0.0)))) + ((return (expression vec4 - + (expression vec4 * (var_ref eta) (var_ref i)) + (expression vec4 * + (expression float + + (expression float * (var_ref eta) + (expression float dot (var_ref n) (var_ref i))) + (expression float sqrt (var_ref k))) + (var_ref n)))))))) + +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/ir/cosh +++ mesa-7.9~git20100924/src/glsl/builtins/ir/cosh @@ -0,0 +1,30 @@ +((function cosh + (signature float + (parameters + (declare (in) float x)) + ((return (expression float * (constant float (0.5)) + (expression float + + (expression float exp (var_ref x)) + (expression float exp (expression float neg (var_ref x)))))))) + (signature vec2 + (parameters + (declare (in) vec2 x)) + ((return (expression vec2 * (constant vec2 (0.5)) + (expression vec2 + + (expression vec2 exp (var_ref x)) + (expression vec2 exp (expression vec2 neg (var_ref x)))))))) + (signature vec3 + (parameters + (declare (in) vec3 x)) + ((return (expression vec3 * (constant vec3 (0.5)) + (expression vec3 + + (expression vec3 exp (var_ref x)) + (expression vec3 exp (expression vec3 neg (var_ref x)))))))) + (signature vec4 + (parameters + (declare (in) vec4 x)) + ((return (expression vec4 * (constant vec4 (0.5)) + (expression vec4 + + (expression vec4 exp (var_ref x)) + (expression vec4 exp (expression vec4 neg (var_ref x)))))))) +)) --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/EXT_texture_array.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/EXT_texture_array.frag @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArray(sampler1DArray sampler, vec2 coord, float bias); + +vec4 texture2DArray(sampler2DArray sampler, vec3 coord); +vec4 texture2DArray(sampler2DArray sampler, vec3 coord, float bias); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord, float bias); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/120.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/120.frag @@ -0,0 +1,396 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/100.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/100.frag @@ -0,0 +1,300 @@ +#version 100 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/110.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/110.frag @@ -0,0 +1,364 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); + + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/130.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/130.frag @@ -0,0 +1,1031 @@ +#version 130 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +float sinh(float x); +vec2 sinh(vec2 x); +vec3 sinh(vec3 x); +vec4 sinh(vec4 x); + +float cosh(float x); +vec2 cosh(vec2 x); +vec3 cosh(vec3 x); +vec4 cosh(vec4 x); + +float tanh(float x); +vec2 tanh(vec2 x); +vec3 tanh(vec3 x); +vec4 tanh(vec4 x); + +#if 0 +float asinh(float x); +vec2 asinh(vec2 x); +vec3 asinh(vec3 x); +vec4 asinh(vec4 x); + +float acosh(float x); +vec2 acosh(vec2 x); +vec3 acosh(vec3 x); +vec4 acosh(vec4 x); + +float atanh(float x); +vec2 atanh(vec2 x); +vec3 atanh(vec3 x); +vec4 atanh(vec4 x); +#endif + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); +int abs(int x); +ivec2 abs(ivec2 x); +ivec3 abs(ivec3 x); +ivec4 abs(ivec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); +int sign(int x); +ivec2 sign(ivec2 x); +ivec3 sign(ivec3 x); +ivec4 sign(ivec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +int min(int x, int y); +ivec2 min(ivec2 x, ivec2 y); +ivec3 min(ivec3 x, ivec3 y); +ivec4 min(ivec4 x, ivec4 y); + +ivec2 min(ivec2 x, int y); +ivec3 min(ivec3 x, int y); +ivec4 min(ivec4 x, int y); + +uint min(uint x, uint y); +uvec2 min(uvec2 x, uvec2 y); +uvec3 min(uvec3 x, uvec3 y); +uvec4 min(uvec4 x, uvec4 y); + +uvec2 min(uvec2 x, uint y); +uvec3 min(uvec3 x, uint y); +uvec4 min(uvec4 x, uint y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +int max(int x, int y); +ivec2 max(ivec2 x, ivec2 y); +ivec3 max(ivec3 x, ivec3 y); +ivec4 max(ivec4 x, ivec4 y); + +ivec2 max(ivec2 x, int y); +ivec3 max(ivec3 x, int y); +ivec4 max(ivec4 x, int y); + +uint max(uint x, uint y); +uvec2 max(uvec2 x, uvec2 y); +uvec3 max(uvec3 x, uvec3 y); +uvec4 max(uvec4 x, uvec4 y); + +uvec2 max(uvec2 x, uint y); +uvec3 max(uvec3 x, uint y); +uvec4 max(uvec4 x, uint y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +int clamp(int x, int minVal, int maxVal); +ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); +ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); +ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); + +ivec2 clamp(ivec2 x, int minVal, int maxVal); +ivec3 clamp(ivec3 x, int minVal, int maxVal); +ivec4 clamp(ivec4 x, int minVal, int maxVal); + +uint clamp(uint x, uint minVal, uint maxVal); +uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); +uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); +uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); + +uvec2 clamp(uvec2 x, uint minVal, uint maxVal); +uvec3 clamp(uvec3 x, uint minVal, uint maxVal); +uvec4 clamp(uvec4 x, uint minVal, uint maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +#if 0 +bool isnan(float x); +bvec2 isnan(vec2 x); +bvec3 isnan(vec3 x); +bvec4 isnan(vec4 x); + +bool isinf(float x); +bvec2 isinf(vec2 x); +bvec3 isinf(vec3 x); +bvec4 isinf(vec4 x); +#endif + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); +bvec2 lessThan(uvec2 x, uvec2 y); +bvec3 lessThan(uvec3 x, uvec3 y); +bvec4 lessThan(uvec4 x, uvec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); +bvec2 lessThanEqual(uvec2 x, uvec2 y); +bvec3 lessThanEqual(uvec3 x, uvec3 y); +bvec4 lessThanEqual(uvec4 x, uvec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); +bvec2 greaterThan(uvec2 x, uvec2 y); +bvec3 greaterThan(uvec3 x, uvec3 y); +bvec4 greaterThan(uvec4 x, uvec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); +bvec2 greaterThanEqual(uvec2 x, uvec2 y); +bvec3 greaterThanEqual(uvec3 x, uvec3 y); +bvec4 greaterThanEqual(uvec4 x, uvec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(uvec2 x, uvec2 y); +bvec3 equal(uvec3 x, uvec3 y); +bvec4 equal(uvec4 x, uvec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(uvec2 x, uvec2 y); +bvec3 notEqual(uvec3 x, uvec3 y); +bvec4 notEqual(uvec4 x, uvec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ + +#if 0 +/* textureSize */ +int textureSize( sampler1D sampler, int lod); +int textureSize(isampler1D sampler, int lod); +int textureSize(usampler1D sampler, int lod); + +ivec2 textureSize( sampler2D sampler, int lod); +ivec2 textureSize(isampler2D sampler, int lod); +ivec2 textureSize(usampler2D sampler, int lod); + +ivec3 textureSize( sampler3D sampler, int lod); +ivec3 textureSize(isampler3D sampler, int lod); +ivec3 textureSize(usampler3D sampler, int lod); + +ivec2 textureSize( samplerCube sampler, int lod); +ivec2 textureSize(isamplerCube sampler, int lod); +ivec2 textureSize(usamplerCube sampler, int lod); + +int textureSize(sampler1DShadow sampler, int lod); +ivec2 textureSize(sampler2DShadow sampler, int lod); +ivec2 textureSize(samplerCubeShadow sampler, int lod); + +ivec2 textureSize( sampler1DArray sampler, int lod); +ivec2 textureSize(isampler1DArray sampler, int lod); +ivec2 textureSize(usampler1DArray sampler, int lod); +ivec3 textureSize( sampler2DArray sampler, int lod); +ivec2 textureSize(isampler2DArray sampler, int lod); +ivec2 textureSize(usampler2DArray sampler, int lod); + +ivec2 textureSize(sampler1DArrayShadow sampler, int lod); +ivec3 textureSize(sampler2DArrayShadow sampler, int lod); +#endif + +/* texture - no bias */ + vec4 texture( sampler1D sampler, float P); +ivec4 texture(isampler1D sampler, float P); +uvec4 texture(usampler1D sampler, float P); + + vec4 texture( sampler2D sampler, vec2 P); +ivec4 texture(isampler2D sampler, vec2 P); +uvec4 texture(usampler2D sampler, vec2 P); + + vec4 texture( sampler3D sampler, vec3 P); +ivec4 texture(isampler3D sampler, vec3 P); +uvec4 texture(usampler3D sampler, vec3 P); + + vec4 texture( samplerCube sampler, vec3 P); +ivec4 texture(isamplerCube sampler, vec3 P); +uvec4 texture(usamplerCube sampler, vec3 P); + +float texture(sampler1DShadow sampler, vec3 P); +float texture(sampler2DShadow sampler, vec3 P); +float texture(samplerCubeShadow sampler, vec4 P); + + vec4 texture( sampler1DArray sampler, vec2 P); +ivec4 texture(isampler1DArray sampler, vec2 P); +uvec4 texture(usampler1DArray sampler, vec2 P); + + vec4 texture( sampler2DArray sampler, vec3 P); +ivec4 texture(isampler2DArray sampler, vec3 P); +uvec4 texture(usampler2DArray sampler, vec3 P); + +float texture(sampler1DArrayShadow sampler, vec3 P); +float texture(sampler2DArrayShadow sampler, vec4 P); + +/* texture - bias variants */ + vec4 texture( sampler1D sampler, float P, float bias); +ivec4 texture(isampler1D sampler, float P, float bias); +uvec4 texture(usampler1D sampler, float P, float bias); + + vec4 texture( sampler2D sampler, vec2 P, float bias); +ivec4 texture(isampler2D sampler, vec2 P, float bias); +uvec4 texture(usampler2D sampler, vec2 P, float bias); + + vec4 texture( sampler3D sampler, vec3 P, float bias); +ivec4 texture(isampler3D sampler, vec3 P, float bias); +uvec4 texture(usampler3D sampler, vec3 P, float bias); + + vec4 texture( samplerCube sampler, vec3 P, float bias); +ivec4 texture(isamplerCube sampler, vec3 P, float bias); +uvec4 texture(usamplerCube sampler, vec3 P, float bias); + +float texture(sampler1DShadow sampler, vec3 P, float bias); +float texture(sampler2DShadow sampler, vec3 P, float bias); +float texture(samplerCubeShadow sampler, vec4 P, float bias); + + vec4 texture( sampler1DArray sampler, vec2 P, float bias); +ivec4 texture(isampler1DArray sampler, vec2 P, float bias); +uvec4 texture(usampler1DArray sampler, vec2 P, float bias); + + vec4 texture( sampler2DArray sampler, vec3 P, float bias); +ivec4 texture(isampler2DArray sampler, vec3 P, float bias); +uvec4 texture(usampler2DArray sampler, vec3 P, float bias); + +float texture(sampler1DArrayShadow sampler, vec3 P, float bias); + +/* textureProj - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P); +ivec4 textureProj(isampler1D sampler, vec2 P); +uvec4 textureProj(usampler1D sampler, vec2 P); + vec4 textureProj( sampler1D sampler, vec4 P); +ivec4 textureProj(isampler1D sampler, vec4 P); +uvec4 textureProj(usampler1D sampler, vec4 P); + + vec4 textureProj( sampler2D sampler, vec3 P); +ivec4 textureProj(isampler2D sampler, vec3 P); +uvec4 textureProj(usampler2D sampler, vec3 P); + vec4 textureProj( sampler2D sampler, vec4 P); +ivec4 textureProj(isampler2D sampler, vec4 P); +uvec4 textureProj(usampler2D sampler, vec4 P); + + vec4 textureProj( sampler3D sampler, vec4 P); +ivec4 textureProj(isampler3D sampler, vec4 P); +uvec4 textureProj(usampler3D sampler, vec4 P); + +float textureProj(sampler1DShadow sampler, vec4 P); +float textureProj(sampler2DShadow sampler, vec4 P); + +/* textureProj - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, float bias); + +/* textureLod */ + vec4 textureLod( sampler1D sampler, float P, float lod); +ivec4 textureLod(isampler1D sampler, float P, float lod); +uvec4 textureLod(usampler1D sampler, float P, float lod); + + vec4 textureLod( sampler2D sampler, vec2 P, float lod); +ivec4 textureLod(isampler2D sampler, vec2 P, float lod); +uvec4 textureLod(usampler2D sampler, vec2 P, float lod); + + vec4 textureLod( sampler3D sampler, vec3 P, float lod); +ivec4 textureLod(isampler3D sampler, vec3 P, float lod); +uvec4 textureLod(usampler3D sampler, vec3 P, float lod); + + vec4 textureLod( samplerCube sampler, vec3 P, float lod); +ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); +uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); + +float textureLod(sampler1DShadow sampler, vec3 P, float lod); +float textureLod(sampler2DShadow sampler, vec3 P, float lod); + + vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); +ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); +uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); + + vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); +ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); +uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); + +float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); + +#if 0 +/* textureOffset - no bias */ + vec4 textureOffset( sampler1D sampler, float P, int offset); +ivec4 textureOffset(isampler1D sampler, float P, int offset); +uvec4 textureOffset(usampler1D sampler, float P, int offset); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); + +float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); + +/* textureOffset - bias variants */ + vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); +ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); +uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); + +float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); +#endif + +/* texelFetch */ + vec4 texelFetch( sampler1D sampler, int P, int lod); +ivec4 texelFetch(isampler1D sampler, int P, int lod); +uvec4 texelFetch(usampler1D sampler, int P, int lod); + + vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); + + vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); + +#if 0 +/* texelFetchOffset */ + vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); +ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); +uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); + + vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); + + vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); +ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); +uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); + + vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); +ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); +uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); + + vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); + +/* textureProjOffset - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset); + vec4 textureProj( sampler1D sampler, vec4 P, int offset); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset); + +/* textureProjOffset - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias); + +/* textureLodOffset */ + vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); +ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); +uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); + + vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); +ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); +uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); + +float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); +float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); +ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); +uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); + + vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); + +float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); +#endif + +/* textureProjLod */ + vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); + vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); + vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); + +float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); +float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); + +#if 0 +/* textureProjLodOffset */ + vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); + vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); + + vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); + vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); + + vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); +ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); +uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); + +float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); +float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); +#endif + +/* textureGrad */ + vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); + + vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); + +float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); +float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); + +float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureGradOffset */ + vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); +uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); + + vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); + + vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + + vec4 textureGradOffset( samplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + +float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); +float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); +uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); + + vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + +float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); +float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); +#endif + +/* textureProjGrad */ + vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); + vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); + + vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); + vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); + + vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); + +float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); +float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureProjGradOffset */ + vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); + vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); + + vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); + +float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); +float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o); +#endif + +/* + * The following texture functions are deprecated: + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions + */ +float dFdx(float p); +vec2 dFdx(vec2 p); +vec3 dFdx(vec3 p); +vec4 dFdx(vec4 p); + +float dFdy(float p); +vec2 dFdy(vec2 p); +vec3 dFdy(vec3 p); +vec4 dFdy(vec4 p); + +float fwidth(float p); +vec2 fwidth(vec2 p); +vec3 fwidth(vec3 p); +vec4 fwidth(vec4 p); + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/ARB_texture_rectangle.frag +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/ARB_texture_rectangle.frag @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/ARB_texture_rectangle.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/ARB_texture_rectangle.vert @@ -0,0 +1,7 @@ +#extension GL_ARB_texture_rectangle : enable +vec4 texture2DRect(sampler2DRect sampler, vec2 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); +vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); + +vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); +vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/110.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/110.vert @@ -0,0 +1,351 @@ +#version 110 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/EXT_texture_array.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/EXT_texture_array.vert @@ -0,0 +1,11 @@ +#extension GL_EXT_texture_array : enable +vec4 texture1DArray(sampler1DArray sampler, vec2 coord); +vec4 texture1DArrayLod(sampler1DArray sampler, vec2 coord, float lod); + +vec4 texture2DArray(sampler2DArray sampler, vec3 coord); +vec4 texture2DArrayLod(sampler2DArray sampler, vec3 coord, float lod); + +vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); +vec4 shadow1DArrayLod(sampler1DArrayShadow sampler, vec3 coord, float lod); + +vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/130.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/130.vert @@ -0,0 +1,1019 @@ +#version 130 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +float sinh(float x); +vec2 sinh(vec2 x); +vec3 sinh(vec3 x); +vec4 sinh(vec4 x); + +float cosh(float x); +vec2 cosh(vec2 x); +vec3 cosh(vec3 x); +vec4 cosh(vec4 x); + +float tanh(float x); +vec2 tanh(vec2 x); +vec3 tanh(vec3 x); +vec4 tanh(vec4 x); + +#if 0 +float asinh(float x); +vec2 asinh(vec2 x); +vec3 asinh(vec3 x); +vec4 asinh(vec4 x); + +float acosh(float x); +vec2 acosh(vec2 x); +vec3 acosh(vec3 x); +vec4 acosh(vec4 x); + +float atanh(float x); +vec2 atanh(vec2 x); +vec3 atanh(vec3 x); +vec4 atanh(vec4 x); +#endif + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); +int abs(int x); +ivec2 abs(ivec2 x); +ivec3 abs(ivec3 x); +ivec4 abs(ivec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); +int sign(int x); +ivec2 sign(ivec2 x); +ivec3 sign(ivec3 x); +ivec4 sign(ivec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +int min(int x, int y); +ivec2 min(ivec2 x, ivec2 y); +ivec3 min(ivec3 x, ivec3 y); +ivec4 min(ivec4 x, ivec4 y); + +ivec2 min(ivec2 x, int y); +ivec3 min(ivec3 x, int y); +ivec4 min(ivec4 x, int y); + +uint min(uint x, uint y); +uvec2 min(uvec2 x, uvec2 y); +uvec3 min(uvec3 x, uvec3 y); +uvec4 min(uvec4 x, uvec4 y); + +uvec2 min(uvec2 x, uint y); +uvec3 min(uvec3 x, uint y); +uvec4 min(uvec4 x, uint y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +int max(int x, int y); +ivec2 max(ivec2 x, ivec2 y); +ivec3 max(ivec3 x, ivec3 y); +ivec4 max(ivec4 x, ivec4 y); + +ivec2 max(ivec2 x, int y); +ivec3 max(ivec3 x, int y); +ivec4 max(ivec4 x, int y); + +uint max(uint x, uint y); +uvec2 max(uvec2 x, uvec2 y); +uvec3 max(uvec3 x, uvec3 y); +uvec4 max(uvec4 x, uvec4 y); + +uvec2 max(uvec2 x, uint y); +uvec3 max(uvec3 x, uint y); +uvec4 max(uvec4 x, uint y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +int clamp(int x, int minVal, int maxVal); +ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); +ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); +ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); + +ivec2 clamp(ivec2 x, int minVal, int maxVal); +ivec3 clamp(ivec3 x, int minVal, int maxVal); +ivec4 clamp(ivec4 x, int minVal, int maxVal); + +uint clamp(uint x, uint minVal, uint maxVal); +uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); +uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); +uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); + +uvec2 clamp(uvec2 x, uint minVal, uint maxVal); +uvec3 clamp(uvec3 x, uint minVal, uint maxVal); +uvec4 clamp(uvec4 x, uint minVal, uint maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +#if 0 +bool isnan(float x); +bvec2 isnan(vec2 x); +bvec3 isnan(vec3 x); +bvec4 isnan(vec4 x); + +bool isinf(float x); +bvec2 isinf(vec2 x); +bvec3 isinf(vec3 x); +bvec4 isinf(vec4 x); +#endif + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); +bvec2 lessThan(uvec2 x, uvec2 y); +bvec3 lessThan(uvec3 x, uvec3 y); +bvec4 lessThan(uvec4 x, uvec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); +bvec2 lessThanEqual(uvec2 x, uvec2 y); +bvec3 lessThanEqual(uvec3 x, uvec3 y); +bvec4 lessThanEqual(uvec4 x, uvec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); +bvec2 greaterThan(uvec2 x, uvec2 y); +bvec3 greaterThan(uvec3 x, uvec3 y); +bvec4 greaterThan(uvec4 x, uvec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); +bvec2 greaterThanEqual(uvec2 x, uvec2 y); +bvec3 greaterThanEqual(uvec3 x, uvec3 y); +bvec4 greaterThanEqual(uvec4 x, uvec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(uvec2 x, uvec2 y); +bvec3 equal(uvec3 x, uvec3 y); +bvec4 equal(uvec4 x, uvec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(uvec2 x, uvec2 y); +bvec3 notEqual(uvec3 x, uvec3 y); +bvec4 notEqual(uvec4 x, uvec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ + +#if 0 +/* textureSize */ +int textureSize( sampler1D sampler, int lod); +int textureSize(isampler1D sampler, int lod); +int textureSize(usampler1D sampler, int lod); + +ivec2 textureSize( sampler2D sampler, int lod); +ivec2 textureSize(isampler2D sampler, int lod); +ivec2 textureSize(usampler2D sampler, int lod); + +ivec3 textureSize( sampler3D sampler, int lod); +ivec3 textureSize(isampler3D sampler, int lod); +ivec3 textureSize(usampler3D sampler, int lod); + +ivec2 textureSize( samplerCube sampler, int lod); +ivec2 textureSize(isamplerCube sampler, int lod); +ivec2 textureSize(usamplerCube sampler, int lod); + +int textureSize(sampler1DShadow sampler, int lod); +ivec2 textureSize(sampler2DShadow sampler, int lod); +ivec2 textureSize(samplerCubeShadow sampler, int lod); + +ivec2 textureSize( sampler1DArray sampler, int lod); +ivec2 textureSize(isampler1DArray sampler, int lod); +ivec2 textureSize(usampler1DArray sampler, int lod); +ivec3 textureSize( sampler2DArray sampler, int lod); +ivec2 textureSize(isampler2DArray sampler, int lod); +ivec2 textureSize(usampler2DArray sampler, int lod); + +ivec2 textureSize(sampler1DArrayShadow sampler, int lod); +ivec3 textureSize(sampler2DArrayShadow sampler, int lod); +#endif + +/* texture - no bias */ + vec4 texture( sampler1D sampler, float P); +ivec4 texture(isampler1D sampler, float P); +uvec4 texture(usampler1D sampler, float P); + + vec4 texture( sampler2D sampler, vec2 P); +ivec4 texture(isampler2D sampler, vec2 P); +uvec4 texture(usampler2D sampler, vec2 P); + + vec4 texture( sampler3D sampler, vec3 P); +ivec4 texture(isampler3D sampler, vec3 P); +uvec4 texture(usampler3D sampler, vec3 P); + + vec4 texture( samplerCube sampler, vec3 P); +ivec4 texture(isamplerCube sampler, vec3 P); +uvec4 texture(usamplerCube sampler, vec3 P); + +float texture(sampler1DShadow sampler, vec3 P); +float texture(sampler2DShadow sampler, vec3 P); +float texture(samplerCubeShadow sampler, vec4 P); + + vec4 texture( sampler1DArray sampler, vec2 P); +ivec4 texture(isampler1DArray sampler, vec2 P); +uvec4 texture(usampler1DArray sampler, vec2 P); + + vec4 texture( sampler2DArray sampler, vec3 P); +ivec4 texture(isampler2DArray sampler, vec3 P); +uvec4 texture(usampler2DArray sampler, vec3 P); + +float texture(sampler1DArrayShadow sampler, vec3 P); +float texture(sampler2DArrayShadow sampler, vec4 P); + +/* texture - bias variants */ + vec4 texture( sampler1D sampler, float P, float bias); +ivec4 texture(isampler1D sampler, float P, float bias); +uvec4 texture(usampler1D sampler, float P, float bias); + + vec4 texture( sampler2D sampler, vec2 P, float bias); +ivec4 texture(isampler2D sampler, vec2 P, float bias); +uvec4 texture(usampler2D sampler, vec2 P, float bias); + + vec4 texture( sampler3D sampler, vec3 P, float bias); +ivec4 texture(isampler3D sampler, vec3 P, float bias); +uvec4 texture(usampler3D sampler, vec3 P, float bias); + + vec4 texture( samplerCube sampler, vec3 P, float bias); +ivec4 texture(isamplerCube sampler, vec3 P, float bias); +uvec4 texture(usamplerCube sampler, vec3 P, float bias); + +float texture(sampler1DShadow sampler, vec3 P, float bias); +float texture(sampler2DShadow sampler, vec3 P, float bias); +float texture(samplerCubeShadow sampler, vec4 P, float bias); + + vec4 texture( sampler1DArray sampler, vec2 P, float bias); +ivec4 texture(isampler1DArray sampler, vec2 P, float bias); +uvec4 texture(usampler1DArray sampler, vec2 P, float bias); + + vec4 texture( sampler2DArray sampler, vec3 P, float bias); +ivec4 texture(isampler2DArray sampler, vec3 P, float bias); +uvec4 texture(usampler2DArray sampler, vec3 P, float bias); + +float texture(sampler1DArrayShadow sampler, vec3 P, float bias); + +/* textureProj - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P); +ivec4 textureProj(isampler1D sampler, vec2 P); +uvec4 textureProj(usampler1D sampler, vec2 P); + vec4 textureProj( sampler1D sampler, vec4 P); +ivec4 textureProj(isampler1D sampler, vec4 P); +uvec4 textureProj(usampler1D sampler, vec4 P); + + vec4 textureProj( sampler2D sampler, vec3 P); +ivec4 textureProj(isampler2D sampler, vec3 P); +uvec4 textureProj(usampler2D sampler, vec3 P); + vec4 textureProj( sampler2D sampler, vec4 P); +ivec4 textureProj(isampler2D sampler, vec4 P); +uvec4 textureProj(usampler2D sampler, vec4 P); + + vec4 textureProj( sampler3D sampler, vec4 P); +ivec4 textureProj(isampler3D sampler, vec4 P); +uvec4 textureProj(usampler3D sampler, vec4 P); + +float textureProj(sampler1DShadow sampler, vec4 P); +float textureProj(sampler2DShadow sampler, vec4 P); + +/* textureProj - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, float bias); + +/* textureLod */ + vec4 textureLod( sampler1D sampler, float P, float lod); +ivec4 textureLod(isampler1D sampler, float P, float lod); +uvec4 textureLod(usampler1D sampler, float P, float lod); + + vec4 textureLod( sampler2D sampler, vec2 P, float lod); +ivec4 textureLod(isampler2D sampler, vec2 P, float lod); +uvec4 textureLod(usampler2D sampler, vec2 P, float lod); + + vec4 textureLod( sampler3D sampler, vec3 P, float lod); +ivec4 textureLod(isampler3D sampler, vec3 P, float lod); +uvec4 textureLod(usampler3D sampler, vec3 P, float lod); + + vec4 textureLod( samplerCube sampler, vec3 P, float lod); +ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); +uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); + +float textureLod(sampler1DShadow sampler, vec3 P, float lod); +float textureLod(sampler2DShadow sampler, vec3 P, float lod); + + vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); +ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); +uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); + + vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); +ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); +uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); + +float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); + +#if 0 +/* textureOffset - no bias */ + vec4 textureOffset( sampler1D sampler, float P, int offset); +ivec4 textureOffset(isampler1D sampler, float P, int offset); +uvec4 textureOffset(usampler1D sampler, float P, int offset); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); + +float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); + +/* textureOffset - bias variants */ + vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); +ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); +uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); + + vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); +ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); +uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); + +float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); +float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); + + vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); +ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); +uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); + + vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); + +float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); +#endif + +/* texelFetch */ + vec4 texelFetch( sampler1D sampler, int P, int lod); +ivec4 texelFetch(isampler1D sampler, int P, int lod); +uvec4 texelFetch(usampler1D sampler, int P, int lod); + + vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); + + vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); +ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); +uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); + + vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); +ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); +uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); + +#if 0 +/* texelFetchOffset */ + vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); +ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); +uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); + + vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); + + vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); +ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); +uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); + + vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); +ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); +uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); + + vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); +uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); + +/* textureProjOffset - no bias */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset); + vec4 textureProj( sampler1D sampler, vec4 P, int offset); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset); + +/* textureProjOffset - bias variants */ + vec4 textureProj( sampler1D sampler, vec2 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec2 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec2 P, int offset, float bias); + vec4 textureProj( sampler1D sampler, vec4 P, int offset, float bias); +ivec4 textureProj(isampler1D sampler, vec4 P, int offset, float bias); +uvec4 textureProj(usampler1D sampler, vec4 P, int offset, float bias); + + vec4 textureProj( sampler2D sampler, vec3 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec3 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec3 P, ivec2 offset, float bias); + vec4 textureProj( sampler2D sampler, vec4 P, ivec2 offset, float bias); +ivec4 textureProj(isampler2D sampler, vec4 P, ivec2 offset, float bias); +uvec4 textureProj(usampler2D sampler, vec4 P, ivec2 offset, float bias); + + vec4 textureProj( sampler3D sampler, vec4 P, ivec3 offset, float bias); +ivec4 textureProj(isampler3D sampler, vec4 P, ivec3 offset, float bias); +uvec4 textureProj(usampler3D sampler, vec4 P, ivec3 offset, float bias); + +float textureProj(sampler1DShadow sampler, vec4 P, int offset, float bias); +float textureProj(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias); + +/* textureLodOffset */ + vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); +ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); +uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); + + vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); +ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); +uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); + +float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); +float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); + + vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); +ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); +uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); + + vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); +ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); +uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); + +float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); +#endif + +/* textureProjLod */ + vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); + vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); + vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); + + vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); +ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); +uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); + +float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); +float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); + +#if 0 +/* textureProjLodOffset */ + vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); + vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); +ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); +uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); + + vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); + vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); +ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); +uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); + + vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); +ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); +uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); + +float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); +float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); +#endif + +/* textureGrad */ + vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); + + vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); +uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); + +float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); +float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); + + vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); + + vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); + +float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); +float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureGradOffset */ + vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); +uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); + + vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); +uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); + + vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + + vec4 textureGradOffset( samplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +ivec4 textureGradOffset(isamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); +uvec4 textureGradOffset(usamplerCube s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); + +float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); +float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); +ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); +uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); + + vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + +float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); +float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); +#endif + +/* textureProjGrad */ + vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); + vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); +ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); +uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); + + vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); + vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); +uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); + + vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); +uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); + +float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); +float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); + +#if 0 +/* textureProjGradOffset */ + vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); + vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); +ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); +uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); + + vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); + vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); +uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); + + vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); +uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); + +float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); +float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, vec2 o); +#endif + +/* + * The following texture functions are deprecated: + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1D (sampler1D sampler, float coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); +vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2D (sampler2D sampler, vec2 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); +vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3D (sampler3D sampler, vec3 coord, float bias); +vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCube (samplerCube sampler, vec3 coord, float bias); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/120.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/120.vert @@ -0,0 +1,383 @@ +#version 120 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +vec4 ftransform(); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); +mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); +mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); +mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); +mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); +mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); +mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); + +mat2 outerProduct(vec2 c, vec2 r); +mat3 outerProduct(vec3 c, vec3 r); +mat4 outerProduct(vec4 c, vec4 r); + +mat2x3 outerProduct(vec3 c, vec2 r); +mat3x2 outerProduct(vec2 c, vec3 r); + +mat2x4 outerProduct(vec4 c, vec2 r); +mat4x2 outerProduct(vec2 c, vec4 r); + +mat3x4 outerProduct(vec4 c, vec3 r); +mat4x3 outerProduct(vec3 c, vec4 r); + +mat2 transpose(mat2 m); +mat3 transpose(mat3 m); +mat4 transpose(mat4 m); + +mat2x3 transpose(mat3x2 m); +mat3x2 transpose(mat2x3 m); + +mat2x4 transpose(mat4x2 m); +mat4x2 transpose(mat2x4 m); + +mat3x4 transpose(mat4x3 m); +mat4x3 transpose(mat3x4 m); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture1D (sampler1D sampler, float coord); +vec4 texture1DProj (sampler1D sampler, vec2 coord); +vec4 texture1DProj (sampler1D sampler, vec4 coord); +vec4 texture1DLod (sampler1D sampler, float coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); +vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); + +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 texture3D (sampler3D sampler, vec3 coord); +vec4 texture3DProj (sampler3D sampler, vec4 coord); +vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); +vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); + +vec4 shadow1D (sampler1DShadow sampler, vec3 coord); +vec4 shadow2D (sampler2DShadow sampler, vec3 coord); +vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); +vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); +vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); +vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); +vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); +vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); + +/* + * 8.8 - Fragment Processing Functions (none in vertex shader) + */ + +/* + * 8.9 - Noise Functions + */ +float noise1(float x); +float noise1(vec2 x); +float noise1(vec3 x); +float noise1(vec4 x); + +vec2 noise2(float x); +vec2 noise2(vec2 x); +vec2 noise2(vec3 x); +vec2 noise2(vec4 x); + +vec3 noise3(float x); +vec3 noise3(vec2 x); +vec3 noise3(vec3 x); +vec3 noise3(vec4 x); + +vec4 noise4(float x); +vec4 noise4(vec2 x); +vec4 noise4(vec3 x); +vec4 noise4(vec4 x); --- mesa-7.9~git20100924.orig/src/glsl/builtins/profiles/100.vert +++ mesa-7.9~git20100924/src/glsl/builtins/profiles/100.vert @@ -0,0 +1,300 @@ +#version 100 +/* + * 8.1 - Angle and Trigonometry Functions + */ +float radians(float degrees); +vec2 radians(vec2 degrees); +vec3 radians(vec3 degrees); +vec4 radians(vec4 degrees); + +float degrees(float radians); +vec2 degrees(vec2 radians); +vec3 degrees(vec3 radians); +vec4 degrees(vec4 radians); + +float sin(float angle); +vec2 sin(vec2 angle); +vec3 sin(vec3 angle); +vec4 sin(vec4 angle); + +float cos(float angle); +vec2 cos(vec2 angle); +vec3 cos(vec3 angle); +vec4 cos(vec4 angle); + +float tan(float angle); +vec2 tan(vec2 angle); +vec3 tan(vec3 angle); +vec4 tan(vec4 angle); + +float asin(float angle); +vec2 asin(vec2 angle); +vec3 asin(vec3 angle); +vec4 asin(vec4 angle); + +float acos(float angle); +vec2 acos(vec2 angle); +vec3 acos(vec3 angle); +vec4 acos(vec4 angle); + +float atan(float y, float x); +vec2 atan(vec2 y, vec2 x); +vec3 atan(vec3 y, vec3 x); +vec4 atan(vec4 y, vec4 x); + +float atan(float y_over_x); +vec2 atan(vec2 y_over_x); +vec3 atan(vec3 y_over_x); +vec4 atan(vec4 y_over_x); + +/* + * 8.2 - Exponential Functions + */ +float pow(float x, float y); +vec2 pow(vec2 x, vec2 y); +vec3 pow(vec3 x, vec3 y); +vec4 pow(vec4 x, vec4 y); + +float exp(float x); +vec2 exp(vec2 x); +vec3 exp(vec3 x); +vec4 exp(vec4 x); + +float log(float x); +vec2 log(vec2 x); +vec3 log(vec3 x); +vec4 log(vec4 x); + +float exp2(float x); +vec2 exp2(vec2 x); +vec3 exp2(vec3 x); +vec4 exp2(vec4 x); + +float log2(float x); +vec2 log2(vec2 x); +vec3 log2(vec3 x); +vec4 log2(vec4 x); + +float sqrt(float x); +vec2 sqrt(vec2 x); +vec3 sqrt(vec3 x); +vec4 sqrt(vec4 x); + +float inversesqrt(float x); +vec2 inversesqrt(vec2 x); +vec3 inversesqrt(vec3 x); +vec4 inversesqrt(vec4 x); + +/* + * 8.3 - Common Functions + */ +float abs(float x); +vec2 abs(vec2 x); +vec3 abs(vec3 x); +vec4 abs(vec4 x); + +float sign(float x); +vec2 sign(vec2 x); +vec3 sign(vec3 x); +vec4 sign(vec4 x); + +float floor(float x); +vec2 floor(vec2 x); +vec3 floor(vec3 x); +vec4 floor(vec4 x); + +float ceil(float x); +vec2 ceil(vec2 x); +vec3 ceil(vec3 x); +vec4 ceil(vec4 x); + +float fract(float x); +vec2 fract(vec2 x); +vec3 fract(vec3 x); +vec4 fract(vec4 x); + +float mod(float x, float y); +vec2 mod(vec2 x, float y); +vec3 mod(vec3 x, float y); +vec4 mod(vec4 x, float y); + +vec2 mod(vec2 x, vec2 y); +vec3 mod(vec3 x, vec3 y); +vec4 mod(vec4 x, vec4 y); + +float min(float x, float y); +vec2 min(vec2 x, vec2 y); +vec3 min(vec3 x, vec3 y); +vec4 min(vec4 x, vec4 y); + +vec2 min(vec2 x, float y); +vec3 min(vec3 x, float y); +vec4 min(vec4 x, float y); + +float max(float x, float y); +vec2 max(vec2 x, vec2 y); +vec3 max(vec3 x, vec3 y); +vec4 max(vec4 x, vec4 y); + +vec2 max(vec2 x, float y); +vec3 max(vec3 x, float y); +vec4 max(vec4 x, float y); + +float clamp(float x, float minVal, float maxVal); +vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); +vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); +vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); + +vec2 clamp(vec2 x, float minVal, float maxVal); +vec3 clamp(vec3 x, float minVal, float maxVal); +vec4 clamp(vec4 x, float minVal, float maxVal); + +float mix(float x, float y, float a); +vec2 mix(vec2 x, vec2 y, vec2 a); +vec3 mix(vec3 x, vec3 y, vec3 a); +vec4 mix(vec4 x, vec4 y, vec4 a); + +vec2 mix(vec2 x, vec2 y, float a); +vec3 mix(vec3 x, vec3 y, float a); +vec4 mix(vec4 x, vec4 y, float a); + +float step(float edge, float x); +vec2 step(vec2 edge, vec2 x); +vec3 step(vec3 edge, vec3 x); +vec4 step(vec4 edge, vec4 x); + +vec2 step(float edge, vec2 x); +vec3 step(float edge, vec3 x); +vec4 step(float edge, vec4 x); + +float smoothstep(float edge0, float edge1, float x); +vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); +vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); +vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); + +vec2 smoothstep(float edge0, float edge1, vec2 x); +vec3 smoothstep(float edge0, float edge1, vec3 x); +vec4 smoothstep(float edge0, float edge1, vec4 x); + +/* + * 8.4 - Geometric Functions + */ +float length(float x); +float length(vec2 x); +float length(vec3 x); +float length(vec4 x); + +float distance(float p0, float p1); +float distance(vec2 p0, vec2 p1); +float distance(vec3 p0, vec3 p1); +float distance(vec4 p0, vec4 p1); + +float dot(float x, float y); +float dot(vec2 x, vec2 y); +float dot(vec3 x, vec3 y); +float dot(vec4 x, vec4 y); + +vec3 cross(vec3 x, vec3 y); + +float normalize(float x); +vec2 normalize(vec2 x); +vec3 normalize(vec3 x); +vec4 normalize(vec4 x); + +float faceforward(float N, float I, float Nref); +vec2 faceforward(vec2 N, vec2 I, vec2 Nref); +vec3 faceforward(vec3 N, vec3 I, vec3 Nref); +vec4 faceforward(vec4 N, vec4 I, vec4 Nref); + +float reflect(float I, float N); +vec2 reflect(vec2 I, vec2 N); +vec3 reflect(vec3 I, vec3 N); +vec4 reflect(vec4 I, vec4 N); + +float refract(float I, float N, float eta); +vec2 refract(vec2 I, vec2 N, float eta); +vec3 refract(vec3 I, vec3 N, float eta); +vec4 refract(vec4 I, vec4 N, float eta); + +/* + * 8.5 - Matrix Functions + */ +mat2 matrixCompMult(mat2 x, mat2 y); +mat3 matrixCompMult(mat3 x, mat3 y); +mat4 matrixCompMult(mat4 x, mat4 y); + +/* + * 8.6 - Vector Relational Functions + */ +bvec2 lessThan( vec2 x, vec2 y); +bvec3 lessThan( vec3 x, vec3 y); +bvec4 lessThan( vec4 x, vec4 y); +bvec2 lessThan(ivec2 x, ivec2 y); +bvec3 lessThan(ivec3 x, ivec3 y); +bvec4 lessThan(ivec4 x, ivec4 y); + +bvec2 lessThanEqual( vec2 x, vec2 y); +bvec3 lessThanEqual( vec3 x, vec3 y); +bvec4 lessThanEqual( vec4 x, vec4 y); +bvec2 lessThanEqual(ivec2 x, ivec2 y); +bvec3 lessThanEqual(ivec3 x, ivec3 y); +bvec4 lessThanEqual(ivec4 x, ivec4 y); + +bvec2 greaterThan( vec2 x, vec2 y); +bvec3 greaterThan( vec3 x, vec3 y); +bvec4 greaterThan( vec4 x, vec4 y); +bvec2 greaterThan(ivec2 x, ivec2 y); +bvec3 greaterThan(ivec3 x, ivec3 y); +bvec4 greaterThan(ivec4 x, ivec4 y); + +bvec2 greaterThanEqual( vec2 x, vec2 y); +bvec3 greaterThanEqual( vec3 x, vec3 y); +bvec4 greaterThanEqual( vec4 x, vec4 y); +bvec2 greaterThanEqual(ivec2 x, ivec2 y); +bvec3 greaterThanEqual(ivec3 x, ivec3 y); +bvec4 greaterThanEqual(ivec4 x, ivec4 y); + +bvec2 equal( vec2 x, vec2 y); +bvec3 equal( vec3 x, vec3 y); +bvec4 equal( vec4 x, vec4 y); +bvec2 equal(ivec2 x, ivec2 y); +bvec3 equal(ivec3 x, ivec3 y); +bvec4 equal(ivec4 x, ivec4 y); +bvec2 equal(bvec2 x, bvec2 y); +bvec3 equal(bvec3 x, bvec3 y); +bvec4 equal(bvec4 x, bvec4 y); + +bvec2 notEqual( vec2 x, vec2 y); +bvec3 notEqual( vec3 x, vec3 y); +bvec4 notEqual( vec4 x, vec4 y); +bvec2 notEqual(ivec2 x, ivec2 y); +bvec3 notEqual(ivec3 x, ivec3 y); +bvec4 notEqual(ivec4 x, ivec4 y); +bvec2 notEqual(bvec2 x, bvec2 y); +bvec3 notEqual(bvec3 x, bvec3 y); +bvec4 notEqual(bvec4 x, bvec4 y); + +bool any(bvec2 x); +bool any(bvec3 x); +bool any(bvec4 x); + +bool all(bvec2 x); +bool all(bvec3 x); +bool all(bvec4 x); + +bvec2 not(bvec2 x); +bvec3 not(bvec3 x); +bvec4 not(bvec4 x); + +/* + * 8.7 - Texture Lookup Functions + */ +vec4 texture2D (sampler2D sampler, vec2 coord); +vec4 texture2DProj (sampler2D sampler, vec3 coord); +vec4 texture2DProj (sampler2D sampler, vec4 coord); +vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); +vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); + +vec4 textureCube (samplerCube sampler, vec3 coord); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); --- mesa-7.9~git20100924.orig/src/glsl/glcpp/Makefile.am +++ mesa-7.9~git20100924/src/glsl/glcpp/Makefile.am @@ -0,0 +1,44 @@ +# Copyright © 2010 Intel Corporation +# All Rights Reserved. +# +# 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 +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL +# AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS 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. + +noinst_LTLIBRARIES = libglcpp.la +libglcpp_la_SOURCES = \ + glcpp-lex.l \ + glcpp-parse.y \ + glcpp.h \ + pp.c + +BUILT_SOURCES = glcpp-parse.h glcpp-parse.c glcpp-lex.c +CLEANFILES = $(BUILT_SOURCES) + +glcpp-parse.h: glcpp-parse.c + +bin_PROGRAMS = glcpp +glcpp_LDADD = libglcpp.la +glcpp_LDFLAGS = @LDFLAGS@ $(talloc_LIBS) +glcpp_SOURCES = glcpp.c + +.l.c: + $(LEXCOMPILE) --outfile="$@" $< + +test: glcpp + @(cd tests; ./glcpp-test) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/003-define-chain-reverse.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/003-define-chain-reverse.c @@ -0,0 +1,3 @@ +#define bar foo +#define foo 1 +bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/064-version.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/064-version.c @@ -0,0 +1,2 @@ +#version 130 +#define FOO --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c @@ -0,0 +1,3 @@ +#define double(a) a*2 +#define foo double( +foo 5) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/052-if-bitwise.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/052-if-bitwise.c @@ -0,0 +1,20 @@ +#if (0xaaaaaaaa | 0x55555555) != 4294967295 +failure_1 +#else +success_1 +#endif +#if (0x12345678 ^ 0xfdecba98) == 4023971040 +success_2 +#else +failure_2 +#endif +#if (~ 0xdeadbeef) != -3735928560 +failure_3 +#else +success_3 +#endif +#if (0667 & 0733) == 403 +success_4 +#else +failure_4 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/009-undef.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/009-undef.c.expected @@ -0,0 +1,5 @@ + +1 + +foo + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c @@ -0,0 +1,3 @@ +#define foo foo +#define bar foo +bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/071-punctuator.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/071-punctuator.c @@ -0,0 +1 @@ +a = b --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected @@ -0,0 +1,5 @@ + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/046-if-1-elsif.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/046-if-1-elsif.c @@ -0,0 +1,11 @@ +success_1 +#if 1 +success_2 +#elif 0 +failure_1 +#elif 1 +failure_2 +#elif 0 +failure_3 +#endif +success_3 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/043-if-0-else.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/043-if-0-else.c @@ -0,0 +1,7 @@ +success_1 +#if 0 +failure +#else +success_2 +#endif +success_3 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected @@ -0,0 +1,4 @@ + + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/084-unbalanced-parentheses.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/084-unbalanced-parentheses.c @@ -0,0 +1,2 @@ +#define FUNC(x) (2*(x)) +FUNC(23 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected @@ -0,0 +1,3 @@ + +1+foo + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/050-if-defined.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/050-if-defined.c @@ -0,0 +1,17 @@ +#if defined foo +failure_1 +#else +success_1 +#endif +#define foo +#if defined foo +success_2 +#else +failure_2 +#endif +#undef foo +#if defined foo +failure_3 +#else +success_3 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/085-incorrect-argument-count.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/085-incorrect-argument-count.c @@ -0,0 +1,5 @@ +#define MULT(x,y) ((x)*(y)) +MULT() +MULT(1) +MULT(1,2,3) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/008-define-empty.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/008-define-empty.c.expected @@ -0,0 +1,3 @@ + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/048-if-nested.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/048-if-nested.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#if 1 +failure_2 +#else +failure_3 +#endif +failure_4 +#endif +success_2 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected @@ -0,0 +1,6 @@ + +ab +a +b + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/045-if-0-elif.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/045-if-0-elif.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#elif 0 +failure_2 +#elif 1 +success_3 +#elif 1 +failure_3 +#endif +success_4 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/023-define-extra-whitespace.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/023-define-extra-whitespace.c @@ -0,0 +1,8 @@ +#define noargs() 1 +# define onearg(foo) foo + # define twoargs( x , y ) x y + # define threeargs( a , b , c ) a b c +noargs ( ) +onearg ( 2 ) +twoargs ( 3 , 4 ) +threeargs ( 5 , 6 , 7 ) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/057-empty-arguments.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/057-empty-arguments.c.expected @@ -0,0 +1,7 @@ + +success + +success + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/066-if-nospace-expression.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/066-if-nospace-expression.c @@ -0,0 +1,3 @@ +#if(1) +success +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/000-content-with-spaces.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/000-content-with-spaces.c @@ -0,0 +1 @@ +this is four tokens --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/091-hash-line.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/091-hash-line.c @@ -0,0 +1,8 @@ +#line 0 +#error line 0 error +#line 25 +#error line 25 error +#line 0 1 +#error source 1, line 0 error +#line 30 2 +#error source 2, line 30 error --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected @@ -0,0 +1,4 @@ + +success + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/048-if-nested.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/048-if-nested.c.expected @@ -0,0 +1,12 @@ +success_1 + + + + + + + + + +success_2 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/082-invalid-paste.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/082-invalid-paste.c @@ -0,0 +1,2 @@ +#define PASTE(x,y) x ## y +PASTE(<,>) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/087-if-comments.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/087-if-comments.c @@ -0,0 +1,5 @@ +#if (1 == 0) // dangerous comment +fail +#else +win +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/046-if-1-elsif.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/046-if-1-elsif.c.expected @@ -0,0 +1,12 @@ +success_1 + +success_2 + + + + + + + +success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c @@ -0,0 +1,2 @@ +#define foo(x,y) 1 +foo(bar,baz) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/010-undef-re-define.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/010-undef-re-define.c @@ -0,0 +1,6 @@ +#define foo 1 +foo +#undef foo +foo +#define foo 2 +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c @@ -0,0 +1,2 @@ +#define foo(x,y) x,two fish,red fish,y +foo(one fish, blue fish) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/043-if-0-else.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/043-if-0-else.c.expected @@ -0,0 +1,8 @@ +success_1 + + + +success_2 + +success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected @@ -0,0 +1,4 @@ + + +a 1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/050-if-defined.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/050-if-defined.c.expected @@ -0,0 +1,18 @@ + + + +success_1 + + + +success_2 + + + + + + + +success_3 + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/009-undef.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/009-undef.c @@ -0,0 +1,4 @@ +#define foo 1 +foo +#undef foo +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c @@ -0,0 +1,4 @@ +#define baz(failure) failure +#define bar(failure) failure +#define foo bar(baz(success)) +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/021-define-func-compose.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/021-define-func-compose.c @@ -0,0 +1,3 @@ +#define bar(x) (1+(x)) +#define foo(y) (2*(y)) +foo(bar(3)) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/001-define.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/001-define.c.expected @@ -0,0 +1,3 @@ + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/083-unterminated-if.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/083-unterminated-if.c.expected @@ -0,0 +1,5 @@ +0:1(7): preprocessor error: Unterminated #if + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/051-if-relational.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/051-if-relational.c.expected @@ -0,0 +1,36 @@ + + + +success_1 + + + +success_2 + + + + + +success_3 + + + + + +success_3 + + + + + + + +success_4 + + + +success_5 + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c @@ -0,0 +1,40 @@ +#define D1 +#define D2 + +#define result success + +#ifdef U1 +#ifdef U2 +#undef result +#define result failure +#endif +#endif +result + +#ifndef D1 +#ifndef D2 +#undef result +#define result failure +#endif +#endif +result + +#undef result +#define result failure +#ifdef D1 +#ifdef D2 +#undef result +#define result success +#endif +#endif +result + +#undef result +#define result failure +#ifndef U1 +#ifndef U2 +#undef result +#define result success +#endif +#endif +result --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/079-endif-without-if.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/079-endif-without-if.c @@ -0,0 +1 @@ +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/074-elif-undef.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/074-elif-undef.c.expected @@ -0,0 +1,4 @@ + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected @@ -0,0 +1,12 @@ +0:2(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2) + +0:3(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2) + +0:4(1): preprocessor error: Error: macro MULT invoked with 3 arguments (expected 2) + + +MULT() +MULT(1) +MULT(1,2,3) + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c @@ -0,0 +1,3 @@ +#define foo(a) (a) +#define bar two,words +foo(bar) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/059-token-pasting-integer.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/059-token-pasting-integer.c @@ -0,0 +1,4 @@ +#define paste(x,y) x ## y +paste(1,2) +paste(1,000) +paste(identifier,2) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/016-define-func-1-arg.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/016-define-func-1-arg.c @@ -0,0 +1,2 @@ +#define foo(x) ((x)+1) +foo(bar) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/056-macro-argument-with-comma.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/056-macro-argument-with-comma.c @@ -0,0 +1,4 @@ +#define bar with,embedded,commas +#define function(x) success +#define foo function +foo(bar) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c @@ -0,0 +1,3 @@ +#define failure() success +#define foo failure() +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected @@ -0,0 +1,4 @@ + + +more success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c @@ -0,0 +1,4 @@ +#define baz(failure) failure +#define bar(failure) failure +#define foo() bar(baz(success)) +foo() --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/099-c99-example.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/099-c99-example.c.expected @@ -0,0 +1,17 @@ + + + + + + + + + + + + + +f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); +f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); +int i[] = { 1, 23, 4, 5, }; + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/042-if-1.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/042-if-1.c @@ -0,0 +1,5 @@ +success_1 +#if 1 +success_2 +#endif +success_3 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected @@ -0,0 +1,3 @@ + +foo bar + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/017-define-func-2-args.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/017-define-func-2-args.c.expected @@ -0,0 +1,3 @@ + +((bar)*(baz)) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/057-empty-arguments.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/057-empty-arguments.c @@ -0,0 +1,6 @@ +#define zero() success +zero() +#define one(x) success +one() +#define two(x,y) success +two(,) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/040-token-pasting.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/040-token-pasting.c.expected @@ -0,0 +1,3 @@ + +onetoken + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/091-hash-line.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/091-hash-line.c.expected @@ -0,0 +1,13 @@ +0:0(1): preprocessor error: #error line 0 error +0:25(1): preprocessor error: #error line 25 error +1:0(1): preprocessor error: #error source 1, line 0 error +2:30(1): preprocessor error: #error source 2, line 30 error + + + + + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c @@ -0,0 +1,3 @@ +#define expand(x) expand(x once) +#define foo(x) x +foo(expand(just)) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected @@ -0,0 +1,5 @@ + + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected @@ -0,0 +1,4 @@ + + +expand(just once) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected @@ -0,0 +1,5 @@ + + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/044-if-1-else.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/044-if-1-else.c.expected @@ -0,0 +1,8 @@ +success_1 + +success_2 + + + +success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected @@ -0,0 +1,9 @@ + + + + +1 +2 +3 4 +5 6 7 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/021-define-func-compose.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/021-define-func-compose.c.expected @@ -0,0 +1,4 @@ + + +(2*((1+(3)))) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo(1+foo) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/080-if-without-expression.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/080-if-without-expression.c.expected @@ -0,0 +1,6 @@ +0:2(1): preprocessor error: #if with no expression + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected @@ -0,0 +1,4 @@ + + +(two,words) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/042-if-1.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/042-if-1.c.expected @@ -0,0 +1,6 @@ +success_1 + +success_2 + +success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected @@ -0,0 +1,3 @@ + +(argument(including parens)for the win) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected @@ -0,0 +1,4 @@ + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c @@ -0,0 +1,5 @@ +#define abc 123 +#define abc 123 + +#define foo(x) (x)+23 +#define foo(x) ( x ) + 23 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected @@ -0,0 +1,5 @@ + +12 +1000 +identifier2 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c @@ -0,0 +1,3 @@ +#define bar a foo +#define foo 1 +bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c @@ -0,0 +1,2 @@ +#if UNDEFINED_MACRO +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/054-if-with-macros.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/054-if-with-macros.c.expected @@ -0,0 +1,35 @@ + + + + + + + +success_1 + + +success_2 + + + + +success_3 + + + + +success_4 + + + + + + +success_5 + + +success_6 + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/064-version.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/064-version.c.expected @@ -0,0 +1,3 @@ +#version 130 + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected @@ -0,0 +1,5 @@ + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/082-invalid-paste.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/082-invalid-paste.c.expected @@ -0,0 +1,5 @@ +0:2(7): preprocessor error: +Pasting "<" and ">" does not give a valid preprocessing token. + +< + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected @@ -0,0 +1,3 @@ + +success_1 success_2 success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/012-define-func-no-args.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/012-define-func-no-args.c @@ -0,0 +1,2 @@ +#define foo() bar +foo() --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/076-elif-undef-nested.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/076-elif-undef-nested.c @@ -0,0 +1,5 @@ +#ifdef UNDEF +#if UNDEF == 4 +#elif UNDEF == 5 +#endif +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/078-elif-without-if.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/078-elif-without-if.c.expected @@ -0,0 +1,4 @@ +0:1(2): preprocessor error: elif without #if + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected @@ -0,0 +1,3 @@ + +foo + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/041-if-0.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/041-if-0.c @@ -0,0 +1,5 @@ +success_1 +#if 0 +failure +#endif +success_2 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/002-define-chain.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/002-define-chain.c.expected @@ -0,0 +1,4 @@ + + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/051-if-relational.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/051-if-relational.c @@ -0,0 +1,35 @@ +#if 3 < 2 +failure_1 +#else +success_1 +#endif + +#if 3 >= 2 +success_2 +#else +failure_2 +#endif + +#if 2 + 3 <= 5 +success_3 +#else +failure_3 +#endif + +#if 3 - 2 == 1 +success_3 +#else +failure_3 +#endif + +#if 1 > 3 +failure_4 +#else +success_4 +#endif + +#if 1 != 5 +success_5 +#else +failure_5 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/071-punctuator.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/071-punctuator.c.expected @@ -0,0 +1,2 @@ +a = b + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/012-define-func-no-args.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/012-define-func-no-args.c.expected @@ -0,0 +1,3 @@ + +bar + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/047-if-elif-else.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/047-if-elif-else.c.expected @@ -0,0 +1,12 @@ +success_1 + + + + + + + +success_2 + +success_3 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/065-if-defined-parens.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/065-if-defined-parens.c.expected @@ -0,0 +1,18 @@ + + + +success_1 + + + +success_2 + + + + + + + +success_3 + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected @@ -0,0 +1,4 @@ + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected @@ -0,0 +1,7 @@ + + + +a b c foo +b c a bar +c a b baz + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected @@ -0,0 +1,3 @@ + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c @@ -0,0 +1,5 @@ +#define paste(x,y) x ## y +paste(a,b) +paste(a,) +paste(,b) +paste(,) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/011-define-func-empty.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/011-define-func-empty.c.expected @@ -0,0 +1,3 @@ + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/063-comments.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/063-comments.c.expected @@ -0,0 +1,14 @@ + + + +f = g /h; + l(); +m = n ++ p; + +more code here + +are not treated like comments. + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c @@ -0,0 +1,3 @@ +#define success() failure +#define foo success +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/004-define-recursive.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/004-define-recursive.c.expected @@ -0,0 +1,7 @@ + + + +foo +bar +baz + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/075-elif-elif-undef.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/075-elif-elif-undef.c @@ -0,0 +1,4 @@ +#ifndef UNDEF +#elif UNDEF < 0 +#elif UNDEF == 3 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/032-define-func-self-recurse.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/032-define-func-self-recurse.c @@ -0,0 +1,2 @@ +#define foo(a) foo(2*(a)) +foo(3) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/001-define.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/001-define.c @@ -0,0 +1,2 @@ +#define foo 1 +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c @@ -0,0 +1,2 @@ +#define foo(x) 1 +foo(bar) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected @@ -0,0 +1,30 @@ +0:2(9): preprocessor error: Redefinition of macro x + +0:5(9): preprocessor error: Redefinition of macro abc + +0:8(9): preprocessor error: Redefinition of macro foo + +0:11(9): preprocessor error: Redefinition of macro bar + +0:14(9): preprocessor error: Redefinition of macro biff + +0:17(9): preprocessor error: Redefinition of macro oper + + + + + + + + + + + + + + + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected @@ -0,0 +1,3 @@ + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/017-define-func-2-args.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/017-define-func-2-args.c @@ -0,0 +1,2 @@ +#define foo(x,y) ((x)*(y)) +foo(bar,baz) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/083-unterminated-if.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/083-unterminated-if.c @@ -0,0 +1,2 @@ +#if 1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/087-if-comments.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/087-if-comments.c.expected @@ -0,0 +1,6 @@ + + + +win + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected @@ -0,0 +1,4 @@ + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/063-comments.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/063-comments.c @@ -0,0 +1,20 @@ +/* this is a comment */ +// so is this +// */ +f = g/**//h; +/*//*/l(); +m = n//**/o ++ p; +/* this +comment spans +multiple lines and +contains *** stars +and slashes / *** / +and other stuff. +****/ +more code here +/* Test that /* nested + comments */ +are not treated like comments. +/*/ this is a comment */ +/*/*/ --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/047-if-elif-else.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/047-if-elif-else.c @@ -0,0 +1,11 @@ +success_1 +#if 0 +failure_1 +#elif 0 +failure_2 +#elif 0 +failure_3 +#else +success_2 +#endif +success_3 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/000-content-with-spaces.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/000-content-with-spaces.c.expected @@ -0,0 +1,2 @@ +this is four tokens + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/004-define-recursive.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/004-define-recursive.c @@ -0,0 +1,6 @@ +#define foo bar +#define bar baz +#define baz foo +foo +bar +baz --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/049-if-expression-precedence.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/049-if-expression-precedence.c @@ -0,0 +1,5 @@ +#if 1 + 2 * 3 + - (25 % 17 - + 1) +failure with operator precedence +#else +success +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/089-redefine-macro-error.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/089-redefine-macro-error.c @@ -0,0 +1,17 @@ +#define x y +#define x z + +#define abc 123 +#define abc() 123 + +#define foo() bar +#define foo(x) bar + +#define bar() baz +#define bar baz + +#define biff(a,b) a+b +#define biff(a,b,c) a+b + +#define oper(a,b) a+b +#define oper(a,b) a*b --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/040-token-pasting.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/040-token-pasting.c @@ -0,0 +1,2 @@ +#define paste(a,b) a ## b +paste(one , token) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/069-repeated-argument.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/069-repeated-argument.c @@ -0,0 +1,2 @@ +#define double(x) x x +double(1) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/086-reserved-macro-names.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/086-reserved-macro-names.c @@ -0,0 +1,2 @@ +#define __BAD reserved +#define GL_ALSO_BAD() also reserved --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected @@ -0,0 +1,6 @@ + + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected @@ -0,0 +1,6 @@ + + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/054-if-with-macros.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/054-if-with-macros.c @@ -0,0 +1,34 @@ +#define one 1 +#define two 2 +#define three 3 +#define five 5 +#if five < two +failure_1 +#else +success_1 +#endif +#if three >= two +success_2 +#else +failure_2 +#endif +#if two + three <= five +success_3 +#else +failure_3 +#endif +#if five - two == three +success_4 +#else +failure_4 +#endif +#if one > three +failure_5 +#else +success_5 +#endif +#if one != five +success_6 +#else +failure_6 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/081-elif-without-expression.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/081-elif-without-expression.c.expected @@ -0,0 +1,5 @@ +0:2(1): preprocessor error: #elif with no expression + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c @@ -0,0 +1,3 @@ +#define x 0 +#define foo(x) x +foo(1) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c @@ -0,0 +1,2 @@ +#define foo(x) (x) +foo(argument(including parens)for the win) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected @@ -0,0 +1,4 @@ + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/077-else-without-if.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/077-else-without-if.c @@ -0,0 +1 @@ +#else --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/005-define-composite-chain.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/005-define-composite-chain.c @@ -0,0 +1,3 @@ +#define foo 1 +#define bar a foo +bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/005-define-composite-chain.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/005-define-composite-chain.c.expected @@ -0,0 +1,4 @@ + + +a 1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/072-token-pasting-same-line.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/072-token-pasting-same-line.c @@ -0,0 +1,2 @@ +#define paste(x) success_ ## x +paste(1) paste(2) paste(3) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected @@ -0,0 +1,6 @@ + + + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/053-if-divide-and-shift.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/053-if-divide-and-shift.c @@ -0,0 +1,15 @@ +#if (15 / 2) != 7 +failure_1 +#else +success_1 +#endif +#if (1 << 12) == 4096 +success_2 +#else +failure_2 +#endif +#if (31762 >> 8) != 124 +failure_3 +#else +success_3 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected @@ -0,0 +1,3 @@ + +(this is more than one word) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/073-if-in-ifdef.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/073-if-in-ifdef.c @@ -0,0 +1,4 @@ +#ifdef UNDEF +#if UNDEF > 1 +#endif +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/099-c99-example.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/099-c99-example.c @@ -0,0 +1,17 @@ +#define x 3 +#define f(a) f(x * (a)) +#undef x +#define x 2 +#define g f +#define z z[0] +#define h g(~ +#define m(a) a(w) +#define w 0,1 +#define t(a) a +#define p() int +#define q(x) x +#define r(x,y) x ## y +f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); +g(x +(3,4)-w) | h 5) & m + (f)^m(m); +p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,)}; --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/090-hash-error.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/090-hash-error.c.expected @@ -0,0 +1,3 @@ +0:1(2): preprocessor error: #error human error + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/045-if-0-elif.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/045-if-0-elif.c.expected @@ -0,0 +1,12 @@ +success_1 + + + + + +success_3 + + + +success_4 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/026-define-func-extra-newlines.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/026-define-func-extra-newlines.c @@ -0,0 +1,6 @@ +#define foo(a) bar + +foo +( +1 +) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c @@ -0,0 +1,2 @@ +#define foo(bar) bar +foo(foo) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected @@ -0,0 +1,5 @@ + + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/015-define-object-with-parens.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/015-define-object-with-parens.c @@ -0,0 +1,4 @@ +#define foo ()1 +foo() +#define bar ()2 +bar() --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/090-hash-error.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/090-hash-error.c @@ -0,0 +1 @@ +#error human error --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/078-elif-without-if.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/078-elif-without-if.c @@ -0,0 +1 @@ +#elif defined FOO --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/008-define-empty.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/008-define-empty.c @@ -0,0 +1,2 @@ +#define foo +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected @@ -0,0 +1,3 @@ + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/070-undefined-macro-in-expression.c.expected @@ -0,0 +1,2 @@ +0:1(21): preprocessor error: syntax error, unexpected IDENTIFIER + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c @@ -0,0 +1,3 @@ +#define failure() success +#define foo failure +foo() --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected @@ -0,0 +1,7 @@ +0:1(10): preprocessor error: Macro names starting with "__" are reserved. + +0:2(9): preprocessor error: Macro names starting with "GL_" are reserved. + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/041-if-0.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/041-if-0.c.expected @@ -0,0 +1,6 @@ +success_1 + + + +success_2 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected @@ -0,0 +1,4 @@ + + +1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/038-func-arg-with-commas.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/038-func-arg-with-commas.c @@ -0,0 +1,2 @@ +#define foo(x) success +foo(argument (with,embedded , commas) -- tricky) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/068-accidental-pasting.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/068-accidental-pasting.c.expected @@ -0,0 +1,12 @@ + +< < +< = +> > +> = += = +! = +& & +| | ++ + +- - + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/033-define-func-self-compose.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/033-define-func-self-compose.c @@ -0,0 +1,2 @@ +#define foo(a) foo(2*(a)) +foo(foo(3)) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected @@ -0,0 +1,41 @@ + + + + + + + + + + + +success + + + + + + + +success + + + + + + + + + +success + + + + + + + + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c @@ -0,0 +1,2 @@ +#define foo(x) (x) +foo(this is more than one word) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/079-endif-without-if.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/079-endif-without-if.c.expected @@ -0,0 +1,4 @@ +0:1(2): preprocessor error: #endif without #if + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected @@ -0,0 +1,4 @@ + + +foo + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/074-elif-undef.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/074-elif-undef.c @@ -0,0 +1,3 @@ +#ifndef UNDEF +#elif UNDEF < 0 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected @@ -0,0 +1,3 @@ + +foo(2*(foo(2*(3)))) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/068-accidental-pasting.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/068-accidental-pasting.c @@ -0,0 +1,11 @@ +#define empty +empty> +>empty= +=empty= +!empty= +&empty& +|empty| ++empty+ +-empty- --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/002-define-chain.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/002-define-chain.c @@ -0,0 +1,3 @@ +#define foo 1 +#define bar foo +bar --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c @@ -0,0 +1,3 @@ +#define bar success +#define foo(x) x +foo(more bar) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected @@ -0,0 +1,6 @@ + + + + +success + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected @@ -0,0 +1,3 @@ + +((bar)+1) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected @@ -0,0 +1,3 @@ + +one fish,two fish,red fish,blue fish + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/080-if-without-expression.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/080-if-without-expression.c @@ -0,0 +1,4 @@ +/* Error message for unskipped #if with no expression. */ +#if +#endif + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/062-if-0-skips-garbage.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/062-if-0-skips-garbage.c @@ -0,0 +1,5 @@ +#define foo(a,b) +#if 0 +foo(bar) +foo( +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c @@ -0,0 +1,5 @@ +#define foo(x) success +#define bar foo +#define baz bar +#define joe baz +joe (failure) --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/011-define-func-empty.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/011-define-func-empty.c @@ -0,0 +1,2 @@ +#define foo() +foo() --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected @@ -0,0 +1,5 @@ + +()1() + +()2() + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/052-if-bitwise.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/052-if-bitwise.c.expected @@ -0,0 +1,21 @@ + + + +success_1 + + +success_2 + + + + + + +success_3 + + +success_4 + + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected @@ -0,0 +1,4 @@ + + +bar + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/081-elif-without-expression.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/081-elif-without-expression.c @@ -0,0 +1,3 @@ +#if 0 +#elif +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/glcpp-test +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/glcpp-test @@ -0,0 +1,50 @@ +#!/bin/sh + +trap 'rm $test.valgrind-errors; exit 1' INT QUIT + +total=0 +pass=0 +clean=0 + +echo "====== Testing for correctness ======" +for test in *.c; do + echo -n "Testing $test..." + ../glcpp < $test > $test.out 2>&1 + total=$((total+1)) + if cmp $test.expected $test.out >/dev/null 2>&1; then + echo "PASS" + pass=$((pass+1)) + else + echo "FAIL" + diff -u $test.expected $test.out + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "" + +echo "====== Testing for valgrind cleanliness ======" +for test in *.c; do + echo -n "Testing $test with valgrind..." + valgrind --error-exitcode=31 --log-file=$test.valgrind-errors ../glcpp < $test >/dev/null 2>&1 + if [ "$?" = "31" ]; then + echo "ERRORS" + cat $test.valgrind-errors + else + echo "CLEAN" + clean=$((clean+1)) + rm $test.valgrind-errors + fi +done + +echo "" +echo "$pass/$total tests returned correct results" +echo "$clean/$total tests are valgrind-clean" + +if [ "$pass" = "$total" ] && [ "$clean" = "$total" ]; then + exit 0 +else + exit 1 +fi + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/069-repeated-argument.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/069-repeated-argument.c.expected @@ -0,0 +1,3 @@ + +1 1 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected @@ -0,0 +1,3 @@ + +foo(2*(3)) + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected @@ -0,0 +1,4 @@ + + +5*2 + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/065-if-defined-parens.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/065-if-defined-parens.c @@ -0,0 +1,17 @@ +#if defined(foo) +failure_1 +#else +success_1 +#endif +#define foo +#if defined ( foo ) +success_2 +#else +failure_2 +#endif +#undef foo +#if defined (foo) +failure_3 +#else +success_3 +#endif --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected @@ -0,0 +1,6 @@ + + + +success + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected @@ -0,0 +1,16 @@ + + + +success_1 + + +success_2 + + + + + + +success_3 + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/077-else-without-if.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/077-else-without-if.c.expected @@ -0,0 +1,4 @@ +0:1(2): preprocessor error: else without #if + + + --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/044-if-1-else.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/044-if-1-else.c @@ -0,0 +1,7 @@ +success_1 +#if 1 +success_2 +#else +failure +#endif +success_3 --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/007-define-composite-recursive.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/007-define-composite-recursive.c @@ -0,0 +1,6 @@ +#define foo a bar +#define bar b baz +#define baz c foo +foo +bar +baz --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c @@ -0,0 +1,3 @@ +#define bar(failure) failure +#define foo bar(success) +foo --- mesa-7.9~git20100924.orig/src/glsl/glcpp/tests/010-undef-re-define.c.expected +++ mesa-7.9~git20100924/src/glsl/glcpp/tests/010-undef-re-define.c.expected @@ -0,0 +1,7 @@ + +1 + +foo + +2 + --- mesa-7.9~git20100924.orig/src/glx/dri_common.c +++ mesa-7.9~git20100924/src/glx/dri_common.c @@ -391,17 +391,19 @@ if (__glxHashLookup(priv->drawHash, gc->currentDrawable, (void *) &pdraw) == 0) { - if (pdraw->drawable == pdraw->xDrawable) + if (pdraw->drawable == pdraw->xDrawable) { (*pdraw->destroyDrawable)(pdraw); - __glxHashDelete(priv->drawHash, gc->currentDrawable); + __glxHashDelete(priv->drawHash, gc->currentDrawable); + } } if (gc->currentDrawable != gc->currentReadable && __glxHashLookup(priv->drawHash, gc->currentReadable, (void *) &pdraw) == 0) { - if (pdraw->drawable == pdraw->xDrawable) + if (pdraw->drawable == pdraw->xDrawable) { (*pdraw->destroyDrawable)(pdraw); - __glxHashDelete(priv->drawHash, gc->currentReadable); + __glxHashDelete(priv->drawHash, gc->currentReadable); + } } } --- mesa-7.9~git20100924.orig/src/glx/apple/apple_visual.h +++ mesa-7.9~git20100924/src/glx/apple/apple_visual.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2008 Apple 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. +*/ + +#ifndef APPLE_VISUAL_H +#define APPLE_VISUAL_H + +#include +#include + +/* mode is expected to be of type struct glx_config. */ +void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode, + bool * double_buffered, bool * uses_stereo, + bool offscreen); + +#endif --- mesa-7.9~git20100924.orig/src/glx/apple/gen_exports.tcl +++ mesa-7.9~git20100924/src/glx/apple/gen_exports.tcl @@ -0,0 +1,131 @@ +if 0 { + Copyright (c) 2008, 2009 Apple 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. +} + +package require Tcl 8.5 + +proc main {argc argv} { + if {2 != $argc} { + puts stderr "syntax is: [info script] serialized-array-file export.list" + return 1 + } + + set fd [open [lindex $argv 0] r] + array set api [read $fd] + close $fd + + #Start with 1.0 + set glxlist [list \ + glXChooseVisual glXCreateContext glXDestroyContext \ + glXMakeCurrent glXCopyContext glXSwapBuffers \ + glXCreateGLXPixmap glXDestroyGLXPixmap \ + glXQueryExtension glXQueryVersion \ + glXIsDirect glXGetConfig \ + glXGetCurrentContext glXGetCurrentDrawable \ + glXWaitGL glXWaitX glXUseXFont] + + #GLX 1.1 and later + lappend glxlist glXQueryExtensionsString glXQueryServerString \ + glXGetClientString + + #GLX 1.2 and later + lappend glxlist glXGetCurrentDisplay + + #GLX 1.3 and later + lappend glxlist glXChooseFBConfig glXGetFBConfigAttrib \ + glXGetFBConfigs glXGetVisualFromFBConfig \ + glXCreateWindow glXDestroyWindow \ + glXCreatePixmap glXDestroyPixmap \ + glXCreatePbuffer glXDestroyPbuffer \ + glXQueryDrawable glXCreateNewContext \ + glXMakeContextCurrent glXGetCurrentReadDrawable \ + glXQueryContext glXSelectEvent glXGetSelectedEvent + + #GLX 1.4 and later + lappend glxlist glXGetProcAddress + + #Extensions + lappend glxlist glXGetProcAddressARB + + #Old extensions we don't support and never really have, but need for + #symbol compatibility. See also: glx_empty.c + lappend glxlist glXSwapIntervalSGI glXSwapIntervalMESA \ + glXGetSwapIntervalMESA glXBeginFrameTrackingMESA \ + glXEndFrameTrackingMESA glXGetFrameUsageMESA \ + glXQueryFrameTrackingMESA glXGetVideoSyncSGI \ + glXWaitVideoSyncSGI glXJoinSwapGroupSGIX \ + glXBindSwapBarrierSGIX glXQueryMaxSwapBarriersSGIX \ + glXGetSyncValuesOML glXSwapBuffersMscOML \ + glXWaitForMscOML glXWaitForSbcOML \ + glXReleaseBuffersMESA \ + glXCreateGLXPixmapMESA glXCopySubBufferMESA \ + glXQueryGLXPbufferSGIX glXCreateGLXPbufferSGIX \ + glXDestroyGLXPbufferSGIX glXSelectEventSGIX \ + glXGetSelectedEventSGIX + + #These are for GLX_SGIX_fbconfig, which isn't implemented, because + #we have the GLX 1.3 GLXFBConfig functions which are in the standard spec. + #It should be possible to support these to some extent. + #The old libGL somewhat supported the GLXFBConfigSGIX code, but lacked + #pbuffer, and pixmap support. + #We mainly just need these stubs for linking with apps, because for + #some reason the OpenGL site suggests using the latest glxext.h, + #and glxext.h defines all GLX extensions, which doesn't seem right for + #compile-time capability detection. + #See also: http://www.mesa3d.org/brianp/sig97/exten.htm#Compile + #which conflicts with: the ABI registry from what I saw on opengl.org. + #By disabling some of the #defines in glxext.h we break some software, + #and by enabling them without the symbols we break others (in Mesa). + #I think a lot of OpenGL-based programs have issues one way or another. + #It seems that even Mesa developers are confused on this issue, because + #Mesa-7.3/progs/xdemos/glxgears_fbconfig.c has comments about breakage + #in some comments. + lappend glxlist glXGetFBConfigAttribSGIX \ + glXChooseFBConfigSGIX \ + glXGetVisualFromFBConfigSGIX \ + glXCreateGLXPixmapWithConfigSGIX \ + glXCreateContextWithConfigSGIX \ + glXGetFBConfigFromVisualSGIX + + + set fd [open [lindex $argv 1] w] + + foreach f [lsort -dictionary [array names api]] { + puts $fd _gl$f + } + + foreach f [lsort -dictionary $glxlist] { + puts $fd _$f + } + + close $fd + + return 0 +} + +exit [main $::argc $::argv] \ No newline at end of file --- mesa-7.9~git20100924.orig/src/glx/apple/glxreply.c +++ mesa-7.9~git20100924/src/glx/apple/glxreply.c @@ -0,0 +1,134 @@ +/* + * (C) Copyright Apple Inc. 2008 + * (C) Copyright IBM Corporation 2004, 2005 + * All Rights Reserved. + * + * 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, sub license, + * 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS 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. + */ + +#include +#include "glxclient.h" +#include + +CARD32 +__glXReadReply(Display * dpy, size_t size, void *dest, + GLboolean reply_is_always_array) +{ + xGLXSingleReply reply; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + if (size != 0) { + if ((reply.length > 0) || reply_is_always_array) { + const GLint bytes = (reply_is_always_array) + ? (4 * reply.length) : (reply.size * size); + const GLint extra = 4 - (bytes & 3); + + _XRead(dpy, dest, bytes); + if (extra < 4) { + _XEatData(dpy, extra); + } + } + else { + (void) memcpy(dest, &(reply.pad3), size); + } + } + + return reply.retval; +} + +void +__glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim, + GLint width, GLint height, GLint depth, GLenum format, + GLenum type, void *dest, GLboolean dimensions_in_reply) +{ + xGLXSingleReply reply; + GLint size; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + if (dimensions_in_reply) { + width = reply.pad3; + height = reply.pad4; + depth = reply.pad5; + + if ((height == 0) || (max_dim < 2)) { + height = 1; + } + if ((depth == 0) || (max_dim < 3)) { + depth = 1; + } + } + + size = reply.length * 4; + if (size != 0) { + void *buf = Xmalloc(size); + + if (buf == NULL) { + _XEatData(dpy, size); + __glXSetError(gc, GL_OUT_OF_MEMORY); + } + else { + const GLint extra = 4 - (size & 3); + + _XRead(dpy, buf, size); + if (extra < 4) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest); + Xfree(buf); + } + } +} + +#if 0 +GLubyte * +__glXSetupSingleRequest(struct glx_context * gc, GLint sop, GLint cmdlen) +{ + xGLXSingleReq *req; + Display *const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXSingle, cmdlen, req); + req->reqType = gc->majorOpcode; + req->contextTag = gc->currentContextTag; + req->glxCode = sop; + return (GLubyte *) (req) + sz_xGLXSingleReq; +} +#endif + +GLubyte * +__glXSetupVendorRequest(struct glx_context * gc, GLint code, GLint vop, + GLint cmdlen) +{ + xGLXVendorPrivateReq *req; + Display *const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, cmdlen, req); + req->reqType = gc->majorOpcode; + req->glxCode = code; + req->vendorCode = vop; + req->contextTag = gc->currentContextTag; + return (GLubyte *) (req) + sz_xGLXVendorPrivateReq; +} --- mesa-7.9~git20100924.orig/src/glx/apple/apple_glx_drawable.h +++ mesa-7.9~git20100924/src/glx/apple/apple_glx_drawable.h @@ -0,0 +1,227 @@ +/* + Copyright (c) 2008, 2009 Apple 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. +*/ +#ifndef APPLE_GLX_DRAWABLE_H +#define APPLE_GLX_DRAWABLE_H + +/* Must be first for: + * + */ +#include "apple_glx_context.h" + +#include +#include +#include +#include +#define XP_NO_X_HEADERS +#include +#undef XP_NO_X_HEADERS + +enum +{ + APPLE_GLX_DRAWABLE_SURFACE = 1, + APPLE_GLX_DRAWABLE_PBUFFER, + APPLE_GLX_DRAWABLE_PIXMAP +}; + +/* The flag for the find routine. */ +enum +{ + APPLE_GLX_DRAWABLE_LOCK = 2, + APPLE_GLX_DRAWABLE_REFERENCE = 4 +}; + +struct apple_glx_context; +struct apple_glx_drawable; + +struct apple_glx_surface +{ + xp_surface_id surface_id; + unsigned int uid; + bool pending_destroy; +}; + +struct apple_glx_pbuffer +{ + GLXPbuffer xid; /* our pixmap */ + int width, height; + GLint fbconfigID; + CGLPBufferObj buffer_obj; + unsigned long event_mask; +}; + +struct apple_glx_pixmap +{ + GLXPixmap xpixmap; + void *buffer; + int width, height, pitch, /*bytes per pixel */ bpp; + size_t size; + char path[PATH_MAX]; + int fd; + CGLPixelFormatObj pixel_format_obj; + CGLContextObj context_obj; + GLint fbconfigID; +}; + +struct apple_glx_drawable_callbacks +{ + int type; + bool(*make_current) (struct apple_glx_context * ac, + struct apple_glx_drawable * d); + void (*destroy) (Display * dpy, struct apple_glx_drawable * d); +}; + +struct apple_glx_drawable +{ + Display *display; + int reference_count; + GLXDrawable drawable; + int type; /* APPLE_GLX_DRAWABLE_* */ + + union + { + struct apple_glx_pixmap pixmap; + struct apple_glx_pbuffer pbuffer; + struct apple_glx_surface surface; + } types; + + struct apple_glx_drawable_callbacks callbacks; + + /* + * This mutex protects the reference count and any other drawable data. + * It's used to prevent an early release of a drawable. + */ + pthread_mutex_t mutex; + void (*lock) (struct apple_glx_drawable * agd); + void (*unlock) (struct apple_glx_drawable * agd); + + void (*reference) (struct apple_glx_drawable * agd); + void (*release) (struct apple_glx_drawable * agd); + + bool(*destroy) (struct apple_glx_drawable * agd); + + bool(*is_pbuffer) (struct apple_glx_drawable * agd); + + bool(*is_pixmap) (struct apple_glx_drawable * agd); + +/*BEGIN These are used for the mixed mode drawing... */ + int width, height; + int row_bytes; + char path[PATH_MAX]; + int fd; /* The file descriptor for this drawable's shared memory. */ + void *buffer; /* The memory for the drawable. Typically shared memory. */ + size_t buffer_length; + /*END*/ struct apple_glx_drawable *previous, *next; +}; + +struct apple_glx_context; + +/* May return NULL if not found */ +struct apple_glx_drawable *apple_glx_find_drawable(Display * dpy, + GLXDrawable drawable); + +/* Returns true on error and locks the agd result with a reference. */ +bool apple_glx_drawable_create(Display * dpy, + int screen, + GLXDrawable drawable, + struct apple_glx_drawable **agd, + struct apple_glx_drawable_callbacks + *callbacks); + +/* Returns true on error */ +bool apple_glx_create_drawable(Display * dpy, + struct apple_glx_context *ac, + GLXDrawable drawable, + struct apple_glx_drawable **agd); + +void apple_glx_garbage_collect_drawables(Display * dpy); + +/* + * This returns the total number of drawables. + * It's mostly intended for debugging and introspection. + */ +unsigned int apple_glx_get_drawable_count(void); + +struct apple_glx_drawable *apple_glx_drawable_find_by_type(GLXDrawable + drawable, int type, + int flags); + +struct apple_glx_drawable *apple_glx_drawable_find(GLXDrawable drawable, + int flags); + + +bool apple_glx_drawable_destroy_by_type(Display * dpy, GLXDrawable drawable, + int type); + +struct apple_glx_drawable *apple_glx_drawable_find_by_uid(unsigned int uid, + int flags); + +/* Surfaces */ + +bool apple_glx_surface_create(Display * dpy, int screen, GLXDrawable drawable, + struct apple_glx_drawable **resultptr); + +void apple_glx_surface_destroy(unsigned int uid); + +/* Pbuffers */ + +/* Returns true if an error occurred. */ +bool apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config, + int width, int height, int *errorcode, + GLXPbuffer * pbuf); + +/* Returns true if the pbuffer was invalid. */ +bool apple_glx_pbuffer_destroy(Display * dpy, GLXPbuffer pbuf); + +/* Returns true if the pbuffer was valid and the attribute. */ +bool apple_glx_pbuffer_query(GLXDrawable d, int attribute, + unsigned int *value); + +/* Returns true if the GLXDrawable is a valid GLXPbuffer, and the mask is set. */ +bool apple_glx_pbuffer_set_event_mask(GLXDrawable d, unsigned long mask); + +/* Returns true if the GLXDrawable is a valid GLXPbuffer, and the *mask is set. */ +bool apple_glx_pbuffer_get_event_mask(GLXDrawable d, unsigned long *mask); + + +/* Pixmaps */ + +/* mode is a struct glx_config * */ +/* Returns true if an error occurred. */ +bool apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap, + const void *mode); + +/* Returns true if an error occurred. */ +bool apple_glx_pixmap_destroy(Display * dpy, Pixmap pixmap); + +bool apple_glx_pixmap_query(GLXPixmap pixmap, int attribute, + unsigned int *value); + + + +#endif --- mesa-7.9~git20100924.orig/src/glx/apple/appledri.c +++ mesa-7.9~git20100924/src/glx/apple/appledri.c @@ -0,0 +1,450 @@ +/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.12 2001/08/27 17:40:57 dawes Exp $ */ +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +Copyright 2000 VA Linux Systems, Inc. +Copyright (c) 2002, 2008 Apple Computer, Inc. +All Rights Reserved. + +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, sub license, 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 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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: + * Kevin E. Martin + * Jens Owen + * Rickard E. (Rik) Faith + * + */ + +/* THIS IS NOT AN X CONSORTIUM STANDARD */ + +#include +#include "appledristr.h" +#include +#include +#include + +static XExtensionInfo _appledri_info_data; +static XExtensionInfo *appledri_info = &_appledri_info_data; +static char *appledri_extension_name = APPLEDRINAME; + +#define AppleDRICheckExtension(dpy,i,val) \ + XextCheckExtension (dpy, i, appledri_extension_name, val) + +/***************************************************************************** + * * + * private utility routines * + * * + *****************************************************************************/ + +static int close_display(Display * dpy, XExtCodes * extCodes); +static Bool wire_to_event(Display * dpy, XEvent * re, xEvent * event); + +static /* const */ XExtensionHooks appledri_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + close_display, /* close_display */ + wire_to_event, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static +XEXT_GENERATE_FIND_DISPLAY(find_display, appledri_info, + appledri_extension_name, + &appledri_extension_hooks, + AppleDRINumberEvents, NULL) + + static XEXT_GENERATE_CLOSE_DISPLAY(close_display, appledri_info) + + static void (*surface_notify_handler) (); + + void *XAppleDRISetSurfaceNotifyHandler(void (*fun) ()) +{ + void *old = surface_notify_handler; + surface_notify_handler = fun; + return old; +} + +static Bool +wire_to_event(Display *dpy, XEvent *re, xEvent *event) +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRINotifyEvent *sevent; + + AppleDRICheckExtension(dpy, info, False); + + switch ((event->u.u.type & 0x7f) - info->codes->first_event) { + case AppleDRISurfaceNotify: + sevent = (xAppleDRINotifyEvent *) event; + if (surface_notify_handler != NULL) { + (*surface_notify_handler) (dpy, (unsigned int) sevent->arg, + (int) sevent->kind); + } + return False; + } + return False; +} + +/***************************************************************************** + * * + * public Apple-DRI Extension routines * + * * + *****************************************************************************/ + +#if 0 +#include +#define TRACE(msg) fprintf(stderr, "AppleDRI%s\n", msg); +#else +#define TRACE(msg) +#endif + + +Bool +XAppleDRIQueryExtension(dpy, event_basep, error_basep) + Display *dpy; + int *event_basep, *error_basep; +{ + XExtDisplayInfo *info = find_display(dpy); + + TRACE("QueryExtension..."); + if (XextHasExtension(info)) { + *event_basep = info->codes->first_event; + *error_basep = info->codes->first_error; + TRACE("QueryExtension... return True"); + return True; + } + else { + TRACE("QueryExtension... return False"); + return False; + } +} + +Bool +XAppleDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) + Display *dpy; + int *majorVersion; + int *minorVersion; + int *patchVersion; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIQueryVersionReply rep; + xAppleDRIQueryVersionReq *req; + + TRACE("QueryVersion..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIQueryVersion; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return False"); + return False; + } + *majorVersion = rep.majorVersion; + *minorVersion = rep.minorVersion; + *patchVersion = rep.patchVersion; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryVersion... return True"); + return True; +} + +Bool +XAppleDRIQueryDirectRenderingCapable(dpy, screen, isCapable) + Display *dpy; + int screen; + Bool *isCapable; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIQueryDirectRenderingCapableReply rep; + xAppleDRIQueryDirectRenderingCapableReq *req; + + TRACE("QueryDirectRenderingCapable..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIQueryDirectRenderingCapable, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIQueryDirectRenderingCapable; + req->screen = screen; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return False"); + return False; + } + *isCapable = rep.isCapable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("QueryDirectRenderingCapable... return True"); + return True; +} + +Bool +XAppleDRIAuthConnection(dpy, screen, magic) + Display *dpy; + int screen; + unsigned int magic; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIAuthConnectionReq *req; + xAppleDRIAuthConnectionReply rep; + + TRACE("AuthConnection..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIAuthConnection, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIAuthConnection; + req->screen = screen; + req->magic = magic; + rep.authenticated = 0; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return False"); + return False; + } + UnlockDisplay(dpy); + SyncHandle(); + TRACE("AuthConnection... return True"); + return True; +} + +Bool +XAppleDRICreateSurface(dpy, screen, drawable, client_id, key, uid) + Display *dpy; + int screen; + Drawable drawable; + unsigned int client_id; + unsigned int *key; + unsigned int *uid; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRICreateSurfaceReply rep; + xAppleDRICreateSurfaceReq *req; + + TRACE("CreateSurface..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRICreateSurface, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRICreateSurface; + req->screen = screen; + req->drawable = drawable; + req->client_id = client_id; + rep.key_0 = rep.key_1 = rep.uid = 0; + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.key_0) { + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateSurface... return False"); + return False; + } + key[0] = rep.key_0; + key[1] = rep.key_1; + *uid = rep.uid; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("CreateSurface... return True"); + return True; +} + +Bool +XAppleDRIDestroySurface(dpy, screen, drawable) + Display *dpy; + int screen; + Drawable drawable; +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIDestroySurfaceReq *req; + + TRACE("DestroySurface..."); + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIDestroySurface, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIDestroySurface; + req->screen = screen; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + TRACE("DestroySurface... return True"); + return True; +} + +Bool +XAppleDRICreateSharedBuffer(Display * dpy, int screen, Drawable drawable, + Bool doubleSwap, char *path, size_t pathlen, + int *width, int *height) +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRICreateSharedBufferReq *req; + xAppleDRICreateSharedBufferReply rep; + + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRICreateSharedBuffer, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRICreateSharedBuffer; + req->screen = screen; + req->drawable = drawable; + req->doubleSwap = doubleSwap; + + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + puts("REPLY ERROR"); + + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + printf("rep.stringLength %d\n", (int) rep.stringLength); + + if (rep.stringLength > 0 && rep.stringLength <= pathlen) { + _XReadPad(dpy, path, rep.stringLength); + + printf("path: %s\n", path); + + *width = rep.width; + *height = rep.height; + + UnlockDisplay(dpy); + SyncHandle(); + return True; + } + + UnlockDisplay(dpy); + SyncHandle(); + + return False; +} + +Bool +XAppleDRISwapBuffers(Display * dpy, int screen, Drawable drawable) +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRISwapBuffersReq *req; + + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRISwapBuffers, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRISwapBuffers; + req->screen = screen; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + + return True; +} + +Bool +XAppleDRICreatePixmap(Display * dpy, int screen, Drawable drawable, + int *width, int *height, int *pitch, int *bpp, + size_t * size, char *bufname, size_t bufnamesize) +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRICreatePixmapReq *req; + xAppleDRICreatePixmapReply rep; + + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRICreatePixmap, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRICreatePixmap; + req->screen = screen; + req->drawable = drawable; + + if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + UnlockDisplay(dpy); + SyncHandle(); + return False; + } + + /* + printf("rep.stringLength %d\n", (int) rep.stringLength); + */ + + if (rep.stringLength > 0 && rep.stringLength <= bufnamesize) { + _XReadPad(dpy, bufname, rep.stringLength); + + printf("path: %s\n", bufname); + + *width = rep.width; + *height = rep.height; + *pitch = rep.pitch; + *bpp = rep.bpp; + *size = rep.size; + + UnlockDisplay(dpy); + SyncHandle(); + return True; + } + else if (rep.stringLength > 0) { + _XEatData(dpy, rep.stringLength); + } + + UnlockDisplay(dpy); + SyncHandle(); + + return True; +} + +/* + * Call it a drawable, because we really don't know what it is + * until it reaches the server, and we should keep that in mind. + */ +Bool +XAppleDRIDestroyPixmap(Display * dpy, Pixmap drawable) +{ + XExtDisplayInfo *info = find_display(dpy); + xAppleDRIDestroyPixmapReq *req; + + AppleDRICheckExtension(dpy, info, False); + + LockDisplay(dpy); + GetReq(AppleDRIDestroyPixmap, req); + req->reqType = info->codes->major_opcode; + req->driReqType = X_AppleDRIDestroyPixmap; + req->drawable = drawable; + UnlockDisplay(dpy); + SyncHandle(); + + return True; +} --- mesa-7.9~git20100924.orig/src/glx/apple/Makefile +++ mesa-7.9~git20100924/src/glx/apple/Makefile @@ -0,0 +1,130 @@ +TOP = ../../.. + +include $(TOP)/configs/current + +#CC=gcc +#GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT $(RC_CFLAGS) $(CFLAGS) +#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module + +TCLSH=tclsh8.5 +MKDIR=mkdir +INSTALL=install +LN=ln +RM=rm + +#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include + +#COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c + +#The directory with the final binaries. +BUILD_DIR=builds + +all: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + +SOURCES = \ + apple_cgl.c \ + apple_glx.c \ + apple_glx_context.c \ + apple_glx_drawable.c \ + apple_glx_pbuffer.c \ + apple_glx_pixmap.c \ + apple_glx_surface.c \ + apple_visual.c \ + apple_xgl_api.c \ + apple_xgl_api_additional.c \ + apple_xgl_api_read.c \ + apple_xgl_api_stereo.c \ + apple_xgl_api_viewport.c \ + appledri.c \ + ../clientattrib.c \ + ../compsize.c \ + ../glcontextmodes.c \ + glx_empty.c \ + glx_error.c \ + ../glx_pbuffer.c \ + ../glx_query.c \ + ../glxcmds.c \ + ../glxcurrent.c \ + ../glxext.c \ + ../glxextensions.c \ + glxreply.c \ + ../pixel.c \ + ../xfont.c + +include $(TOP)/src/mesa/sources.mak + +LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation + +MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES)) +MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES)) +MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS)) + +OBJECTS = $(SOURCES:.c=.o) # $(MESA_GLAPI_OBJECTS) + +INCLUDES = -I. -Iinclude -I..\ + -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mapi \ + -I$(TOP)/src/mapi/glapi \ + $(LIBDRM_CFLAGS) \ + $(DRI2PROTO_CFLAGS) \ + $(X11_INCLUDES) + +##### RULES ##### + +$(OBJECTS) : apple_xgl_api.h + +apple_xgl_api.c : apple_xgl_api.h + +apple_xgl_api.h : gen_api_header.tcl gen_api_library.tcl gen_code.tcl gen_defs.tcl gen_exports.tcl gen_funcs.tcl gen_types.tcl + $(TCLSH) gen_code.tcl + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@ + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + +# Make libGL +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile + $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 1 -minor 2 $(MKLIB_OPTIONS) \ + -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \ + $(GL_LIB_DEPS) $(OBJECTS) + +depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile + rm -f depend + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \ + $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find $(TOP)/include` + +install_headers: include/GL/gl.h + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL + $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL + +install_libraries: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) + $(MAKE) -C $(TOP)/src/mesa install-libgl + +install: install_libraries + +# Remove .o and backup files +clean: + -rm -f *.o *.a *~ + -rm -f *.c~ *.h~ + -rm -f apple_xgl_api.h apple_xgl_api.c + -rm -f *.dylib + -rm -f include/GL/gl.h + -rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) + -rm -f *.o *~ + -rm -f depend depend.bak + +-include depend --- mesa-7.9~git20100924.orig/src/glx/apple/apple_glx_pbuffer.c +++ mesa-7.9~git20100924/src/glx/apple/apple_glx_pbuffer.c @@ -0,0 +1,348 @@ +/* + Copyright (c) 2009 Apple 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. +*/ + +/* Must be before OpenGL.framework is included. Remove once fixed: + * + */ +#include +#include +#define __gltypes_h_ 1 + +/* Must be first for: + * + */ +#include "apple_glx_context.h" +#include "apple_glx_drawable.h" + +#include +#include +#include +#include "apple_glx.h" +#include "glcontextmodes.h" +#include "apple_cgl.h" + +/* mesa defines in glew.h, Apple in glext.h. + * Due to namespace nightmares, just do it here. + */ +#ifndef GL_TEXTURE_RECTANGLE_EXT +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#endif + +static bool pbuffer_make_current(struct apple_glx_context *ac, + struct apple_glx_drawable *d); + +static void pbuffer_destroy(Display * dpy, struct apple_glx_drawable *d); + +static struct apple_glx_drawable_callbacks callbacks = { + .type = APPLE_GLX_DRAWABLE_PBUFFER, + .make_current = pbuffer_make_current, + .destroy = pbuffer_destroy +}; + + +/* Return true if an error occurred. */ +bool +pbuffer_make_current(struct apple_glx_context *ac, + struct apple_glx_drawable *d) +{ + struct apple_glx_pbuffer *pbuf = &d->types.pbuffer; + CGLError cglerr; + + assert(APPLE_GLX_DRAWABLE_PBUFFER == d->type); + + cglerr = apple_cgl.set_pbuffer(ac->context_obj, pbuf->buffer_obj, 0, 0, 0); + + if (kCGLNoError != cglerr) { + fprintf(stderr, "set_pbuffer: %s\n", apple_cgl.error_string(cglerr)); + return true; + } + + if (!ac->made_current) { + glViewport(0, 0, pbuf->width, pbuf->height); + glScissor(0, 0, pbuf->width, pbuf->height); + ac->made_current = true; + } + + apple_glx_diagnostic("made pbuffer drawable 0x%lx current\n", d->drawable); + + return false; +} + +void +pbuffer_destroy(Display * dpy, struct apple_glx_drawable *d) +{ + struct apple_glx_pbuffer *pbuf = &d->types.pbuffer; + + assert(APPLE_GLX_DRAWABLE_PBUFFER == d->type); + + apple_glx_diagnostic("destroying pbuffer for drawable 0x%lx\n", + d->drawable); + + apple_cgl.destroy_pbuffer(pbuf->buffer_obj); + XFreePixmap(dpy, pbuf->xid); +} + +/* Return true if an error occurred. */ +bool +apple_glx_pbuffer_destroy(Display * dpy, GLXPbuffer pbuf) +{ + return !apple_glx_drawable_destroy_by_type(dpy, pbuf, + APPLE_GLX_DRAWABLE_PBUFFER); +} + +/* Return true if an error occurred. */ +bool +apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config, + int width, int height, int *errorcode, + GLXPbuffer * result) +{ + struct apple_glx_drawable *d; + struct apple_glx_pbuffer *pbuf = NULL; + CGLError err; + Window root; + int screen; + Pixmap xid; + struct glx_config *modes = (__GLcontextModes *) config; + + root = DefaultRootWindow(dpy); + screen = DefaultScreen(dpy); + + /* + * This pixmap is only used for a persistent XID. + * The XC-MISC extension cleans up XIDs and reuses them transparently, + * so we need to retain a server-side reference. + */ + xid = XCreatePixmap(dpy, root, (unsigned int) 1, + (unsigned int) 1, DefaultDepth(dpy, screen)); + + if (None == xid) { + *errorcode = BadAlloc; + return true; + } + + if (apple_glx_drawable_create(dpy, screen, xid, &d, &callbacks)) { + *errorcode = BadAlloc; + return true; + } + + /* The lock is held in d from create onward. */ + pbuf = &d->types.pbuffer; + + pbuf->xid = xid; + pbuf->width = width; + pbuf->height = height; + + err = apple_cgl.create_pbuffer(width, height, GL_TEXTURE_RECTANGLE_EXT, + (modes->alphaBits > 0) ? GL_RGBA : GL_RGB, + 0, &pbuf->buffer_obj); + + if (kCGLNoError != err) { + d->unlock(d); + d->destroy(d); + *errorcode = BadMatch; + return true; + } + + pbuf->fbconfigID = modes->fbconfigID; + + pbuf->event_mask = 0; + + *result = pbuf->xid; + + d->unlock(d); + + return false; +} + + + +/* Return true if an error occurred. */ +static bool +get_max_size(int *widthresult, int *heightresult) +{ + CGLContextObj oldcontext; + GLint ar[2]; + + oldcontext = apple_cgl.get_current_context(); + + if (!oldcontext) { + /* + * There is no current context, so we need to make one in order + * to call glGetInteger. + */ + CGLPixelFormatObj pfobj; + CGLError err; + CGLPixelFormatAttribute attr[10]; + int c = 0; + GLint vsref = 0; + CGLContextObj newcontext; + + attr[c++] = kCGLPFAColorSize; + attr[c++] = 32; + attr[c++] = 0; + + err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref); + if (kCGLNoError != err) { + if (getenv("LIBGL_DIAGNOSTIC")) { + printf("choose_pixel_format error in %s: %s\n", __func__, + apple_cgl.error_string(err)); + } + + return true; + } + + + err = apple_cgl.create_context(pfobj, NULL, &newcontext); + + if (kCGLNoError != err) { + if (getenv("LIBGL_DIAGNOSTIC")) { + printf("create_context error in %s: %s\n", __func__, + apple_cgl.error_string(err)); + } + + apple_cgl.destroy_pixel_format(pfobj); + + return true; + } + + err = apple_cgl.set_current_context(newcontext); + + if (kCGLNoError != err) { + printf("set_current_context error in %s: %s\n", __func__, + apple_cgl.error_string(err)); + return true; + } + + + glGetIntegerv(GL_MAX_VIEWPORT_DIMS, ar); + + apple_cgl.set_current_context(oldcontext); + apple_cgl.destroy_context(newcontext); + apple_cgl.destroy_pixel_format(pfobj); + } + else { + /* We have a valid context. */ + + glGetIntegerv(GL_MAX_VIEWPORT_DIMS, ar); + } + + *widthresult = ar[0]; + *heightresult = ar[1]; + + return false; +} + +bool +apple_glx_pbuffer_query(GLXPbuffer p, int attr, unsigned int *value) +{ + bool result = false; + struct apple_glx_drawable *d; + struct apple_glx_pbuffer *pbuf; + + d = apple_glx_drawable_find_by_type(p, APPLE_GLX_DRAWABLE_PBUFFER, + APPLE_GLX_DRAWABLE_LOCK); + + if (d) { + pbuf = &d->types.pbuffer; + + switch (attr) { + case GLX_WIDTH: + *value = pbuf->width; + result = true; + break; + + case GLX_HEIGHT: + *value = pbuf->height; + result = true; + break; + + case GLX_PRESERVED_CONTENTS: + *value = true; + result = true; + break; + + case GLX_LARGEST_PBUFFER:{ + int width, height; + if (get_max_size(&width, &height)) { + fprintf(stderr, "internal error: " + "unable to find the largest pbuffer!\n"); + } + else { + *value = width; + result = true; + } + } + break; + + case GLX_FBCONFIG_ID: + *value = pbuf->fbconfigID; + result = true; + break; + } + + d->unlock(d); + } + + return result; +} + +bool +apple_glx_pbuffer_set_event_mask(GLXDrawable drawable, unsigned long mask) +{ + struct apple_glx_drawable *d; + bool result = false; + + d = apple_glx_drawable_find_by_type(drawable, APPLE_GLX_DRAWABLE_PBUFFER, + APPLE_GLX_DRAWABLE_LOCK); + + if (d) { + d->types.pbuffer.event_mask = mask; + result = true; + d->unlock(d); + } + + return result; +} + +bool +apple_glx_pbuffer_get_event_mask(GLXDrawable drawable, unsigned long *mask) +{ + struct apple_glx_drawable *d; + bool result = false; + + d = apple_glx_drawable_find_by_type(drawable, APPLE_GLX_DRAWABLE_PBUFFER, + APPLE_GLX_DRAWABLE_LOCK); + if (d) { + *mask = d->types.pbuffer.event_mask; + result = true; + d->unlock(d); + } + + return result; +} --- mesa-7.9~git20100924.orig/src/glx/apple/glx_empty.c +++ mesa-7.9~git20100924/src/glx/apple/glx_empty.c @@ -0,0 +1,281 @@ +#include "glxclient.h" +#include "glxextensions.h" +#include "glcontextmodes.h" + +/* +** GLX_SGI_swap_control +*/ +int +glXSwapIntervalSGI(int interval) +{ + (void) interval; + return 0; +} + + +/* +** GLX_MESA_swap_control +*/ +int +glXSwapIntervalMESA(unsigned int interval) +{ + (void) interval; + return GLX_BAD_CONTEXT; +} + + +int +glXGetSwapIntervalMESA(void) +{ + return 0; +} + + +/* +** GLX_SGI_video_sync +*/ +int +glXGetVideoSyncSGI(unsigned int *count) +{ + (void) count; + return GLX_BAD_CONTEXT; +} + +int +glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) +{ + (void) count; + return GLX_BAD_CONTEXT; +} + + +/* +** GLX_SGIX_swap_group +*/ +void +glXJoinSwapGroupSGIX(Display * dpy, GLXDrawable drawable, GLXDrawable member) +{ + (void) dpy; + (void) drawable; + (void) member; +} + + +/* +** GLX_SGIX_swap_barrier +*/ +void +glXBindSwapBarrierSGIX(Display * dpy, GLXDrawable drawable, int barrier) +{ + (void) dpy; + (void) drawable; + (void) barrier; +} + +Bool +glXQueryMaxSwapBarriersSGIX(Display * dpy, int screen, int *max) +{ + (void) dpy; + (void) screen; + (void) max; + return False; +} + + +/* +** GLX_OML_sync_control +*/ +Bool +glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, + int64_t * ust, int64_t * msc, int64_t * sbc) +{ + (void) dpy; + (void) drawable; + (void) ust; + (void) msc; + (void) sbc; + return False; +} + +int64_t +glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, + int64_t target_msc, int64_t divisor, int64_t remainder) +{ + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; + return 0; +} + + +Bool +glXWaitForMscOML(Display * dpy, GLXDrawable drawable, + int64_t target_msc, int64_t divisor, + int64_t remainder, int64_t * ust, + int64_t * msc, int64_t * sbc) +{ + (void) dpy; + (void) drawable; + (void) target_msc; + (void) divisor; + (void) remainder; + (void) ust; + (void) msc; + (void) sbc; + return False; +} + + +Bool +glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, + int64_t target_sbc, int64_t * ust, + int64_t * msc, int64_t * sbc) +{ + (void) dpy; + (void) drawable; + (void) target_sbc; + (void) ust; + (void) msc; + (void) sbc; + return False; +} + + +Bool +glXReleaseBuffersMESA(Display * dpy, GLXDrawable d) +{ + (void) dpy; + (void) d; + return False; +} + + +_X_EXPORT GLXPixmap +glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual, + Pixmap pixmap, Colormap cmap) +{ + (void) dpy; + (void) visual; + (void) pixmap; + (void) cmap; + return 0; +} + + +/** + * GLX_MESA_copy_sub_buffer + */ +void +glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, + int x, int y, int width, int height) +{ + (void) dpy; + (void) drawable; + (void) x; + (void) y; + (void) width; + (void) height; +} + + +_X_EXPORT int +glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable, + int attribute, unsigned int *value) +{ + (void) dpy; + (void) drawable; + (void) attribute; + (void) value; + return 0; +} + +_X_EXPORT GLXDrawable +glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfig config, + unsigned int width, unsigned int height, + int *attrib_list) +{ + (void) dpy; + (void) config; + (void) width; + (void) height; + (void) attrib_list; + return None; +} + +#if 0 +/* GLX_SGIX_fbconfig */ +_X_EXPORT int +glXGetFBConfigAttribSGIX(Display * dpy, void *config, int a, int *b) +{ + (void) dpy; + (void) config; + (void) a; + (void) b; + return 0; +} + +_X_EXPORT void * +glXChooseFBConfigSGIX(Display * dpy, int a, int *b, int *c) +{ + (void) dpy; + (void) a; + (void) b; + (void) c; + return NULL; +} + +_X_EXPORT GLXPixmap +glXCreateGLXPixmapWithConfigSGIX(Display * dpy, void *config, Pixmap p) +{ + (void) dpy; + (void) config; + (void) p; + return None; +} + +_X_EXPORT GLXContext +glXCreateContextWithConfigSGIX(Display * dpy, void *config, int a, + GLXContext b, Bool c) +{ + (void) dpy; + (void) config; + (void) a; + (void) b; + (void) c; + return NULL; +} + +_X_EXPORT XVisualInfo * +glXGetVisualFromFBConfigSGIX(Display * dpy, void *config) +{ + (void) dpy; + (void) config; + return NULL; +} + +_X_EXPORT void * +glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * visinfo) +{ + (void) dpy; + (void) visinfo; + return NULL; +} +#endif + + +_X_EXPORT +GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX, + (Display * dpy, GLXDrawable pbuf), + (dpy, pbuf), glXDestroyPbuffer) + + _X_EXPORT GLX_ALIAS_VOID(glXSelectEventSGIX, + (Display * dpy, GLXDrawable drawable, + unsigned long mask), (dpy, drawable, mask), + glXSelectEvent) + + _X_EXPORT GLX_ALIAS_VOID(glXGetSelectedEventSGIX, + (Display * dpy, GLXDrawable drawable, + unsigned long *mask), (dpy, drawable, mask), + glXGetSelectedEvent) --- mesa-7.9~git20100924.orig/src/glx/apple/apple_visual.c +++ mesa-7.9~git20100924/src/glx/apple/apple_visual.c @@ -0,0 +1,153 @@ +/* + Copyright (c) 2008, 2009 Apple 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. +*/ + +#include +#include +#include +#include +#include + +/* */ +#define glTexImage1D glTexImage1D_OSX +#define glTexImage2D glTexImage2D_OSX +#define glTexImage3D glTexImage3D_OSX +#include +#include +#include +#undef glTexImage1D +#undef glTexImage2D +#undef glTexImage3D + +#include "apple_cgl.h" +#include "apple_visual.h" +#include "apple_glx.h" +#include "glcontextmodes.h" + +enum +{ + MAX_ATTR = 60 +}; + +/*mode is a __GlcontextModes*/ +void +apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode, + bool * double_buffered, bool * uses_stereo, + bool offscreen) +{ + CGLPixelFormatAttribute attr[MAX_ATTR]; + const struct glx_config *c = mode; + int numattr = 0; + GLint vsref = 0; + CGLError error = 0; + + if (offscreen) { + apple_glx_diagnostic + ("offscreen rendering enabled. Using kCGLPFAOffScreen\n"); + + attr[numattr++] = kCGLPFAOffScreen; + attr[numattr++] = kCGLPFAColorSize; + attr[numattr++] = 32; + } + else if (getenv("LIBGL_ALWAYS_SOFTWARE") != NULL) { + apple_glx_diagnostic + ("Software rendering requested. Using kCGLRendererGenericFloatID.\n"); + attr[numattr++] = kCGLPFARendererID; + attr[numattr++] = kCGLRendererGenericFloatID; + } + else if (getenv("LIBGL_ALLOW_SOFTWARE") != NULL) { + apple_glx_diagnostic + ("Software rendering is not being excluded. Not using kCGLPFAAccelerated.\n"); + } + else { + attr[numattr++] = kCGLPFAAccelerated; + } + + /* + * The program chose a config based on the fbconfigs or visuals. + * Those are based on the attributes from CGL, so we probably + * do want the closest match for the color, depth, and accum. + */ + attr[numattr++] = kCGLPFAClosestPolicy; + + if (c->stereoMode) { + attr[numattr++] = kCGLPFAStereo; + *uses_stereo = true; + } + else { + *uses_stereo = false; + } + + if (c->doubleBufferMode) { + attr[numattr++] = kCGLPFADoubleBuffer; + *double_buffered = true; + } + else { + *double_buffered = false; + } + + attr[numattr++] = kCGLPFAColorSize; + attr[numattr++] = c->redBits + c->greenBits + c->blueBits; + attr[numattr++] = kCGLPFAAlphaSize; + attr[numattr++] = c->alphaBits; + + if ((c->accumRedBits + c->accumGreenBits + c->accumBlueBits) > 0) { + attr[numattr++] = kCGLPFAAccumSize; + attr[numattr++] = c->accumRedBits + c->accumGreenBits + + c->accumBlueBits + c->accumAlphaBits; + } + + if (c->depthBits > 0) { + attr[numattr++] = kCGLPFADepthSize; + attr[numattr++] = c->depthBits; + } + + if (c->stencilBits > 0) { + attr[numattr++] = kCGLPFAStencilSize; + attr[numattr++] = c->stencilBits; + } + + if (c->sampleBuffers > 0) { + attr[numattr++] = kCGLPFAMultisample; + attr[numattr++] = kCGLPFASampleBuffers; + attr[numattr++] = c->sampleBuffers; + attr[numattr++] = kCGLPFASamples; + attr[numattr++] = c->samples; + } + + attr[numattr++] = 0; + + assert(numattr < MAX_ATTR); + + error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); + + if (error) { + fprintf(stderr, "error: %s\n", apple_cgl.error_string(error)); + abort(); + } +} --- mesa-7.9~git20100924.orig/src/glx/apple/apple_glx_pixmap.c +++ mesa-7.9~git20100924/src/glx/apple/apple_glx_pixmap.c @@ -0,0 +1,230 @@ +/* + Copyright (c) 2009 Apple 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. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "apple_glx.h" +#include "apple_cgl.h" +#include "apple_visual.h" +#include "apple_glx_drawable.h" +#include "appledri.h" +#include "glcontextmodes.h" + +static bool pixmap_make_current(struct apple_glx_context *ac, + struct apple_glx_drawable *d); + +static void pixmap_destroy(Display * dpy, struct apple_glx_drawable *d); + +static struct apple_glx_drawable_callbacks callbacks = { + .type = APPLE_GLX_DRAWABLE_PIXMAP, + .make_current = pixmap_make_current, + .destroy = pixmap_destroy +}; + +static bool +pixmap_make_current(struct apple_glx_context *ac, + struct apple_glx_drawable *d) +{ + CGLError cglerr; + struct apple_glx_pixmap *p = &d->types.pixmap; + + assert(APPLE_GLX_DRAWABLE_PIXMAP == d->type); + + cglerr = apple_cgl.set_current_context(p->context_obj); + + if (kCGLNoError != cglerr) { + fprintf(stderr, "set current context: %s\n", + apple_cgl.error_string(cglerr)); + return true; + } + + cglerr = apple_cgl.set_off_screen(p->context_obj, p->width, p->height, + p->pitch, p->buffer); + + if (kCGLNoError != cglerr) { + fprintf(stderr, "set off screen: %s\n", apple_cgl.error_string(cglerr)); + + return true; + } + + if (!ac->made_current) { + glViewport(0, 0, p->width, p->height); + glScissor(0, 0, p->width, p->height); + ac->made_current = true; + } + + return false; +} + +static void +pixmap_destroy(Display * dpy, struct apple_glx_drawable *d) +{ + struct apple_glx_pixmap *p = &d->types.pixmap; + + if (p->pixel_format_obj) + (void) apple_cgl.destroy_pixel_format(p->pixel_format_obj); + + if (p->context_obj) + (void) apple_cgl.destroy_context(p->context_obj); + + XAppleDRIDestroyPixmap(dpy, p->xpixmap); + + if (p->buffer) { + if (munmap(p->buffer, p->size)) + perror("munmap"); + + if (-1 == close(p->fd)) + perror("close"); + + if (shm_unlink(p->path)) + perror("shm_unlink"); + } + + apple_glx_diagnostic("destroyed pixmap buffer for: 0x%lx\n", d->drawable); +} + +/* Return true if an error occurred. */ +bool +apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap, + const void *mode) +{ + struct apple_glx_drawable *d; + struct apple_glx_pixmap *p; + bool double_buffered; + bool uses_stereo; + CGLError error; + const struct glx_config *cmodes = mode; + + if (apple_glx_drawable_create(dpy, screen, pixmap, &d, &callbacks)) + return true; + + /* d is locked and referenced at this point. */ + + p = &d->types.pixmap; + + p->xpixmap = pixmap; + p->buffer = NULL; + + if (!XAppleDRICreatePixmap(dpy, screen, pixmap, + &p->width, &p->height, &p->pitch, &p->bpp, + &p->size, p->path, PATH_MAX)) { + d->unlock(d); + d->destroy(d); + return true; + } + + p->fd = shm_open(p->path, O_RDWR, 0); + + if (p->fd < 0) { + perror("shm_open"); + d->unlock(d); + d->destroy(d); + return true; + } + + p->buffer = mmap(NULL, p->size, PROT_READ | PROT_WRITE, + MAP_FILE | MAP_SHARED, p->fd, 0); + + if (MAP_FAILED == p->buffer) { + perror("mmap"); + d->unlock(d); + d->destroy(d); + return true; + } + + apple_visual_create_pfobj(&p->pixel_format_obj, mode, &double_buffered, + &uses_stereo, /*offscreen */ true); + + error = apple_cgl.create_context(p->pixel_format_obj, NULL, + &p->context_obj); + + if (kCGLNoError != error) { + d->unlock(d); + d->destroy(d); + return true; + } + + p->fbconfigID = cmodes->fbconfigID; + + d->unlock(d); + + apple_glx_diagnostic("created: pixmap buffer for 0x%lx\n", d->drawable); + + return false; +} + +bool +apple_glx_pixmap_query(GLXPixmap pixmap, int attr, unsigned int *value) +{ + struct apple_glx_drawable *d; + struct apple_glx_pixmap *p; + bool result = false; + + d = apple_glx_drawable_find_by_type(pixmap, APPLE_GLX_DRAWABLE_PIXMAP, + APPLE_GLX_DRAWABLE_LOCK); + + if (d) { + p = &d->types.pixmap; + + switch (attr) { + case GLX_WIDTH: + *value = p->width; + result = true; + break; + + case GLX_HEIGHT: + *value = p->height; + result = true; + break; + + case GLX_FBCONFIG_ID: + *value = p->fbconfigID; + result = true; + break; + } + + d->unlock(d); + } + + return result; +} + +/* Return true if the type is valid for pixmap. */ +bool +apple_glx_pixmap_destroy(Display * dpy, GLXPixmap pixmap) +{ + return !apple_glx_drawable_destroy_by_type(dpy, pixmap, + APPLE_GLX_DRAWABLE_PIXMAP); +} --- mesa-7.9~git20100924.orig/debian/changelog +++ mesa-7.9~git20100924/debian/changelog @@ -0,0 +1,2816 @@ +mesa (7.9~git20100924-0ubuntu2) maverick; urgency=low + + * Cherry-pick b24238c4 from 7.9 release branch. Fixes the lookup of + drawables after switching the GLX context, which was causing BadDrawable + errors in clutter applications which use multiple stages (LP: #561734) + + -- Christopher James Halse Rogers Thu, 30 Sep 2010 14:48:12 +1000 + +mesa (7.9~git20100924-0ubuntu1) maverick; urgency=low + + * New upstream snapshot from the 7.9 release branch up to commit 3ad02793. + - Fixes GPU hang in occlusion-query on i965 (LP: #634683) + - Fixes hang/crash when changing desktop-effects settings in + KDE. (LP: #633406) + * debian/rules: + - Update configure options for kms → drm EGL backend name change + - Remove unused HAVE_KMS variable. + + -- Christopher James Halse Rogers Thu, 23 Sep 2010 11:25:10 +1000 + +mesa (7.9~git20100909-0ubuntu3) maverick; urgency=low + + * Drop the changes from previous upload. The Unity white screen problem + is clutter bug #632352, fixed in clutter-1.0 1.2.12-0ubuntu12. + + -- Christopher James Halse Rogers Thu, 16 Sep 2010 16:04:28 +0200 + +mesa (7.9~git20100909-0ubuntu2) maverick; urgency=low + + * 105_old_gc_ignore_destroyed_drawable_events.patch (revert), + 106_old_gc_fix_use_after_free.patch (revert), + 107_old_gc_drop_broken_drawable_garbage_collector.patch (revert): + These three related patches introduced a new garbage collector, however + this introduces a regression causing clutter/mutter/unity to load with + a blank white screen. Revert these three patches to restore mesa to + a working condition for unity. + (LP: #638808, #638725) + + -- Bryce Harrington Wed, 15 Sep 2010 19:32:52 -0700 + +mesa (7.9~git20100909-0ubuntu1) maverick; urgency=low + + [ Robert Hooker ] + * New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413) + * New features include ATI HD5xxx series support in r600, and a vastly + improved glsl compiler. + * Remove pre-generated .pc's, use the ones generated at build time + instead. + * Remove all references to mesa-utils now that its no longer shipped + with the mesa source. + * Add 104_i915_fragment_shader_disable.patch: + - Disable the experimental ARB_fragment_shader option by default on + i915, it exposes incomplete functionality that breaks KDE compositing + among other things. It can be enabled via driconf still. (LP: #628930). + + [ Christopher James Halse Rogers ] + * debian/patches/04_osmesa_version.diff: + - Refresh for new upstream + * Bugs fixed in this release: + - Fixes severe rendering corruption in Unity on radeon (LP: #628727, + LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741). + - Also fixes rendering in gnome-shell (LP: #578619). + - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541). + - Provides preliminary support for new intel chips (LP: #601052). + * debian/rules: + - Update configure flags to match upstream reshuffling. + - Explicitly remove gallium DRI drivers that we don't want to ship. + * Update debian/gbp.conf for this Maverick-specific packaging + * libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers + for EGL, libegl1-mesa-drivers now contains a single driver that provides + both backends. + + -- Robert Hooker Tue, 14 Sep 2010 08:55:40 -0400 + +mesa (7.8.2-2ubuntu2) maverick; urgency=low + + * Cherry-pick EGL/GL|ES/OpenVG virtual packages from Debian experimental git + * debian/control: + - Add EGL, GLESv1, GLESv2, and OpenVG virtual packages. The Khronos group + specifies a de-facto linux ABI for these libraries. We have a similar + package for libgl1. + * debian/README.Debian: + - Document the virtual packages above. + + -- Christopher James Halse Rogers Fri, 30 Jul 2010 19:08:57 +1000 + +mesa (7.8.2-2ubuntu1) maverick; urgency=low + + * Merge from Debian experimental. Remaining Ubuntu changes: + - debian/control + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + + Drop i686 swx11 libgl package. + + Add libdrm-dev to mesa-common-dev Depends. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Use lzma compression for binary debs to save CD space. + - debian/patches + + 100_no_abi_tag.patch + + 101_ubuntu_hidden_glname.patch + + 103_savage-expose_fbmodes_with_nonzero_alpha.patch + + 107_glxgears_is_not_a_benchmark.patch + - rules, libgl1-mesa-{glx,dev,swx11,swx11-dev}.install, + libgl1-mesa-{glx,swx11}.{postinst,prerm}, libgl1-mesa-dev.links: + Install libGL.so* in /usr/lib/mesa to allow things to work with + alternatives. + * debian/rules: Drop get-orig-source target. mesa-demos is now split out + of git, so this divergence from Debian will no longer be informative. + + -- Christopher James Halse Rogers Tue, 27 Jul 2010 16:31:13 +1000 + +mesa (7.8.2-2) experimental; urgency=low + + * Add missing dependencies to libegl1-mesa-dev, thanks to Alexandros + Frantzis (LP: #600243). + * gallium: handle kfreebsd like freebsd, fixing FTBFS (closes: #585618) + * intel: Fix invalidate before initialisation (stolen from fdo bugzilla + #29091, fixes server 1.9rc crash when starting an app using GLX 1.3) + * Pull from 7.8-branch up to commit d06e011. + * Fixup hurd and kfreebsd patches to apply. + + -- Julien Cristau Tue, 20 Jul 2010 15:57:31 +0200 + +mesa (7.8.2-1) experimental; urgency=low + + [ Robert Hooker ] + * Adjust the build system to install the dri target in a separate + DESTDIR, no longer passing --libdir=/usr/lib/glx at configure time + messing with the .pc's since it is used for a majority of the + packages now. + * Fix up the mesa-common-dev header install location. + + [ Julien Cristau ] + * Add ${misc:Depends} to all packages. + * libc6-dev is build-essential, no need to depend on it. + * Replace nonsensical dependency of libglw1-mesa-dev on libxext6 with a + dependency on libxt-dev and lesstif2-dev. + * Add new lintian overrides for the package-name-doesnt-match-sonames stuff. + * Don't ship progs/objviewer in the tarball, it's insanely big and unused. + * New upstream release. + * Refresh patches. + * Stop shipping an upstream git log, it's unlikely to be useful to anyone, + and it's big. + * debian/scripts/choose-configs: use DEB_HOST_ARCH, not DEB_BUILD_ARCH + (closes: #451648). + * Rename radeong_dri.so to r300_dri.so in build, not binary. + + [ Christopher James Halse Rogers ] + * debian/patches/07-nouveau-update.diff: + - Pull in nouveau_class.h header no longer shipped by libdrm 2.4.21 and + update nouveau build to use it. Fixes FTBFS against libdrm 2.4.21. + * debian/rules: + - Simplify selecting which gallium drivers are built. Use this to only + act on gallium packages on archs where we're actually building them. + Part of the fix for FTBFS on Hurd and kFreeBSD. + + -- Julien Cristau Thu, 01 Jul 2010 12:50:18 +0200 + +mesa (7.8.1-3ubuntu3) maverick; urgency=low + + [ Alexandros Frantzis ] + * Make libegl1-mesa-dev depend on the following libraries which + contain the required .pc files, as specified in egl.pc: + libdrm-dev, x11proto-dri2-dev, x11proto-gl-dev, libx11-dev, + libxext-dev, libxxf86vm-dev, libxdamage-dev, libxfixes-dev. + + -- Alberto Milone Thu, 15 Jul 2010 19:01:10 +0200 + +mesa (7.8.1-3ubuntu2) maverick; urgency=low + + * Fix up the mesa-common-dev header installation location + causing FTBS on packages needing GL headers (LP: #594863) + + -- Robert Hooker Tue, 15 Jun 2010 19:04:38 -0400 + +mesa (7.8.1-3ubuntu1) maverick; urgency=low + + * Merge from Debian experimental git. Remaining Ubuntu changes: + - debian/control + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + + Drop i686 swx11 libgl package. + + Add libdrm-dev to mesa-common-dev Depends. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Use lzma compression for binary debs to save CD space. + - debian/patches + + 100_no_abi_tag.patch + + 101_ubuntu_hidden_glname.patch + + 103_savage-expose_fbmodes_with_nonzero_alpha.patch + + 107_glxgears_is_not_a_benchmark.patch + - rules, libgl1-mesa-{glx,dev,swx11,swx11-dev}.install, + libgl1-mesa-{glx,swx11}.{postinst,prerm}, libgl1-mesa-dev.links: + Install libGL.so* in /usr/lib/mesa to allow things to work with + alternatives. + + -- Christopher James Halse Rogers Tue, 15 Jun 2010 08:49:05 +1000 + +mesa (7.8.1-2) experimental; urgency=low + + [ Tormod Volden ] + * debian/rules: Do not strip the same packages twice + + [ Julien Cristau ] + * Stop building the ffb dri driver on sparc, it no longer exists. + * Merge changes from 7.7.1-2. + + [ Christopher James Halse Rogers ] + * debian/compat: + - Bump to v7 for dh_install search path behaviour + * debian/rules: + - Enable gallium for dri build. + - Enable egl for dri build. + - Build nouveau, radeon & swrast gallium drivers + - Build OpenVG, OpenGL|ES, dri, glx & egl state trackers + * debian/libegl1-mesa-dev.install: + * debian/libegl1-mesa.install: + * debian/libegl1-mesa.symbols: + - New libEGL package. + * debian/libgles1-mesa-dev.install: + * debian/libgles1-mesa.install: + * debian/libgles1-mesa.symbols: + - New OpenGL|ES v1.x package. + * debian/libgles2-mesa-dev.install: + * debian/libgles2-mesa.install: + * debian/libgles2-mesa.symbols: + - New OpenGL|ES v2.x package. + * debian/libopenvg1-mesa-dev.install: + * debian/libopenvg1-mesa.install: + * debian/libopenvg1-mesa.symbols: + - New OpenVG package. + * debian/libegl1-mesa-drivers-x11.install: + - New gallium EGL drivers package. + * debian/libegl1-mesa-drivers-kms.install: + - New gallium EGL kms driver package. + * debian/egl.pc: + * debian/vg.pc: + * debian/glesv1_cm.pc: + * debian/glesv2.pc: + - Pull pkg-config files from master and install them in the respective + -dev packages. + * debian/libgl1-mesa-dri-experimental.install: + * debian/libgl1-mesa-dri.install: + - “make install†puts classic and gallium drivers in the same path, but + builds gallium drivers in the gallium/ subdirectory. Copy the drivers + directly from the build path, rather than trying to separate them out + post-hock. + * debian/control: + - Add new packages. + - Add new build-depends on libx11-xcb-dev, libxcb-dri2-0-dev, + libxcb-xfixes0-dev and python-libxml2 for gallium. + - Bump build-depends on dpkg-dev for regex in symbols files. + + -- Julien Cristau Fri, 11 Jun 2010 03:19:09 +0200 + +mesa (7.8.1-1ubuntu1) maverick; urgency=low + + [ Timo Aaltonen ] + * Merged from Debian experimental, remaining changes: + - debian/control + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + - debian/patches + + 100_no_abi_tag.patch + + 101_ubuntu_hidden_glname.patch + + 103_savage-expose_fbmodes_with_nonzero_alpha.patch + + 107_glxgears_is_not_a_benchmark.patch + - rules, libgl1-mesa-{glx,dev,swx11,swx11-dev}.install, + libgl1-mesa-{glx,swx11}.{postinst,prerm}, libgl1-mesa-dev.links: + Install libGL.so* in /usr/lib/mesa to allow things to work with + alternatives. + * Dropped patches: + - 102_dont_vblank.patch: should be obsolete by now + - 104_savage_init_mesa.patch: merged upstream + * control: Drop dependencies on dpkg, since lucid has it and it's the + only version where upgrades are supported from. + * libgl1-mesa-dri.postinst: Drop, same as above. + + [ Robert Hooker ] + * debian/rules: Stop building/shipping abandoned the mach64 DRI driver. + + [ Christopher James Halse Rogers ] + * debian/patches/103_savage-expose_fbmodes_with_nonzero_alpha.patch + - Refresh for driCreateConfigs API change + * debian/gbp.conf + - Set debian-branch=ubuntu to make git-buildpackage less annoying + * debian/rules + - Add get-orig-source target to document the way the orig.tar.gz is + generated. + - The i386 architecture for Maverick is now i686, not i486. Adapt rules + so that the Intel DRI drivers are actually built. + - Drop LDFLAGS unexport. Mesa builds fine on amd64 with Ubuntu's + default LDFLAGS. + * debian/control: + - Drop libgl1-mesa-swx11-i686 package. This package is pointless on + Maverick, as i386 now defaults to i686 + * debian/scripts/choose-configs: + - Drop libgl1-mesa-swx11-i686 from CPU-optimised swrast configs. + + * Changes from unreleased debian-expemental 7.8.1-2 packaging: + [ Tormod Volden ] + * debian/rules: Do not strip the same packages twice + + [ Julien Cristau ] + * Stop building the ffb dri driver on sparc, it no longer exists. + + -- Christopher James Halse Rogers Wed, 19 May 2010 14:47:25 +1000 + +mesa (7.8.1-1) experimental; urgency=low + + * New upstream release. + + Pull from upstream 7.8 branch up to commit db3b3421. + * Refresh patches. + * Bump build dependency to libdrm-dev 2.4.19, x11proto-gl-dev 1.4.11, + and x11proto-dri2-dev 2.1. + + -- Brice Goglin Sun, 18 Apr 2010 09:25:39 +0200 + +mesa (7.7.1-2) unstable; urgency=low + + * debian/rules: use DEB_HOST_ARCH_CPU instead of DEB_HOST_GNU_CPU. Prompted + by Ubuntu which changed the latter to i686, breaking their packages on + i386. + * Pull from mesa_7_7_branch (commit 8ba378d). + + -- Julien Cristau Thu, 20 May 2010 17:34:19 +0200 + +mesa (7.7.1-1ubuntu3) lucid-proposed; urgency=low + + * Add 104_savage_init_mesa.patch: Savage driver needs to initialize + &ctx->Meta->Save. Fixes crash when using _mesa_CopyTexImage2D + on Savage hardware. Cherrypick from upstream. Thanks Tormod. + (LP: #562718) + + -- Bryce Harrington Wed, 21 Apr 2010 09:48:09 -0700 + +mesa (7.7.1-1ubuntu2) lucid; urgency=low + + * Add 103_savage-expose_fbmodes_with_nonzero_alpha.patch: Expose + fbmodes with non-zero alpha depth. Fixes issue where clutter apps + crash when using the savage driver. Thanks to knarf for developing + the fix. + (LP: #467474) + * mesa-common-dev should depend on libdrm-dev + (LP: #490811) + + -- Bryce Harrington Wed, 14 Apr 2010 12:06:00 -0700 + +mesa (7.7.1-1ubuntu1) lucid; urgency=low + + [ Alberto Milone ] + * debian/rules: pass --with-dri-searchpath=/usr/lib/dri:/usr/lib32/dri + to confflags-dri on i386 so that /usr/lib32/dri is used for 32 bit + compatibility on 64 bit systems (LP: #248392). + + -- Timo Aaltonen Thu, 01 Apr 2010 13:31:09 +0300 + +mesa (7.7.1-1) unstable; urgency=low + + [ Brice Goglin ] + * Remove Thierry Reding from Uploaders, closes: #572539. + * Bump Standards-Version to 3.8.4, no changes needed. + + [ Timo Aaltonen ] + * New upstream release. + + -- Brice Goglin Tue, 30 Mar 2010 17:15:09 +0200 + +mesa (7.7-4ubuntu1) lucid; urgency=low + + [Timo Aaltonen] + * libgl1-mesa-dri: Get rid of the old hook (65mesa-check-x86-64). + (LP: #460809) + + [Rolf Leggewie] + * debian/control: depend on dpkg package where u-a supports --force + (LP: #525592) + + -- Timo Aaltonen Tue, 02 Mar 2010 17:11:31 +0200 + +mesa (7.7-4) unstable; urgency=low + + * Pull from upstream mesa_7_7_branch up to commit 293f4d51. + + r6xx/r7xx: emit relocation for FRAG & TILE buffer, closes: #569663. + + -- Brice Goglin Wed, 24 Feb 2010 22:44:11 +0100 + +mesa (7.7-3ubuntu1) lucid; urgency=low + + [ Timo Aaltonen ] + * Merge from Debian experimental. + + [ Robert Hooker ] + * Add 100_no_abi_tag.patch: Removes the ABI tag in /usr/lib/libGL.so.1 + which prevented ldconfig from using a libGL from another directory + at a higher priority than the one in /usr/lib. + * Install libGL alternatives with libgl1-mesa-swx11 as well. (LP: #522048) + + -- Timo Aaltonen Fri, 19 Feb 2010 15:52:12 +0200 + +mesa (7.7-3) experimental; urgency=low + + * Pull from upstream mesa_7_7_branch up to commit f5145a6e. + * Build against libdrm-radeon1 2.4.17 to get DRI2 support. + + -- Brice Goglin Mon, 01 Feb 2010 22:55:36 +0100 + +mesa (7.7-2) experimental; urgency=low + + [ Julien Cristau ] + * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no + good reason. Thanks, Colin Watson! + * Remove myself from Uploaders + + [ Brice Goglin ] + * Pull from upstream mesa_7_7_branch up to commit 2f28ca0a. + + Fix funky colors on radeon/r200/r300. + + -- Brice Goglin Wed, 27 Jan 2010 09:14:38 +0100 + +mesa (7.7-0ubuntu8) lucid; urgency=low + + * debian/libgl1-mesa-glx.postinst: + - Pass LDCONFIG_NOTRIGGER=y to ldconfig as it needs to be run + immediately as we're changing /etc/ld.so.conf.d/ with + alternatives. + + -- Alberto Milone Wed, 20 Jan 2010 13:17:54 +0100 + +mesa (7.7-0ubuntu7) lucid; urgency=low + + * debian/libgl1-mesa-glx.postinst + - Install alternative with --force so that files that + already exist are overwritten thus avoiding to install a + broken alternative. + + -- Alberto Milone Tue, 19 Jan 2010 17:29:19 +0100 + +mesa (7.7-0ubuntu6) lucid; urgency=low + + * debian/libgl1-mesa-glx.postinst + - Remove gl_libraries slave link as the file in ld.so.conf.d is + enough. + + -- Alberto Milone Sun, 17 Jan 2010 16:55:36 +0100 + +mesa (7.7-0ubuntu5) lucid; urgency=low + + * debian/rules: + - Remove invalid "install -d" command. + - Do not pass --libdir=/usr/lib/mesa flag any more. + * debian/libgl1-mesa-dev.install, libgl1-mesa-swx11-dev.install, + libgl1-mesa-swx11.install, libglu1-mesa-dev.install, + libglu1-mesa.install: + - Install *.pc files in /usr/lib/pkgconfig instead of + /usr/lib/mesa/pkgconfig. + - Do not Install libGLU* in /usr/lib/mesa (LP: #506547). + * debian/libglu1-mesa-dev.links: + - Remove file as we install libGLU in the right place now. + + -- Alberto Milone Wed, 13 Jan 2010 20:18:17 +0100 + +mesa (7.7-0ubuntu4) lucid; urgency=low + + * debian/libgl1-mesa-dev.links: + - Add link to /usr/lib/mesa/libGL.so in /usr/lib so as not to break + software that build against mesa (LP: #505359). + * debian/libgl1-mesa-glx.{postinst|prerm}: + - Use alternatives so that /usr/lib/GL is a slave which points to + /usr/lib/mesa. + * debian/libglu-mesa-dev.links: + - Add link to /usr/lib/mesa/libGLU.so in /usr/lib/libGLU.so. + * debian/rules: + - Install /usr/lib/mesa/ld.so.conf + - Create an empty directory (for alternatives) just to be sure: + /usr/lib/xorg/x11-extra-modules. + + -- Alberto Milone Mon, 11 Jan 2010 16:49:14 +0100 + +mesa (7.7-0ubuntu3) lucid; urgency=low + + * Add -l/usr/lib/mesa to dh_shlibdeps to fix FTBFS, thanks to + Albert Damen for the patch! + + -- Stefan Potyra Sun, 10 Jan 2010 00:41:48 +0100 + +mesa (7.7-0ubuntu2) lucid; urgency=low + + * Moving just libGL.so.* to /usr/lib/mesa broke all builds depending on + libGL.so or gl.pc. Fix the swx11 target --libdir to use /usr/lib/mesa. + + -- Timo Aaltonen Sat, 09 Jan 2010 11:21:13 +0200 + +mesa (7.7-0ubuntu1) lucid; urgency=low + + * Merge from Debian experimental. + + -- Timo Aaltonen Sat, 09 Jan 2010 00:12:29 +0200 + +mesa (7.7-1) experimental; urgency=low + + [ Brice Goglin ] + * Bump libdrm build dependency to 2.4.15, closes: #561058. + * New upstream release. + * Pull from upstream mesa_7_7_branch up to commit 6d6c9c66. + + [ Julien Cristau ] + * Add freedesktop.org ftp to watch file since that's where newer upstream + tarballs are. + * Don't include GLUT sources since we don't use them. + + -- Brice Goglin Mon, 11 Jan 2010 17:52:31 +0100 + +mesa (7.7~rc2-1) experimental; urgency=low + + * New upstream release candidate. + + s3v and trident DRI drivers removed since they never worked. + + -- Brice Goglin Sat, 12 Dec 2009 13:02:55 +0100 + +mesa (7.6.1-1) unstable; urgency=low + + * New upstream release + + Pull upstream mesa_7_6_branch up to commit da876fa3 + * Bump linux-libc-dev build-dep to 2.6.31 for the r600 dri driver (fixes + ftbfs on mips). + * Drop hunk from 05_hurd-ftbfs.diff that was applied upstream. Refresh + other patches. + + -- Julien Cristau Tue, 29 Dec 2009 10:42:24 +0000 + +mesa (7.6.1~rc3-1ubuntu2) lucid; urgency=low + + * debian/libgl1-mesa-glx.install: + - Install libGL.so* in /usr/lib/mesa so as to allow things to + work with alternatives. + + -- Alberto Milone Fri, 08 Jan 2010 19:38:14 +0100 + +mesa (7.6.1~rc3-1ubuntu1) lucid; urgency=low + + * Merge from Debian unstable. + + -- Timo Aaltonen Mon, 14 Dec 2009 16:49:11 +0200 + +mesa (7.6.1~rc3-1) unstable; urgency=low + + * New upstream release candidate. + + Pull upstream mesa_7_6_branch up to commit 7d41b424. + + Includes sparc64 xform asm patch from #560403. + * Update debian/rules to fix sparc64 FTBFS, thanks Aurelien Jarno, + closes: #560403. + * Build r600 DRI driver. + + -- Brice Goglin Fri, 11 Dec 2009 18:36:36 +0100 + +mesa (7.6.1~rc2-1ubuntu1) lucid; urgency=low + + * Merge from Debian unstable, remaining changes: + - debian/control + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Build .debs with lzma compression. + - debian/patches + + 101_ubuntu_hidden_glname.patch + + 102_dont_vblank.patch + + 107_glxgears_is_not_a_benchmark.patch + * Drop patches now included upstream: + - 108_fix_scissors_regression.patch + - 109_revert-dma-reuse.patch + - 110_dont_free.patch + + -- Timo Aaltonen Mon, 07 Dec 2009 18:07:26 +0200 + +mesa (7.6.1~rc2-1) unstable; urgency=low + + * New upstream release candidate. + + Pull upstream mesa_7_6_branch up to commit b2953ee. + + i965: Fix the bounds emitted in the vertex buffer packets, + closes: #556541. + + Fix window drawing regression in Kwin on older Radeon hardware, + fix assertion failure leading to crash on kwin when compositing + is enabled, closes: #549588. + + Refresh patches. + + -- Brice Goglin Sun, 06 Dec 2009 00:14:34 +0100 + +mesa (7.6.0-1ubuntu4) karmic; urgency=low + + * Add 110_dont_free.patch: It is not necessary to worry about freeing + the textures, VBOs, etc. in _mesa_meta_free() since these are already + handled by the normal context deallocation code. Fixes a crash in + Blender in brw_prepare_vertices(). + (LP: #438657) + + -- Bryce Harrington Tue, 13 Oct 2009 13:48:03 -0700 + +mesa (7.6.0-1ubuntu3) karmic; urgency=low + + * Add 109_revert-dma-reuse.patch: Fix assertion failure leading to crash + on kwin when compositing is enabled. This reverts commit 284a7af27. + (LP: #446578) + + -- Bryce Harrington Tue, 13 Oct 2009 00:52:32 -0700 + +mesa (7.6.0-1ubuntu2) karmic; urgency=low + + * Add 108_fix_scissors_regression.patch: Fix window drawing regression + in Kwin on older Radeon hardware. + (LP: #446425) + + -- Bryce Harrington Fri, 09 Oct 2009 14:12:44 -0700 + +mesa (7.6.0-1ubuntu1) karmic; urgency=low + + * Merge from Debian. (LP: #420803) + Remaining Ubuntu changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + + Require at least libdrm_2.4.12+git20090801.45078630 + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Build .debs with lzma compression. + + Serialize install phase as suggested by Julien Cristau, + fixes amd64 FTBFS. + - debian/patches + + 101_ubuntu_hidden_glname.patch + + 102_dont_vblank.patch + + 107_glxgears_is_not_a_benchmark.patch + * Drop patches now included upstream: + + 108_big_endian.patch + + 109_fix_relocation_delta_for_wm_surfaces.patch + + 110_deassociate_drawables.patch + + 111_dridrawable_nullptr.patch + + 112_dont_corrupt_random_number_state.patch + * Mesa 7.6 fixes the following Ubuntu bugs: + + Suppress excessive warnings on unsupported GLX 1.3 calls. + (LP: #433488) + * See http://www.mesa3d.org/relnotes-7.6.html for more details. + + -- Bryce Harrington Wed, 07 Oct 2009 14:51:41 -0700 + +mesa (7.6-1) unstable; urgency=low + + [ Brice Goglin ] + * New upstream release. + + Fix software fallback assertion on RS480, closes: #539162. + + Fix segfault in _swrast_ReadPixels on i915, closes: #545085. + + [ Julien Cristau ] + * Don't run install from the various configs in parallel, hopefully fixing a + bug in the previous debian/rules. Thanks to Bernhard R. Link for the + suggestions. + + -- Brice Goglin Tue, 29 Sep 2009 11:51:58 +0200 + +mesa (7.6.0~git20090817.7c422387-0ubuntu8) karmic; urgency=low + + * Add 112_dont_corrupt_random_number_state.patch: Fix predictable + numbers being seeded into the RNG in OpenGL when glutCreateWindow() is + called. + (LP: #421651) + + -- Bryce Harrington Wed, 07 Oct 2009 00:38:40 -0700 + +mesa (7.6.0~git20090817.7c422387-0ubuntu7) karmic; urgency=low + + * Add 110_deassociate_drawables.patch, 111_dridrawable_nullptr.patch: + Fix X crash when 3D wine applications are closed. + (LP: #401067) + + -- Bryce Harrington Fri, 02 Oct 2009 18:00:02 -0700 + +mesa (7.6.0~git20090817.7c422387-0ubuntu6) karmic; urgency=low + + * Fix build failures for big endian architectures, update + 108_big_endian.patch. + + -- Matthias Klose Sun, 27 Sep 2009 15:34:47 +0200 + +mesa (7.6.0~git20090817.7c422387-0ubuntu5) karmic; urgency=low + + * debian/rules: Disable r600: Disable r600 as 3D support is still + experimental and causes problems with the gnome session when + compiz is enabled (LP: #419126). + + -- Alberto Milone Wed, 16 Sep 2009 17:43:59 +0200 + +mesa (7.6.0~git20090817.7c422387-0ubuntu4) karmic; urgency=low + + * Add 109_fix_relocation_delta_for_wm_surfaces.patch: Fix relocation + delta for WM surfaces. This was a regression introduced in + 0f328c90dbc893e15005f2ab441d309c1c176245 (LP: #429241). + + -- Alberto Milone Tue, 15 Sep 2009 18:14:48 +0200 + +mesa (7.6.0~git20090817.7c422387-0ubuntu3) karmic; urgency=low + + * Add 108_big_endian.patch: Fix a couple build issues on big-endian hw. + * changelog: Restore missing changelog entries lost during merge. + + -- Bryce Harrington Wed, 26 Aug 2009 13:25:56 -0700 + +mesa (7.6.0~git20090817.7c422387-0ubuntu2) karmic; urgency=low + + * control: Require at least libdrm_2.4.12+git20090801.45078630 + + -- Bryce Harrington Fri, 21 Aug 2009 21:09:03 -0700 + +mesa (7.6.0~git20090817.7c422387-0ubuntu1) karmic; urgency=low + + [Bryce Harrington] + * Checkout from git 20090817 (master branch) up to commit + 7c4223876b4f8a78335687c7fcd7448b5a83ad10 + + Add DRI2 support to -ati + (LP: #329654, #404428, #327698, #321108) + + Fix portion of MythTV Frontend does not work with RADEON DRI + (LP: #341898) + + Fix selection mode on RS482 + (LP: #273329) + + Fix issue running 3D acceleration games on ATI chipsets + (LP: #374590) + + Provide DRI2 swap buffers + (LP: #377090) + + Fix blender unusable with UXA when DRI2 enabled + (LP: #353763) + + Fix glxgears blanking screens on -ati + (LP: #411251) + * Drop 108_bo_assertion.patch (applied upstream) + + [Robert Hooker] + * Only added debian/ tree from origin/ubuntu + * Enable r600 driver. Note that it requires seperate drm modules + not provided in this PPA or in ubuntu, and also does not work with + KMS. + + -- Bryce Harrington Fri, 21 Aug 2009 19:14:36 -0700 + +mesa (7.5.1-1) unstable; urgency=low + + [ Brice Goglin ] + * New upstream release. + * Add README.source. + * Bump Standards-Version to 3.8.3. + + [ Julien Cristau ] + * Override 'package-name-doesnt-match-sonames' lintian warnings for libGLU, + libGLw and both libGLs. + * Use dh_lintian and bump debhelper build-dep accordingly. + + -- Brice Goglin Fri, 04 Sep 2009 11:38:46 +0200 + +mesa (7.5-3) unstable; urgency=low + + * Pull from upstream mesa_7_5_branch up to commit b4ba6a66 + (early 7.5.1 release snapshot). + * Only install the huge upstream changelog in mesa-common-dev, + closes: #538094. + * Enable i686 optimized libraries on hurd-i386. + + -- Brice Goglin Fri, 24 Jul 2009 00:29:28 +0200 + +mesa (7.5-2) unstable; urgency=low + + * Pull from upstream mesa_7_5_branch up to commit a6b31415 + + radeon/DRI1: if we have HW stencil, only expose fbconfigs with stencil, + closes: #537732. + * Install the upstream changelog. + + -- Brice Goglin Tue, 21 Jul 2009 22:21:50 +0200 + +mesa (7.5-1ubuntu1) karmic; urgency=low + + * Merge from Debian. Remaining Ubuntu changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Build .debs with lzma compression. + + Serialize install phase as suggested by Julien Cristau, + fixes amd64 FTBFS. + - debian/patches + + 101_ubuntu_hidden_glname.patch + + 102_dont_vblank.patch + + 107_glxgears_is_not_a_benchmark.patch + * Dropped patches, applied upstream: + - 108_bo_assertion.patch + * Mesa 7.5 fixes the following Ubuntu bugs: + - Fixes intelTexImage Assertion failed (LP: #358403) + - Fixes segv during glean/makeCurrent (LP: #333748) + + -- Bryce Harrington Tue, 21 Jul 2009 00:41:19 -0700 + +mesa (7.5-1) unstable; urgency=low + + [ Timo Aaltonen ] + * Move dri.pc to mesa-common-dev (closes: #521667) + + [ Brice Goglin ] + * Enable i686 optimized libraries on kfreebsd-i386, closes: #537345. + * New upstream release: + + i915: Fix assertion failure on remapping a non-BO-backed VBO, + closes: #537147. + + GLX/DRI1: Mark GLX visuals with depth != screen depth non-conformant, + closes: #532980. + + -- Brice Goglin Sun, 19 Jul 2009 12:53:41 +0200 + +mesa (7.5~rc4-1ubuntu3) karmic; urgency=low + + * Add 108_bo_assertion.patch: Fix assertion failure on remapping a + non-BO-backed VBO with intel video. (LP: #396667) + + -- Robert Hooker (Sarvatt) Tue, 07 Jul 2009 14:35:54 -0400 + +mesa (7.5~rc4-1ubuntu2) karmic; urgency=low + + * rules: Add a missing semicolon (FTBFS). + + -- Timo Aaltonen Tue, 30 Jun 2009 19:49:17 +0300 + +mesa (7.5~rc4-1ubuntu1) karmic; urgency=low + + * Merge from Debian experimental, remaining changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Use --disable-glw for swx11 targets too. + + Don't enable motif for swx11 targets. + + Build .debs with lzma compression. + - debian/patches + + 101_ubuntu_hidden_glname.patch refreshed. + + 102_dont_vblank.patch refreshed. + - debian/mesa-common-dev.install + + Install dri.pc + * Dropped patches, applied upstream: + 104_fix_dri2_ext_tfp.diff + 105_glXWaitX_segfaults.patch + 108_destroy_intel_fb.patch + 109_release_direct_rendering_resources.patch + 110_null_ptr_during_screen_tear_down.patch + * rules: Serialize install phase as suggested by Julien Cristau, + fixes amd64 FTBFS. + + -- Timo Aaltonen Tue, 30 Jun 2009 17:52:14 +0300 + +mesa (7.5~rc4-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release candidate. + + xdriinfo now works with DRI2 (closes: #527132) + * rules: Disable EGL. + * mesa-common-dev.install: Don't install glxew.h, conflicts with libglew. + + [ Julien Cristau ] + * Update patches: + + 02_use-ieee-fp-on-s390-and-m68k.patch moved from imports.h to compiler.h + + 03_optional-progs-and-install.patch refreshed + + 05_hurd-ftbfs.diff partly applied upstream + + 06_kfreebsd-ftbfs.diff refreshed + * Install dri.pc, which will be needed to build xorg-server 1.7. + * Don't build gallium for now. + + -- Julien Cristau Sun, 28 Jun 2009 20:21:37 +0200 + +mesa (7.4.4-1) unstable; urgency=low + + [ Julien Cristau ] + * New upstream release. + + fixes a crash in swrast glXWaitX (closes: #528708) + * Don't build hardware dri drivers on s390. + * Update 04_osmesa_version.diff, refresh 06_kfreebsd-ftbfs.diff. + + [ Brice Goglin ] + * Enable motif in GLw, closes: #527483. + + -- Julien Cristau Sun, 28 Jun 2009 18:58:27 +0200 + +mesa (7.4.1-1ubuntu6) karmic; urgency=low + + * Install dri.pc in libgl1-mesa-dev as well + (LP: #379797) + + -- Robert Hooker Wed, 24 Jun 2009 17:47:08 -0400 + +mesa (7.4.1-1ubuntu5) karmic; urgency=low + + * Drop 111_fix_mesa_ref_fb_call_syntax.patch: Testing showed that 110 + alone is sufficient to fix the issue. + + -- Bryce Harrington Wed, 24 Jun 2009 17:07:33 -0700 + +mesa (7.4.1-1ubuntu4) karmic; urgency=low + + * Add 110_null_ptr_during_screen_tear_down.patch and + 111_fix_mesa_ref_fb_call_syntax.patch to fix crashes caused by errors + in the previous memory leak fixes in -1u3. + (LP: #391808) + + -- Bryce Harrington Wed, 24 Jun 2009 15:32:54 -0700 + +mesa (7.4.1-1ubuntu3) karmic; urgency=low + + * Add 108_destroy_intel_fb.patch: Release fb backing regions in + intelDestroyBuffer(). Cherrypicked patch. Fixes memory leak when + destroying framebuffers. + (LP: #360319) + * Add 109_release_direct_rendering_resources.patch: Cherrypicked patch. + Also release direct rendering resources in glXDestroyGLXPixmap. + Fixes leak running compiz with direct rendering. + (LP: #376092) + + -- Bryce Harrington Tue, 23 Jun 2009 13:44:02 -0700 + +mesa (7.4.1-1ubuntu2) karmic; urgency=low + + * Add 107_glxgears_is_not_a_benchmark.patch: glxgears makes + troubleshooting performance issues difficult because bug reporters + see it provides fps output, and end up not looking for a better + benchmark. + + -- Bryce Harrington Mon, 04 May 2009 12:49:12 -0700 + +mesa (7.4.1-1ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends. + + Comment out GLw libs since it depends on lesstif-dev. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + use --disable-glw for swx11 targets too. + + Build .debs with lzma compression. + - debian/patches + + 101_ubuntu_hidden_glname.patch. + + 102_dont_vblank.patch: + + 104_fix_dri2_ext_tfp.diff + + 105_glXWaitX_segfaults.patch + + -- Timo Aaltonen Fri, 15 May 2009 14:50:57 +0300 + +mesa (7.4.1-1) unstable; urgency=low + + [ Julien Cristau ] + * Make libgl1-mesa-dev and mesa-common-dev 'Architecture: any'. This gets + rid of uninstallability when a new upstream version isn't built on all + architectures, and allows us to ship potentially arch-specific .pc files. + * Install pkgconfig files for libGLU, libOSMesa and libGLw. + * Make libgl1-mesa-dri{,-dbg} 'Architecture: any', as swrast_dri.so should + get built everywhere. + * Drop the dependency on libgl1-mesa-glx from -dri, and make -glx recommend + -dri instead. The dri drivers are also loaded by the X server, which + doesn't need libGL. On the other hand, libGL needs one of the dri drivers + for direct rendering (either software or hardware). Mark libgl1-mesa-dri + as breaking old xserver-xorg-core and libgl1-mesa-glx, to avoid + incompatibilities. + * Add patch by Samuel Thibault to fix FTBFS on hurd-i386. + * Pull from mesa_7_4_branch as of May 3rd (commit 63375254). + * Move -dbg packages to new 'debug' section. + + [ Brice Goglin ] + * Add patch by Aurelien Jarno to fix FTBFS on kfreebsd-i386, closes: #524690. + + -- Julien Cristau Sun, 03 May 2009 16:05:09 +0200 + +mesa (7.4-2) unstable; urgency=low + + * Upload to unstable. + + -- Julien Cristau Wed, 08 Apr 2009 23:53:47 +0100 + +mesa (7.4-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release. + + -- Julien Cristau Wed, 01 Apr 2009 20:25:00 +0200 + +mesa (7.4-0ubuntu4) karmic; urgency=low + + * debian/patches/106_compiz_ring_switcher_xorg_segv_on_radeon.diff: + fix xserver segv triggered by compiz ring switcher plugin for users + with r300/r400 radeon chipsets and -ati driver. Patch previously + commited to mesa master as c28707b50701b1cf8727be29d61e2d939c6ee58f + and also to mesa_7_4_branch as a1ce4efefbb7f796a0a24544a1e893a56848f0c1. + Note: it was commited to the 7.4 branch after mesa 7.4.0 release. + (LP: #368049) + + -- Martin Olsson Mon, 04 May 2009 12:25:29 +0200 + +mesa (7.4-0ubuntu3) jaunty; urgency=low + + * Disable 103_bump_965_texture_limit.diff. This is suspected to cause X + freeze issues. + (LP: 359392, Reopen: 146298) + + -- Bryce Harrington Fri, 17 Apr 2009 11:48:50 -0700 + +mesa (7.4-0ubuntu2) jaunty; urgency=low + + * Add 105_glXWaitX_segfaults.patch. Resolves segfaults from unitialized + variables when using swrast based drivers. (LP: #355242) + + -- Mario Limonciello Wed, 15 Apr 2009 01:03:30 -0500 + +mesa (7.4-0ubuntu1) jaunty; urgency=low + + * New upstream release, merge from debian-experimental + (LP: #330476, #347171, #349127) + * Drop 103_rs600_support.patch, included in this version. + * Drop 104_swrast_fbconfigs.patch, included in this version. + * Add 103_bump_965_texture_limit.diff. (LP: #146298) + * Add 104_fix_dri2_ext_tfp.diff. (LP: #324854) + + -- Timo Aaltonen Fri, 03 Apr 2009 12:42:06 +0300 + +mesa (7.4~rc1-1) experimental; urgency=low + + * New upstream release candidate. + * Fix watch file to make uscan not consider release candidates as newer than + actual releases. + * debian/control: add lpia to the Architecture field for + libgl1-mesa-dri{,-dbg} to match Ubuntu. + * debian/rules: on lpia, only build the i915 and i965 dri drivers (based on + Ubuntu changes). + * Build-depend on linux-libc-dev >= 2.6.29 on linux archs. + + -- Julien Cristau Wed, 25 Mar 2009 11:34:42 +0100 + +mesa (7.3-1ubuntu4) jaunty; urgency=low + + * Backport 104_swrast_fbconfigs.patch from mesa git. + - Properly assigns an fbconfig for the root visual. This fixes + issues with MythTV not being able to show fonts when using a software + rasterizer. (LP: #341898) + + -- Mario Limonciello Fri, 27 Mar 2009 02:50:13 -0500 + +mesa (7.3-1ubuntu3) jaunty; urgency=low + + * Add 103_rs600_support.patch: Adds support for the RS600 chip and sets + the number of gb pipes properly for r3xx/r5xx cards. + + -- Bryce Harrington Tue, 03 Mar 2009 00:26:59 -0800 + +mesa (7.3-1ubuntu2) jaunty; urgency=low + + [ Julien Cristau ] + * Drop CFLAGS mangling for lpia and armel from debian/rules, the issue has + been fixed upstream. + + [ Timo Aaltonen ] + * 102_dont_vblank.patch: Disable vblank again for intel, and revisit it + again during the next cycle. + + -- Timo Aaltonen Mon, 23 Feb 2009 16:48:56 +0200 + +mesa (7.3-1ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. + * Drop 102_remove_flip.diff, included in 7.3.. + + -- Timo Aaltonen Sat, 31 Jan 2009 12:38:44 +0200 + +mesa (7.3-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release. + + [ Julien Cristau ] + * Try to make the diff a bit smaller by removing directories that are in + upstream git but not in tarballs. + + -- Julien Cristau Fri, 30 Jan 2009 20:00:34 +0100 + +mesa (7.3~rc3-1ubuntu2) jaunty; urgency=low + + * 102_remove_flip.diff: Add a patch from upstream which removes the + remaining bits of pageflipping support. (LP: #320690) + + -- Timo Aaltonen Sun, 25 Jan 2009 00:00:04 +0200 + +mesa (7.3~rc3-1ubuntu1) jaunty; urgency=low + + * Merge with Debian experimental. + * Drop 102_dont_vblank.patch, since the new drm code in the kernel + fixes the bugs that it worked around. + * Bump the build-dependency of libdrm to 2.4.4. It's the first version + with necessary changes to build this. + + -- Timo Aaltonen Fri, 23 Jan 2009 10:20:24 +0200 + +mesa (7.3~rc3-1) experimental; urgency=low + + [ Timo Aaltonen ] + * New upstream release candidate. + + [ Julien Cristau ] + * Refresh patches 03 and 04. + + -- Julien Cristau Wed, 21 Jan 2009 19:01:21 +0100 + +mesa (7.3~rc1-1) experimental; urgency=low + + * New upstream release candidate. + + provides DRI2 (closes: #411141). + + i915: fallback for cube map texture. Fixes GPU hang with scorched3d + (closes: #484049). + + [ Timo Aaltonen ] + * Remove debian/patches/01_disable-intel-classic-warn.diff, the + warning is gone now. + * debian/control: + - Build-depend on x11proto-dri2-dev (>= 1.99.3) + + [ Julien Cristau ] + * Require libdrm-dev 2.4.3. + * Merge packaging changes from unstable, from 7.0.3-5 to 7.0.3-7. + * Delete unused configs/debian-*, and install-source.sh script. We've + switched to using autoconf, and mesa-swx11-source is gone. + * Delete some now unused code from debian/rules. + + -- Julien Cristau Sat, 10 Jan 2009 22:14:55 +0100 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu4) jaunty; urgency=low + + * debian/rules: Add -D_GNU_SOURCE for lpia & armel (FTBFS). + + -- Timo Aaltonen Fri, 12 Dec 2008 02:15:40 +0200 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu3) jaunty; urgency=low + + * debian/rules (CFLAGS): Avoid recursive reference. + + -- Matthias Klose Thu, 11 Dec 2008 22:34:43 +0100 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu2) jaunty; urgency=low + + * debian/rules: Add -D_BSD_SOURCE to CFLAGS for lpia & armel (FTBFS). + * Drop the Xsession.d hook, not needed anymore. + + -- Timo Aaltonen Thu, 11 Dec 2008 23:20:47 +0200 + +mesa (7.2+git20081209.a0d5c3cf-0ubuntu1) jaunty; urgency=low + + * Merge from debian-experimental git branch. + * 103_fix-crash-in-i830_emit_state.dpatch: deleted, included + upstream. + + -- Timo Aaltonen Tue, 09 Dec 2008 21:54:28 +0200 + +mesa (7.2-1ubuntu2) intrepid; urgency=low + + * debian/patches/103_fix-crash-in-i830_emit_state.dpatch: + - Apply upstream commit to fix a crash in i830_emit_state + (LP: #277709) + + -- Chris Coulson Tue, 21 Oct 2008 17:55:10 +0100 + +mesa (7.2-1ubuntu1) intrepid; urgency=low + + * Merge from Debian experimental. + + -- Timo Aaltonen Wed, 24 Sep 2008 21:00:38 +0300 + +mesa (7.2-1) experimental; urgency=low + + [ Brice Goglin ] + * Fix grammar and punctuation in glxinfo(1), thanks Sam Hocevar, + closes: #498595. + + [ Timo Aaltonen ] + * New upstream release. + * Refresh patch 04_osmesa_version.diff + + [ Julien Cristau ] + * Remove the build-dep on dri2proto, DRI2 support has been removed. + * intel: don't warn about TTM init failure. + + -- Julien Cristau Wed, 24 Sep 2008 14:28:21 +0200 + +mesa (7.1-1ubuntu3) intrepid; urgency=low + + * debian/rules: Build i915 and i965 DRI drivers on lpia. (LP: #270106) + + -- Timo Aaltonen Tue, 16 Sep 2008 13:07:02 +0300 + +mesa (7.1-1ubuntu2) intrepid; urgency=low + + * 102_dont_vblank.patch + - Revert the commit which defaults to vblank on intel. It breaks + DPMS with compiz, resulting in a hang. (LP: 262605) + + -- Timo Aaltonen Fri, 12 Sep 2008 11:25:01 +0300 + +mesa (7.1-1ubuntu1) intrepid; urgency=low + + * Merge from debian experimental, remaining changes: + - debian/control + + Change maintainer address to Ubuntu. + + Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + + Comment out GLw libs since it depends on lesstif-dev. + + Add lpia to -dri and -dri-dbg package in. + + Add Pre-Depends: dpkg (>= 1.14.12ubuntu3) to ensure dpkg + support for lzma. + - debian/rules + + Unexport LDFLAGS (amd64 FTBFS). + + Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + + use --disable-glw for swx11 targets too. + + Build .debs with lzma compression. + - debian/patches + + Add 101_ubuntu_hidden_glname.patch. + + -- Timo Aaltonen Thu, 28 Aug 2008 01:18:35 +0300 + +mesa (7.1-1) experimental; urgency=low + + * Add parallel build support. + * New upstream development release + + libGLU now only exports its public interface (closes: #319388) + * Some more parallel build updates. + + -- Julien Cristau Wed, 27 Aug 2008 19:52:24 +0200 + +mesa (7.1~rc3-1ubuntu4) intrepid; urgency=low + + * debian/control: Add Pre-Depends: dpkg (>= 1.14.12ubuntu3) to ensure dpkg + support for lzma. + + -- Martin Pitt Sun, 11 May 2008 10:42:54 +0200 + +mesa (7.1~rc3-1ubuntu3) intrepid; urgency=low + + * Build .debs with lzma compression to reduce libgl1-mesa-dri from 13.2 to + 2.8 MB. + + -- Martin Pitt Tue, 12 Aug 2008 09:31:01 +0200 + +mesa (7.1~rc3-1ubuntu2) intrepid; urgency=low + + * 102_fix-fdo-14441.diff: fix tfp on i965. (LP: #245888) + + -- Timo Aaltonen Fri, 01 Aug 2008 16:08:01 +0300 + +mesa (7.1~rc3-1ubuntu1) intrepid; urgency=low + + * merged with debian-experimental + + -- Michael Vogt Tue, 15 Jul 2008 15:07:41 +0100 + +mesa (7.1~rc3-1) experimental; urgency=low + + [ Julien Cristau ] + * New upstream release candidate (updated to git commit 4fab47b1). + * Build against libdrm >= 2.3.1. + * 04_osmesa_version.diff: fix libOSMesa versioning, to revert accidental + SONAME bump. + + [ Timo Aaltonen ] + * Refresh patches, and drop obsolete 00_create-libdir.patch and + 01_fix-makefile.patch. + * Build-depend on x11proto-dri2-dev. + * Drop mesa-swx11-source. + * Add dri_interface.h to mesa-common-dev. + * Add gl.pc to libgl1-mesa-dev + * rules: Replace the old build system with the new autotools-based + system. + * Run autoreconf before building the various flavours.. + * Add automake & autoconf to build-deps. + * Use --enable-glx-tls for dri. + + -- Julien Cristau Sun, 13 Jul 2008 19:41:42 +0200 + +mesa (7.1~rc1-0ubuntu2) intrepid; urgency=low + + * Merge with debian git, fixes FTBFS on sparc/hppa/ia64. + + -- Timo Aaltonen Mon, 07 Jul 2008 11:12:26 +0300 + +mesa (7.1~rc1-0ubuntu1) intrepid; urgency=low + + [ Bryce Harrington ] + * Merge from git.debian.org, remaining changes: + - Change maintainer address to Ubuntu. + - Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + - Comment out GLw libs from control since it depends on lesstif-dev. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + - Add 101_ubuntu_hidden_glname.patch. + + [ Timo Aaltonen ] + * Dropped patches + 102_ubuntu_no_glw.patch: + - the new build system handles this better + 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff: + - upstream + * debian/rules: use --disable-glw for swx11 targets too. + * Unexport LDFLAGS (amd64 FTBFS). + + -- Timo Aaltonen Fri, 04 Jul 2008 13:19:57 +0300 + +mesa (7.0.3-7) unstable; urgency=low + + * Cherry-pick patch from upstream: + Use 3Dnow! x86-64 routines only on processors that support 3Dnow! + (closes: #484180). + * Also build the x86-specific dri drivers on kfreebsd (closes: #492894). + + -- Julien Cristau Sun, 14 Dec 2008 07:34:58 +0530 + +mesa (7.0.3-6) unstable; urgency=high + + * Update debian/copyright to the SGI Free Software License B, version 2.0. + It now mirrors the free X11 license used by X.Org (closes: #368560). + http://www.sgi.com/company_info/newsroom/press_releases/2008/september/opengl.html + + -- Julien Cristau Sat, 20 Sep 2008 16:30:44 +0200 + +mesa (7.0.3-5) unstable; urgency=low + + * Disable the i915tex driver, it doesn't build against libdrm 2.3.1. + * Pull from mesa_7_0_branch (27425708). + + -- Julien Cristau Sat, 12 Jul 2008 18:56:19 +0200 + +mesa (7.0.3-4) unstable; urgency=low + + * Pull from mesa_7_0_branch (2ac4919d). + * Put back our configs/ changes into the .diff.gz since choose-configs + needs them before quilt is invoked. Put 04_cleanup-osmesa-configs.patch + there as well for #485161. + + -- Brice Goglin Wed, 18 Jun 2008 20:59:14 +0200 + +mesa (7.0.3-3ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address to Ubuntu. + - Drop lesstif-dev from Build-Depends since it's a universe component + that Ubuntu doesn't want in main due to security concerns about it + (it's a large codebase without active development - last release >2 + yrs ago). + - Comment out GLw libs from control since it depends on lesstif-dev. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch to remove lesstif build depends since + its a universe component. + - Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". + (LP: 189580, fdo: 13541) + - Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them + (LP: 87661, Deb: 484180, fdo: 8724) + + -- Bryce Harrington Tue, 17 Jun 2008 16:47:35 -0700 + +mesa (7.0.3-3) unstable; urgency=low + + * Pull from mesa_7_0_branch (718724de). + + Fix intel_batchbuffer_space on i965, closes: #455817. + + Fix busy error in i915_wait_irq for real now, closes: #467319. + * Move our configs/ changes from the .diff.gz into our quilt patches, + with 04_cleanup-osmesa-configs.patch renamed into 04_debian-configs.patch, + closes: #485161. + + -- Brice Goglin Tue, 17 Jun 2008 20:00:51 +0200 + +mesa (7.0.3-2) unstable; urgency=low + + * Pull from mesa_7_0_branch (03447de3). + * Set right cliprects for the current draw region on Intel, closes: #467319. + * Use BRW_TEXCOORDMODE_CLAMP instead of BRW_TEXCOORDMODE_CLAMP_BORDER + to implement GL_CLAMP on i965, closes: #478880. + * Fix segment fault with BASE_LEVEL set to 5 for MipMap on i915, + closes: #451339. + * Disable low impact fallback on r300 by default, closes: #440868. + + -- Brice Goglin Fri, 13 Jun 2008 06:53:29 +0200 + +mesa (7.0.3-1ubuntu2) intrepid; urgency=low + + * Add Xsession hook to disable ASM optimizations when running on + 64-but processors that don't support them (LP: #87661) + + -- Tormod Volden Thu, 05 Jun 2008 12:41:25 +0200 + +mesa (7.0.3-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". (LP: #189580) + + -- Timo Aaltonen Wed, 04 Jun 2008 18:38:43 +0300 + +mesa (7.0.3-1) unstable; urgency=low + + * New upstream release. + * Only call ProgramStringNotify if program parsing succeeded, + closes: #473551. + + -- Brice Goglin Fri, 11 Apr 2008 08:42:37 +0200 + +mesa (7.0.3~rc2-2) unstable; urgency=low + + * Pull from mesa_7_0_branch (1e83d70b). + * Fixes regression in the i965 dri driver (closes: #470984, #470084) + * Update 02_use-ieee-fp-on-s390-and-m68k.patch. + * Change libgl1-mesa-swx11-i686's pre-dependency on libgl1-mesa-swx11 to a + regular versioned dependency, and add ${shlibs:Depends}. + + -- Julien Cristau Mon, 31 Mar 2008 16:47:31 +0200 + +mesa (7.0.3~rc2-1ubuntu3) hardy; urgency=low + + * debian/patches/107_fix_-ve_rhw_regression.patch: Fixes regression + introduced upstream where a -ve rhw workaround is being applied only + for IGD systems, when it should be applied only for *non*-IGD systems. + This resulted in rendering issues in 3D games and drawing programs. + (LP: #199823, #206287) + + -- Bryce Harrington Fri, 04 Apr 2008 19:46:40 -0700 + +mesa (7.0.3~rc2-1ubuntu2) hardy; urgency=low + + [ Laurent Bigonville ] + * debian/patches/105_vblank_fix.patch: Fix "drmWaitVBlank returned -1" error + (LP: #186764) + + [ Timo Aaltonen ] + * Add 106_i965_wine_fix.diff from upstream, "Only call + ProgramStringNotify if program parsing succeeded". (LP: #178292) + + -- Timo Aaltonen Wed, 12 Mar 2008 12:33:41 +0200 + +mesa (7.0.3~rc2-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable (LP: #189167), remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + * Drop patch 103_fix_rv410se.diff, applied upstream. + * Add 103_dlopen_in_driveropen.diff and 104_fix_driveropen.diff from + upstream; "Always call dlopen in DriverOpen". (LP: #189580) + + -- Timo Aaltonen Tue, 26 Feb 2008 13:07:45 +0200 + +mesa (7.0.3~rc2-1) unstable; urgency=low + + * New upstream release candidate. + + enable user-defined clip planes for R300 (closes: #408679) + + 03_optional-progs-and-install.patch: partly applied upstream, fixed up + * Stop building with -O0 on hppa. Bug #451047 should be fixed in recent gcc + versions. + + -- Julien Cristau Sun, 24 Feb 2008 10:22:54 +0100 + +mesa (7.0.2-4ubuntu2) hardy; urgency=low + + * 103_fix_rv410se.diff: + - patch from upstream; "Fix rendering on x700 SE chips." + (LP: #151974) + + -- Timo Aaltonen Wed, 30 Jan 2008 13:18:23 +0200 + +mesa (7.0.2-4ubuntu1) hardy; urgency=low + + * Merge from debian unstable (LP: #151974), remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + + -- Timo Aaltonen Tue, 29 Jan 2008 12:09:30 +0200 + +mesa (7.0.2-4) unstable; urgency=low + + * Update to mesa_7_0_branch head (commit 48ae5cf0). + * Add Vcs-Git, Vcs-Browser and Homepage fields in debian/control. + + -- Julien Cristau Thu, 17 Jan 2008 22:23:06 +0100 + +mesa (7.0.2-3ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + * debian/control: Do not build-depend on gcc-3.4 anymore. + * Drop 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Sat, 05 Jan 2008 00:45:31 +0200 + +mesa (7.0.2-3) unstable; urgency=low + + * Update to mesa_7_0_branch head (commit 0107acde). + * Bump Standards-Version to 3.7.3. + * Move libgl1-mesa-swx11-dbg, mesa-common-dev and libosmesa6-dev to section + libdevel. + * libgl1-mesa-swx11 conflicts with libgl1-mesa-glx. Move it and + libgl1-mesa-swx11-dev to priority extra. + * Fix typo in mesa-common-dev's long description. + + -- Julien Cristau Tue, 18 Dec 2007 19:13:18 +0100 + +mesa (7.0.2-2ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Add gcc-3.4 as a build dependency for amd64, i386 and lpia. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Fri, 16 Nov 2007 09:00:24 +0200 + +mesa (7.0.2-2) unstable; urgency=low + + [ Julien Cristau ] + * Don't set -fno-strict-aliasing in configs/debian-default. It is set + upstream now. + * Workaround gcc ICE on hppa: build libOSMesa with -O0 (see bug#451047). + * Add build-dep on libxext-dev. Thanks, Timo Aaltonen! + + -- Brice Goglin Tue, 13 Nov 2007 21:43:40 +0100 + +mesa (7.0.2-1ubuntu2) hardy; urgency=low + + * Add libxext-dev to Build-Depends. + + -- Timo Aaltonen Mon, 12 Nov 2007 14:50:38 +0200 + +mesa (7.0.2-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer address. + - Add gcc-3.4 as a build dependency for amd64, i386 and lpia. + - Drop lesstif-dev from Build-Depends. + - Comment out GLw libs from control. + - Add lpia to -dri and -dri-dbg package in debian/control. + - Add lpia to ARCH_X86 in configs/debian-dri-default. + - Add 101_ubuntu_hidden_glname.patch + - Add 102_ubuntu_no_glw.patch + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch + + -- Timo Aaltonen Mon, 12 Nov 2007 12:55:33 +0200 + +mesa (7.0.2-1) unstable; urgency=low + + * New upstream release. + + Fix Blender crash in triangle_twoside(), closes: #439668, #446315. + + Fix crash in _generic_read_RGBA_span_RGB565_MMX(), closes: #445313. + + Fix the new __gluInvertMatrix() function, closes: #440137 ,#441071. + + Refresh 03_optional-progs-and-install.patch since libGLU is not + built when building progs/xdemos. + + Refresh 04_cleanup-osmesa-configs.patch. + + Drop 05_static-nonpic.patch,, applied upstream. + + Remove DESTDIR from INSTALL_DIR in configs/debian-default since + the upstream Makefiles now support DESTDIR. + * Add myself to Uploaders. + + -- Brice Goglin Sun, 11 Nov 2007 11:53:26 +0100 + +mesa (7.0.1-2) unstable; urgency=low + + * Update to latest git (from mesa_7_0_branch) + + adds support for some new intel chipsets (i915 and i915_tex dri drivers) + (closes: #437333) + + broken inline asm in dri drivers fixed (closes: #423739) + + -- Julien Cristau Tue, 28 Aug 2007 12:11:30 +0200 + +mesa (7.0.1-1ubuntu3) gutsy; urgency=low + + * Add lpia to -dri and -dri-dbg package in debian/control. + * Add lpa top ARCH_X86 in configs/debian-dri-default. + + -- Tollef Fog Heen Fri, 12 Oct 2007 14:12:21 +0200 + +mesa (7.0.1-1ubuntu2) gutsy; urgency=low + + * Add fix-965-vblank.patch, pulled from upstream + b3fc9a1585f390274fa26b3e3f80bc6d16f4388a which fixes missed vbl + interrupts on Intel i965 hardware. + + -- Kyle McMartin Wed, 3 Oct 2007 11:11:22 -0400 + +mesa (7.0.1-1ubuntu1) gutsy; urgency=low + + * Merge from debian unstable, remaining changes: + - Change maintainer to Ubuntu + - Add gcc-3.4 as a build dependency for lpia. + - Add support for Intel 945GME, G33, Q33, Q35 + + 200_945gme.patch, upstream a74eec5af5397b612d60dd4b0d81666027f19bb0, + ad6351a994fd14af9d07da4f06837a7f9b9d0de4 + + 201_g33.patch, upstream 8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 + - Comment out GLw libs from control file + - Dropped Ubuntu addition of conflicts of libgl1-mesa-glx against + libgl1-mesa-swx11, since Debian has hadded a shlibs file for + libgl1-mesa-swx11-i686 + + -- Bryce Harrington Wed, 15 Aug 2007 15:08:32 -0700 + +mesa (7.0.1-1) unstable; urgency=low + + * New upstream release. + * Upload to unstable. + + -- Julien Cristau Thu, 09 Aug 2007 11:56:16 +0200 + +mesa (7.0.1~rc2-1) experimental; urgency=low + + [ David Nusinow ] + * New upstream release candidate + * Bite the bullet and add myself to uploaders + + [ Julien Cristau ] + * Modify the short descriptions of various packages so they fit in .changes + files without being cut off. Thanks, Marc 'HE' Brockschmidt! + * Add a shlibs file for libgl1-mesa-swx11-i686. + + -- Julien Cristau Fri, 27 Jul 2007 20:17:48 +0200 + +mesa (7.0.0-0ubuntu3) gutsy; urgency=low + + * Add gcc-3.4 as a build dependency for lpia. + + -- Matthias Klose Tue, 07 Aug 2007 17:15:37 +0000 + +mesa (7.0.0-0ubuntu2) gutsy; urgency=low + + [ Kyle McMartin ] + * Add support for Intel 945GME, G33, Q33, Q35 + - 200_945gme.patch, upstream a74eec5af5397b612d60dd4b0d81666027f19bb0, + ad6351a994fd14af9d07da4f06837a7f9b9d0de4 + - 201_g33.patch, upstream 8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 + + -- Kyle McMartin Tue, 03 Jul 2007 19:32:39 +0000 + +mesa (7.0.0-0ubuntu1) gutsy; urgency=low + + [ Bryce Harrington ] + * New upstream release + - Adds OpenGL 2.0 and 2.1 API support. + - Fixed a few fog-related bugs. + - Fixed broken GLSL mix() function. + - Fixed broken GLSL exp() functions. + - Fixed GLSL mod4(vec4, vec4) bug. + - Implemented GLSL asin(), acos(), atan() functions. + - Fixed an R300 driver bug that caused Xorg composite manager to + crash + - Fixed R300 vertex program/matrix bug (fdo# 10848) + - GLSL dFdx() and dFdy() work for fragment program inputs now + (texcoords) + - Fixed potential crash when specifying an invalid texture unit as a + sampler + - Fixed incorrect GLX protocol request for glXDestroyPBuffer() + (fdo# 10983) + - ARB vp state.light[n].half value was incorrect (fdo# 10987) + - Fixed a positional light source bug (fdo# 11009) + - Fixed point size attenuation problem (fdo# 11042) + - Fixed problem where glPopAttrib didn't restore texture object's + LOD bias (fdo# 11049) + - Fixed a TLS / TEXTREL problem (fdo# 7459) + - Some texture code consolidation and simplifiction + - R300 driver clean-ups. + + [ Sarah Hobbs ] + * Added a conflicts of libgl1-mesa-glx against libgl1-mesa-swx11, and vice + versa + + -- Sarah Hobbs Tue, 26 Jun 2007 15:32:00 +1000 + +mesa (6.5.3-1ubuntu1) gutsy; urgency=low + + * Update Maintainer for Ubuntu + + [ Kyle McMartin ] + * Merge with Debian experimental: + - Remove lesstif-dev from Build-Depends (Timo Aaltonen) + - Comment out GLw libs from control file + - Add 102_ubuntu_no_glw.patch to remove lesstif build depends + - Add libxext-dev to Build-Depends (Paul Sladen) + - Add gcc-3.4 [i386 amd64] to Build-Depends (Ben Collins) + - Add 110_ubuntu_use_gcc-3.4_for_i965.patch (Timo Aaltonen) + - Add 101_ubuntu_hidden_glname.patch + - Add 112_fedora-hush-synthetic-visual-warning.patch (Adam Jackson) + + * Dropped patches: + - 103_ubuntu_fd.org-9686-fog.patch merged upstream + - 104_r300_call_radeonsetcliprects.patch merged upstream + - 105_radeon_call_radeonsetcliprects.patch merged upstream + - 106_r200_call_radeonsetcliprects.patch merged upstream + - 107_r200_simplify_r200setcliprects.patch merged upstream + - 111_unichrome_remove_xdrawoffset.patch merged upstream + + -- Kyle McMartin Fri, 25 May 2007 16:43:31 +0000 + +mesa (6.5.3-1) experimental; urgency=low + + [ David Nusinow ] + * New upstream release + + [ Julien Cristau ] + * Cherry-pick commit 65faf023679988f93da82b4c7ebdc689f2094459 by Michel + Dänzer to fix r300 crash. + + -- Julien Cristau Mon, 21 May 2007 11:34:51 +0200 + +mesa (6.5.3~rc3-1) experimental; urgency=low + + [ Brice Goglin ] + * Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both + static and shared libraries, creating libglw1-mesa and libglw1-mesa-dev + (closes: #374904). + + [ Julien Cristau ] + * New upstream release candidate. + + 06_fix_texture_data_corruption.patch, + 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch, + 08_r300_update_window_state_when_bound_but_stamp_changed.patch, + 09_i915_always_enable_pixel_fog.patch: remove, included upstream. + + 01_fix-makefile.patch, 02_use-ieee-fp-on-s390-and-m68k.patch: refresh. + * Add build-dependencies on libxdamage-dev and libxfixes-dev. + * Resync debian/scripts/install-source.sh. + * Build mesa-swx11-source only in binary-indep. + * Update from upstream git (commit + dee1b0d5bbe91f83854813cbbcd3090327bcb5c2). + + -- Julien Cristau Wed, 25 Apr 2007 10:36:50 +0200 + +mesa (6.5.2-7) unstable; urgency=low + + [ Brice Goglin ] + * libgl1-mesa-dev does not need to depend on libgl1-mesa-dri, + libgl1-mesa-glx is enough (since their split in 6.4.1-0.1); + closes: #432081. Thanks, Samuel Thibault! + + [ Julien Cristau ] + * libgl1-mesa-dev Depends on libgl1-mesa-glx (>= ${source:Upstream-Version}) + instead of >= ${Source-Version}. This way it's still installable on + architectures where mesa isn't built yet when a minor revision is + uploaded. + + -- Julien Cristau Wed, 11 Jul 2007 05:50:45 +0200 + +mesa (6.5.2-6) unstable; urgency=low + + * libgl1-mesa-swx11 needs to depend on libosmesa6 (>= 6.5.2-1) because + it used to contain libOSMesa.so.6. This means that programs linked + against this lib got a dependency on -swx11 which was broken since + 6.5.2-1. + * Fix build on hurd-i386 (build libgl1-mesa-glx without dri support and + don't build the dri drivers); closes: #420403. Thanks, Samuel Thibault! + + -- Julien Cristau Thu, 05 Jul 2007 00:56:35 +0200 + +mesa (6.5.2-5) unstable; urgency=low + + [ Brice Goglin ] + * Add 07_call_radeonSetCliprects_from_radeonMakeCurrent.patch + (closes: #420164). Thanks to Christian Ohm. + * Add 08_r300_update_window_state_when_bound_but_stamp_changed.patch + * Add 09_i915_always_enable_pixel_fog.patch + + -- Julien Cristau Fri, 18 May 2007 13:36:25 +0200 + +mesa (6.5.2-4) unstable; urgency=low + + [ Julien Cristau ] + * debian/control: libgl1-mesa-dri now suggests libglide3, with an + explanation in the description (closes: #387339). + * Upload to unstable. + + [ Brice Goglin ] + * Add 06_fix_texture_data_corruption.patch (closes: #412346). + + -- Julien Cristau Fri, 20 Apr 2007 05:57:35 +0200 + +mesa (6.5.2-3) experimental; urgency=low + + * Set LIB_DIR and EXTRA_LIB_PATH in configs/debian-default to override + settings in configs/linux-x86-64. This fixes a FTBFS on amd64, thanks to + Marc 'HE' Brockschmidt for the report (closes: #410118). + + -- Julien Cristau Wed, 7 Feb 2007 23:04:28 +0100 + +mesa (6.5.2-2) experimental; urgency=low + + * Sync Section/Priority for all packages with the override. + * Build the arch:all debs in binary-indep, and use the debhelper -s option + for commands in binary-arch, to fix FTBFS on non-i386 archs, thanks to + Marc 'HE' Brockschmidt (closes: #409638). + * Add myself to Uploaders. + + -- Julien Cristau Sun, 4 Feb 2007 21:14:02 +0100 + +mesa (6.5.2-1) experimental; urgency=low + + [ Thierry Reding ] + * New upstream release. + * Set the Debian X Strike Force as maintainer. + * Add myself to uploaders. + * Build the i915tex DRI module on the i386 and amd64 architectures. + * Add patch 04_cleanup-osmesa-configs that makes the OSMesa configurations + behave as expected. + * Add patch 05_static-nonpic to build static libraries without -fPIC. + * Make debugging symbol packages depend on the corresponding binary package + and put them into the libdevel section. + * Bump shlibs file for the libosmesa6 package to account for added symbols. + Thanks Julien Cristau. + * Build the DRI modules with the default optimization flags. Thanks Julien + Cristau. + * mesa-common-dev now ships the GLX header files so it needs to replace + libgl1-mesa-swx11-dev and libgl1-mesa-dev. Thanks Julien Cristau. + * All OSMesa libraries were moved to the libosmesa6 and libosmesa6-dev + package, so have them replace libgl1-mesa-swx11, libgl1-mesa-swx11-dev and + mesa-common-dev respectively. Thanks Julien Cristau. + + [ Julien Cristau ] + * Drop obsolete depends on xlibs. + + -- Thierry Reding Thu, 11 Jan 2007 15:06:52 +0100 + +mesa (6.5.2~rc3-0.1) experimental; urgency=low + + * Non-maintainer upload. + * Update to latest upstream release candidate. + + -- Thierry Reding Fri, 1 Dec 2006 01:06:28 +0100 + +mesa (6.5.2~rc2-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release candidate: + + Refresh 02_use-ieee-fp-on-s390-and-m68k.patch. + * Add manual pages for the glxdemo, glxgears, glxheads and glxinfo + utilities (Closes: #385463). + + -- Thierry Reding Wed, 22 Nov 2006 20:49:06 +0100 + +mesa (6.5.2~rc1-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release candidate. + * Update patches: + + Drop hunk #2 of 01_fix-makefile.patch, applied upstream. + + Drop 03_handle-sync-and-dont-unlock-display.patch, applied upstream. + * Bump build-dependency on libdrm-dev (>= 2.2.0). + * Use the new upstream minstall utility to install files and directories. + Using /usr/bin/install would result in a symlink's target being copied + instead of the symlink. + + -- Thierry Reding Sat, 18 Nov 2006 22:23:04 +0100 + +mesa (6.5.1-0.6) experimental; urgency=low + + * Non-maintainer upload. + * Rewrote the debian/rules file to make it easier to understand. + * Provide i686 optimized versions in libgl1-mesa-swx11-i686 instead of in + libgl1-mesa-swx11. + * Statically link libOSMesa with the software rasterization code from libGL + so that it works independently of the installed libGL. (Closes: #387706) + * Make libosmesa6-dev depend on mesa-common-dev because it only needs the + gl.h header file and no libGL anymore. + * Move glx*.h headers from libgl1-mesa(-swx11)-dev into mesa-common-dev + because both packages provide identical files. + * Add debugging symbol packages for libgl1-mesa-swx11, libgl1-mesa-glx and + libgl1-mesa-dri. + * Repack the contents of the three Mesa tarballs (MesaDemos, MesaGLUT and + MesaLib) as the original source tarball. (Closes: #392715) + * Make mesa-common-dev depend on libx11-dev. + * Provide a new package: mesa-utils. These utilities are shipped in the + MesaDemos package so mesa is the right package to provide them. + + -- Thierry Reding Sat, 18 Nov 2006 18:50:07 +0100 + +mesa (6.5.1-0.5) unstable; urgency=low + + * Non-maintainer upload. + * Build with -fno-strict-aliasing to fix misbuild of i965_dri.so + (closes: #394311). Thanks to Michel Dänzer for the fix, and to Ryan + Richter for the report and testing. + + -- Julien Cristau Wed, 3 Jan 2007 13:48:20 +0100 + +mesa (6.5.1-0.4) unstable; urgency=medium + + * Non-maintainer upload (and brown paper bag release). + * _Depend_ on libx11-dev from libgl1-mesa-dev; revert previous change. + Fixes FTBFS in other packages. (Really Closes: #396498) + + -- Steinar H. Gunderson Sat, 11 Nov 2006 13:55:20 +0100 + +mesa (6.5.1-0.3) unstable; urgency=medium + + * Non-maintainer upload. + * Build-depend on libx11-dev; fixes FTBFS. (Closes: #396498) + + -- Steinar H. Gunderson Wed, 8 Nov 2006 20:58:40 +0100 + +mesa (6.5.1-0.2) unstable; urgency=low + + * Non-maintainer upload + * Disable generation of SSE instructions (closes: #390560) + * Remove duplicate and unused build configurations + * Remove extra source files left from CVS snapshots (closes: #389283) + * Enable i965 DRI driver on i386 and amd64. Thanks to Ryan Richter + for the patch. (closes: #392030) + * Enable Unichrome DRI driver on amd64 (closes: #391900) + * Enable FFB DRI driver on sparc, not i386 (closes: #388025) + * Consistently compile C sources as C99 (closes: #373623) + * Fix X display locking error in GLX. Thanks to Josh Triplett for + the patch. (closes: #391681) + + -- Ben Hutchings Fri, 13 Oct 2006 02:25:52 +0100 + +mesa (6.5.1-0.1) unstable; urgency=low + + * New upstream version + * Build-dep on x11proto-gl-dev >= 1.4.8 + * Stuff not in the upstream tarballs + + os2 glut stuff + + docs/gears.png + * Bump libdrm-dev build-dep to >= 2.0.2 + * Add libdrm cflags to the debian-dri config. This allows the build system + to find drm.h + * Make sure that libGl looks for the dri drivers in the proper location. Do + this by setting the appropriate variables in the debian config + * Re-add s390 and m68k to the USE_IEEE test in src/mesa/main/imports.h. This + package seriously needs to store patches somewhere that are easy to find + and re-apply. + * Add patch from Cyril Brulebois to allow package to build on HURD, which + lacks DRI and directfb. This includes not using lib-directfb in the + build-depends for hurd-i386. It also creates a new debian config, + debian-indirect, which is used when building for HURD. This config is + invoked in the debian-dri config on hurd-i386. Thanks to Cyril Brulebois + for the patch, Michael Banck, Michel Dänzer, and Samuel Thibault for + input on an appropriate fix. (closes: #358065) + + -- David Nusinow Mon, 25 Sep 2006 21:21:47 -0400 + +mesa (6.5.0.cvs.20060524-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Upload mesa 6.5 cvs to unstable, because we need it for Xorg 7.1. + * Upload with medium urgency instead of high, since this is a new + upstream that should get some testing in unstable in spite of the + multiple RC bugfixes. + * Update debian/copyright with the full text of the SGI Free B and SGI + MIT-style licenses in use in the package, and take a stab at + cleaning up the list of paths and licenses. + Closes: #368562. + * Make mesa-common-dev Replaces: xlibosmesa-dev from sarge. + Closes: #384057. + * Fix libgl1-mesa-glx to not Provides: libgl1-mesa-dri, since it + definitely doesn't provide DRI support and this Provides: breaks + upgrades from sarge. Closes: #384282. + * debian/libgl1-mesa-swx11.shlibs: create a static shlibs file, + because libOSMesa.so.6 is not provided by all implementations of + libGL and so needs a separate shlibs declaration. Also make + libgl1-mesa-glx the default alternative instead of libgl1-mesa-swx11 + for consistency even when building against libgl1-mesa-swx11, + because to the extent these are interchangeable (i.e., 99%...), + there should be no reason to prefer one over the other -- and to the + extent that they aren't interchangeable, it's wrong to list libgl1 + as an alternative dependency at all. Closes: #386185. + * Don't provide shlibs at all for libgl1-mesa-swx11-dbg; this is an + unnecessary duplication of the existing libgl1-mesa-swx11 shlibs + since packages should not really be linking against /usr/lib/debug/ + separately. + * src/mesa/tnl/t_vb_render.c: Drop a pointless printf() in the + RENDER_LINE macro, getting rid of copious debug output on console. + Closes: #369895. + * libgl1-mesa-swx11 has no reason to depend on libglu, anything that + wants libglu will have its own dependency on it; drop this + hard-coded dependency from debian/control. + * Have libglu1-mesa-dev Provides: xlibmesa-glu-dev, since it's the + successor to that package and xlibmesa-glu-dev is still referenced + in a number of places and this makes for more reliable builds than + depending on alternatives without requiring another dummy -dev + package from xorg. + * Replace references to Source-Version in debian/control with either + binary:Version or source:Version, depending on whether the + relationship references an arch: any or arch: all package, making + mesa binNMU-safe; add build-depends on dpkg-dev (>= 1.13.19) to + ensure these substvars are available. + + -- Steve Langasek Fri, 15 Sep 2006 15:51:16 -0700 + +mesa (6.5.0.cvs.20060524-1) experimental; urgency=low + + * The "-O666 -fwater-c00ling -DBE_F4ST" release + * New pull from CVS + * Merge back and forth with 6.4.2-1 + * configs/debian*_i386: disabled, optimized build fuxxored. + + -- Marcelo E. Magallon Wed, 24 May 2006 14:12:13 -0600 + +mesa (6.5.0.cvs.20060512-0.0.1) experimental; urgency=low + + * New upstream release (6.5.0) + * Pulled CVS as of 2006-05-12 + * debian/control: remove DirectFB packages + + -- Marcelo E. Magallon Fri, 12 May 2006 15:23:49 -0600 + +mesa (6.4.2-1) unstable; urgency=low + + * The "please, please, please don't hate me" release. + * New upstream release. + * Ack NMUs + * debian/control: mesa-common-dev Replaces xlibmesa-gl-dev (<< 1:7) + AGAINST MY BETTER JUDGEMENT. The problem here is gratuitous package + renames within a system that does not support them. (closes: + bug#362063) + * debian/control: hurd-i386 doesn't have drm. Doesn't fix #358065, + yet. + * bin/mklib: fix from Robert Millan to support hurd-i386 and + GNU/kFreeBSD. Thanks Robert. (closes: bug#358066) + * src/glx/x11/indirect_vertex_array.c, src/mesa/main/glheader.h, + src/mesa/drivers/dri/common/glcontextmodes.c: fix broken indirect + rendering on 64-bit platforms. Thanks Aaron M. Ucko. (closes: + bug#364228) + * debian/control: b-d on x11proto-gl-dev. Please don't hate me! + * debian/control: Standards-Version: 3.7.2 + * debian/rules: export DEB_HOST_ARCH + * configs/debian-dri: use DEB_HOST_ARCH to decide if certain DRI drivers + should be built or not. + + Built only for i386: i810 i830 sis. + Rationale: integrated chipsets available only for i386 processors. + + Built only for i386: ffb. + Rationale: Michel Dänzer said so, no idea why. + + Built only for i386, amd64: i915. + Rationale: Apparently this is available in the 64-bit Intel chipset. + Please file a bug report stating which drivers should be included/excluded + for which architectures. Positive lists are preferred. If possible state + why. + * debian/mesa-swx11-source.install: nuke this abomination. Dinamically + generate the list at build time. + * debian/drivers.map: add gl-debian-dri_i386 + * debian/README.build: updated, add big friendly letters in short sentences. + Perhaps I can read it myself this way... + * debian/rules, configs/debian, configs/debian-dri, configs/debian_i386, + configs/debian-dri_i386, debian/libdir.map, debian/drivers.map: hack in + support for variable driver's dir. If you want this for your pet + architecture please provide BOTH configs/debian_arch and + configs/debian-dri_arch. If you just want to include/exclude DRI drivers + on your architecture look in configs/debian-dri. + * configs/debian*_i386: disabled, optimized build fuxxored. + * debian/rules: remove misguided Perl construct, replace by something + simpler in shell. I actually meant to do something else with the Perl + thing, but got distracted and forgot about it. Thanks Aaron M. Ucko! + * debian/rules: make it work like debian/README.build says it works wrt to + building optimized targets. + + -- Marcelo E. Magallon Tue, 16 May 2006 18:07:53 -0600 + +mesa (6.4.1-0.4) unstable; urgency=low + + * NMU + * Add versioned conflict between libgl1-mesa-dri and xlibmesa-dri so that + the xlibmesa-dri transitional upgrade package works + + -- David Nusinow Mon, 6 Mar 2006 21:46:18 -0500 + +mesa (6.4.1-0.3) unstable; urgency=low + + * NMU + * Add s390 and m68k to the USE_IEEE test in src/mesa/main/imports.h. + (closes: #349437) + + -- David Nusinow Sat, 11 Feb 2006 17:59:26 -0500 + +mesa (6.4.1-0.2) unstable; urgency=low + + * NMU + * Re-add dh_installdirs call to binary-indep target so that we get + arch-specific dirs for the mesa-swx11-source package + * Remove makedepend from build-depends. Now we'll just build-dep on xutils + to get the app, which will translate over to our own xorg 7.0 plans. + + -- David Nusinow Tue, 31 Jan 2006 19:21:12 -0500 + +mesa (6.4.1-0.1) unstable; urgency=low + + [ Marcelo E. Magallon ] + * debian/control: build-depend on xutils + * include/GL/glx{int,proto,md,tokens}.h: missing upstream (closes: bug#326466) + * debian/libgl1-mesa-dri-dev.install: install GLX include files here, too. + * debian/rules: GLU and GLW don't have arch-specific targets. + + [ Daniel Stone ] + * New upstream version, incorporating changes from Ubuntu 6.3 packaging. + * Rename packages: + - mesag3 -> libgl1-mesa-swrast + - mesag-dev -> libgl1-mesa-swrast-dev + - libgl1-mesa-dri -> libgl1-mesa + - libgl1-mesa-dri-dev -> libgl1-mesa-dev + - libgl1-mesa-dri still exists, but now contains the DRI modules only. + * Drop dependency *from* mesa-common-dev on libgl1-mesa-dev and + libglu1-mesa-dev; it should be the other way around. (closes: #336565) + * Add Build-Depends on pkg-config to get flags from libdrm, and libexpat-dev + for DRI configuration. Break out xlibs-dev Build-Depends to the + individual libraries required. + * Bump libdrm-dev Build-Depends to >> 1.0.5, in order to get new + via_drm.h to build the unichrome DRI driver. + * Configs: pare DRI drivers down to a sensible set for each architecture. + * Remove completely broken Glide target, which caused FTBFS. + * Add mesa-swrast-source package, providing the source for the software + rasteriser for libGLcore in the X server. + * Drop tight libosmesa6 -> libgl1-mesa-swrast Depends, replace with + shlibs:Depends. + + [ David Nusinow ] + * New upstream version (6.4.1) (closes: #232665) + * Merge changes from Ubuntu version 6.4.1-0ubuntu1. + (closes: #341479, #340168, #334742) + + Add new files required by xorg-server GL build to mesa-swrast-source. + * NMU to begin getting Xorg 7.0 in to Debian + * Change libgl1-mesa-swrast Depends on libx11-6-dev to libx11-dev. + * Change libgl1-mesa-swrast to be named libgl1-mesa-swx11 + * Change libgl1-mesa to be named libgl1-mesa-glx + * mesa-swrast-src.install stop looking for the swx11 dir and look for swrast + + -- David Nusinow Sat, 21 Jan 2006 21:43:37 -0500 + +mesa (6.3.2-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Adjust Build-Depends: + + xlibs transition (Closes: #347129). + + xutils, xlibmesa-gl-dev (Closes: #326466). + * mesag-dev: Depends: libx11-dev (Closes: #347205). + + -- Christoph Berg Fri, 20 Jan 2006 20:45:43 +0100 + +mesa (6.3.2-2) unstable; urgency=low + + * debian/rules: build only whatever needs to be build according to + debian/control. + * debian/libdir.map: it's usr/lib/debug not usr/lib/dbg + * debian/rules: select optimized targets for the current host architecture + only (thanks Michel!) + * debian/README.build: reword some of the directions, add more info. + * debian/control: forgot to add CPR relationships in the new packages + (thanks Michel!) + * debian/control: Set maintainer to pkg-mesa-devel, add myself as uploader + + -- Marcelo E. Magallon Sun, 28 Aug 2005 14:41:15 -0600 + +mesa (6.3.2-1) unstable; urgency=low + + * New upstream + * configs/debian-dri: new target + * debian/control: add build-depends on libdrm-dev + * debian/rules: pass SRC_DIRS instead of SUBDIRS on the command line. + This allows for configurations to override the command line in a + sane way. + * configs/debian-dri: override SRC_DIRS + * configs/debian: add -D_GNU_SOURCE (required by dri drivers) + * debian/control, debian/rules: drop glide out of this package, it + will be moved to the mesa-legacy package, forked from 6.2.1-7. + * debian/drivers.map, debian/rules: take into account that some + drivers have external components. + + To be fixed: debian/drivers.map hardcodes locations + * debian/control: libgl1-mesa-dri, libgl1-mesa-directfb: new drivers + * dh_makeshlibs for libgl1-mesa-dri and libgl1-mesa-directfb + * debian/control: priority is optional... again... + + -- Marcelo E. Magallon Sun, 21 Aug 2005 17:13:19 -0600 + +mesa (6.2.1-7) unstable; urgency=low + + * Previous upload got lost somewhere + + bin/mklib: add GNU/kFreeBSD, patch from Aurelien Jarno (closes: + bug#307154) + + recompile with newer g++ + + -- Marcelo E. Magallon Tue, 02 Aug 2005 06:47:20 -0600 + +mesa (6.2.1-6) unstable; urgency=low + + * bin/mklib: add GNU/kFreeBSD, patch from Aurelien Jarno (closes: + bug#307154) + * recompile with newer g++ + + -- Marcelo E. Magallon Sun, 24 Jul 2005 11:47:16 -0600 + +mesa (6.2.1-5) unstable; urgency=low + + * debian/rules: big mess up, files are not being moved to their proper + places. I naively assumed that command-line options to debhelper + commands would override DH_OPTIONS, that is, that having + DH_OPTIONS=-i (as suggested in the documentation) would mean + something like "use -i unless -p is passed on the command line". It + actually means "use -i in addition to -p passed on the command + line", which does not make any sense, but is consistent with the + wording in the documentation. (closes: bug#306499, bug#306918, + bug#307095) + + -- Marcelo E. Magallon Sun, 01 May 2005 09:45:12 -0600 + +mesa (6.2.1-4) unstable; urgency=low + + * debian/control: fix description to reflect the exact content and + purpose of package (libosmesa-dev, mesag-dev). + * debian/rules: DH_OPTIONS=-s added to binary-arch target. (closes: + bug#306091) + + -- Marcelo E. Magallon Sat, 26 Mar 2005 08:03:44 -0600 + +mesa (6.2.1-3) unstable; urgency=low + + * debian/control: try to match the override file. If mesa is "extra" + (for whatever reason), all the packages should be extra. + * debian/rules: quick workaround for left-over libGL.so in GLU -dev + package. + + -- Marcelo E. Magallon Thu, 24 Mar 2005 19:35:34 -0600 + +mesa (6.2.1-2) unstable; urgency=low + + * The "thank you so much, I'm still voting against you" release. + * debian/rules: correct artifact of me not having had a proper + pbuilder environment to build stuff on and the repackaging from the + previous release. The -glu- and -glw- targets now explicitly depend + on the matching -gl- target, and symlinks are placed in the build + directories in order to actually have a libGL.so to make ld happy + when creating the libraries. + * debian/rules: uncomment dh_install :-\ There was a reason why I had + commented that out... + * First change closes: bug#298922 + * Second change closes: bug#300302, bug#300284, bug#300430 + * debian/control: "An X", whatever, I've been corrected multiple times + in both ways (translators beware). (closes: bug#300012) + + -- Marcelo E. Magallon Sun, 20 Mar 2005 22:03:29 -0600 + +mesa (6.2.1-1) unstable; urgency=low + + * The "autobuilders, please please please don't hate me" release. + * New upstream. + * Repackage: + + Fall prey to debhelper + + Entries below this one preserved for historical reasons or + sentimental value, pick as many as you want. They bear NO + relation to the actual packages! + * configs/debian, configs/debian-debug, configs/debian-debug-i386, + configs/debian-glide, configs/debian-glide-i386, configs/debian-i386, + configs/debian-osmesa16, configs/debian-osmesa16-static, + configs/debian-osmesa32, configs/debian-osmesa32-static, + configs/debian-static, configs/debian-static-i386: new files. + * configs/debian-sparc: Dave Miller confirmed that the sparc assembly + files do work on Linux. I don't know where to install the optimized + libraries, so the file doesn't actually exist. Please read + debian/README.build if you want to have a sparc-optimized library. + * debian/control: GGI and glide2 are gone. glide is glide3. + * debian/rules: modify shlibs file for the glide3 target to require glide3 + and only glide3 because that library exports functions not available in + other libGLs. Rationale: if someone is compiling a Debian package and + uses the glide target either he doesn't know what he is doing or he knows + exactly what he is doing. In the first case the package should not be + installable and in the second case the package requires this particular + version. + * debian/control: libgl1-mesa-glide3-dev does NOT provide a proper OpenGL + development environment (see above). + * PCR is bound to be wrong... *sigh* + + -- Marcelo E. Magallon Sat, 25 Dec 2004 14:50:02 -0600 + +mesa (6.0.1-1) unstable; urgency=low + + * New upstream release. + * debian/rules: redid a bunch of stuff in order to support new build system + without autoconf and automake stuff. The next version is going to change + this _again_. + + -- Marcelo E. Magallon Sun, 11 Apr 2004 07:00:19 -0600 + +mesa (5.0.0-5.1) unstable; urgency=low + + * Non-Maintainer Upload. + * Rename "GGIMesa"-references in src/GGI/default/Makefile.am to + "MesaGGI", which makes the package build again with newer libtool. + (Closes: #213836) + + -- Steinar H. Gunderson Sun, 15 Feb 2004 17:37:08 +0100 + +mesa (5.0.0-5) unstable; urgency=low + + * debian/control: yank and put error? Remove hard-coded + nvidia-glx-dev from mesag-glide2-dev dependencies. + + -- Marcelo E. Magallon Sun, 09 Feb 2003 10:31:51 +0100 + +mesa (5.0.0-4) unstable; urgency=low + + * debian/rules: fix typo in definition of GLIDE_ARCHS. (closes: bug#179622) + + -- Marcelo E. Magallon Mon, 03 Feb 2003 20:19:12 +0100 + +mesa (5.0.0-3) unstable; urgency=low + + * The "it's amazing how people pick severities" release + * debian/control: mesa-common-dev conflicts with xlibmesa-dev. Actually put + dependency of mesa-common-dev on the mesa-*-dev packages to avoid having + to track other libgl-dev packages popping up. IMO this is less error + prone. You can't install mesa-common-dev without installing mesa-*-dev, + and those packages conflict with other libgl-dev packages. (closes: + bug#177996) + * Rename libglu1c102 to libglu1-mesa; the libglu1c102 is incorrent since + this library does not export C++ functions. Sorry about the mess. + * Rename libglu1-dev to libglu1-mesa-dev to be consistent + * debian/rules: use grep-dctrl to extract architectures from debian/control + * debian/control: add grep-dctrl to build-depends + * debian/shlibs.libglu: libglu1-mesa | libglu1 + * debian/rules: install include/GL/xmesa.h in /usr/include/GL/xmesa.h; I'm + not 100% sure this is the right thing to do, but it's a niche so I don't + think it will actually make trouble (closes: bug#148866) + * debian/rules: install include/GL/glx*.h in the common package. (closes: + bug#178562) + * debian/rules: nasty hack to work arround libtool's idea of how libraries + should be linked (closes: bug#178514) + * debian/rules: even nastier hack. Getting environment variables to + percolate thru all the make calls isn't getting anywhere. + * si-glu/Makefile.am: export only glu.* symbols + * si-glu/Makefile.am: add -lm to link line + * src/Makefile.am: god damm it. If you use libm link to it! + * debian/control: mesa-common-dev depends on libglu1-mesa-dev to satisfy + libgl-dev's requirements + + -- Marcelo E. Magallon Mon, 27 Jan 2003 17:15:25 +0100 + +mesa (5.0.0-2) unstable; urgency=low + + * debian/control: Not funny, I'm sure I put lesstif and xlibs-dev in the + build-depends. CVS says I didn't. (closes: bug#176730) + * debian/control, debian/rules: regenerate auto-stuff (closes: bug#176729) + * debian/control, debian/rules: GCC C++ 3.2 transition (libglu1c102 -- ugly!) + * remove Makefile.in from CVS control + * si-glu/libnurbs/interface/Makefile.am: fix INCLUDES macro + + -- Marcelo E. Magallon Sun, 19 Jan 2003 00:48:32 +0100 + +mesa (5.0.0-1) unstable; urgency=low + + * New upstream release, it looks like glide and GGI are in working + condition again. + * FX patches from previous releases gone. They'll be back later. + * debian/rules: some clean ups. + * debian/control: add libglu1 packages + * debian/control: Standards-Version: 3.5.8 + * debian/rules: Build Xt widgets (if you need this stuff, you need to depend + on mesag-dev, libgl-dev is not enough) + * debian/control, debian/rules: add mesa-common-dev package + * debian/control, debian/rules: add osmesa packages. + + -- Marcelo E. Magallon Sun, 15 Dec 2002 12:28:49 +0100 + +mesa (4.0.3-1) unstable; urgency=low + + * New (and long delayed) upstream version + * Redid a bunch of FX patches, probably broke. + + -- Marcelo E. Magallon Thu, 03 Oct 2002 11:27:29 +0200 + +mesa (3.5-1) unstable; urgency=low + + * New upstream version. + * Redid patches. + * Disabled building GGI target. Someone with a good understanding of GGI + needs to write a driver for mesa. The old version doesn't cut it + anymore. + * Most makefiles won't work. Copied them out of CVS. + * src/Makefile.am: add -lm to library list. (closes: bug#102717) + * configure.in: adjust GLU's version info to match previous release. + + -- Marcelo E. Magallon Mon, 25 Jun 2001 22:13:40 +0200 + +mesa3 (3.4.2.1-4) unstable; urgency=low + + * So, here's the deal: the 3Dfx backend is going nowhere in 4.x and 5.x is + just arround the corner. Same thing for the GGI stuff. In order to leave + the people who need this stuff with _something_ to work with, I'll compile + those targets out of the mesa3 source package and the mesa package will + stuck to plain old X. + * debian/control, debian/rules: strip out all the parts concerning to mesa3g + and mesa3g-dev + * debian/control: update GGI architectures, let's see what happens + * debian/rules: special case alpha for stripping options. Chris, did you + ever figure out what the problem actually is? (closes: bug#99284) + * debian/rules: hereby I decree that everything in etc is a conffile. Die + future bugs, die!. + * configure: fix ggi_libdir, ggi_confdir (closes: bug#139598) + + -- Marcelo E. Magallon Sun, 29 Sep 2002 11:21:00 +0200 + +mesa (3.4.2.1-3) unstable; urgency=low + + * Actually install widgets on the mesag-dev package (closes: bug#98988) + + -- Marcelo E. Magallon Sat, 9 Jun 2001 16:39:36 +0200 + +mesa (3.4.2.1-2) unstable; urgency=low + + * src/X/xmesa1.c: I knew it, I knew it. This was bound to break. Stupid + typo. Restored MESA_GLX_FX (got renamed to GLX_FX accidentally, if you + have to know) (closes: bug#94114) + + -- Marcelo E. Magallon Mon, 21 May 2001 08:52:07 +0200 + +mesa (3.4.2.1-1) unstable; urgency=low + + * Upstream released 3.4.2. + * Hmmm... thought about it on my way home. The code to parse 3dfx.conf + is wrong. Redid. Still not tested. (closes: bug#94114) + * debian/README.Debian: document 3dfx.conf + + -- Marcelo E. Magallon Sat, 19 May 2001 11:57:33 +0200 + +mesa (3.4.2-1) unstable; urgency=low + + * New upstream version. + * debian/config.guess, debian/config.sub: newest versions from + http://subversions.gnu.org/cgi-bin/cvsweb/config (closes: bug#95338) + * GAAAAAAARGGH! src/X/xmesa1.c: horrible hack to use /etc/mesa/3dfx.conf + if there's no MESA_GLX_FX environment variable defined. I. Hate. + This. I'll make a deal with you: you find another of these things, + and you send me a nice tested patch. I don't have a 3DFX card and I + *HATE* uploading stuff I can't fully test. (closes: bug#94114) + * debian/rules: use the new files + * debian/rules: s/TMPDIR/DTEMPDIR/g + * gl3DfxSetDitherModeEXT from Zephaniah (closes: bug#65860) + * Disable GL_EXT_shared_texture_palette per default. Patch looks funny, + but I'll blindly trust Zephaniah. + * Hmmm... I hope Zephaniah tested this, because it broke in a rather silly + way at compile time. + * Fancy what people regard as "pretty important". + + -- Marcelo E. Magallon Fri, 18 May 2001 09:23:49 +0200 + +mesa (3.4.1-3) unstable; urgency=low + + * PLEASE SUBMIT NMUs TO THE BTS, DAMN IT! + * debian/control: exclude m68k from libggi2-dev build-dependency. + + -- Marcelo E. Magallon Sat, 17 Mar 2001 19:45:09 +0100 + +mesa (3.4.1-2) unstable; urgency=low + + * debian/control: add missing dependency on xlibs-dev and corrected the + one for libglide2-dev + + -- Marcelo E. Magallon Wed, 14 Mar 2001 00:21:42 +0100 + +mesa (3.4.1-1) unstable; urgency=low + + * New upstream version. + * New maintainer. (closes: bug#81139) + * Some fixes to get it to compile. + * debian/rules: some reorganization happened to allow me test different + builds better. + * debian/control: nuked widgets package, if you miss it, you are doing + something wrong. + * debian/rules: -dev packages will be missing some garbage they used to + install. If you miss any of those files, I'm fairly confident you + are doing something wrong. + * configure, ltmain.sh, aclocal.m4, acinclude.m4, ...: vicious hacks to + allow the GGI version to compile. + * TODO: add the widgets to the packages + * TODO: make OSmesa packages + + -- Marcelo E. Magallon Sat, 10 Feb 2001 18:34:13 +0100 + +mesa (3.2.1-1) unstable; urgency=low + + * New upstream version. + + -- James A. Treacy Mon, 31 Jul 2000 15:13:34 -0400 + +mesa (3.2-2) frozen unstable; urgency=low + + * add MMX and 3Dnow opts for x86. + + -- James A. Treacy Fri, 7 Jul 2000 16:06:43 -0400 + +mesa (3.2-1) frozen unstable; urgency=low + + * New upstream version. + * Made minor changes to README.3DFX. Closes bug#56827 + * Added symlinks for mesa widget libraries. Closes bug#63115 + + -- James A. Treacy Wed, 28 Jun 2000 11:21:09 -0400 + +mesa (3.1-17) frozen unstable; urgency=low + + * Fixed Makefile for demos in mesag-widgets-dev. Closes bug#62674 + + -- James A. Treacy Fri, 19 May 2000 13:23:00 -0400 + +mesa (3.1-16) frozen unstable; urgency=low + + * Add --prefix=/usr to ggi build. Closes bug#61705, #61486 + + -- James A. Treacy Wed, 12 Apr 2000 15:12:48 -0400 + +mesa (3.1-15) frozen unstable; urgency=low + + * Remove ggi from the build on m68k. Closes bug#59273 + + -- James A. Treacy Mon, 6 Mar 2000 13:20:29 -0500 + +mesa (3.1-14) frozen unstable; urgency=low + + * Fixed hard-coded location of config file in library. This is release + critical, even though no bug was filed (relates to bug#58267). + + -- James A. Treacy Mon, 28 Feb 2000 10:58:34 -0500 + +mesa (3.1-13) frozen unstable; urgency=low + + * Add missing ggi libraries. Closes bug#58267, #57760 + + -- James A. Treacy Thu, 24 Feb 2000 00:59:30 -0500 + +mesa (3.1-12) frozen unstable; urgency=low + + * Dependencies are now computed in a more intelligent way. Closes: bug#55861 + + -- James A. Treacy Fri, 21 Jan 2000 16:26:40 -0500 + +mesa (3.1-11) frozen unstable; urgency=low + + * Remove svgalib support from the software only package of mesa + + -- James A. Treacy Sat, 22 Jan 2000 05:33:13 +0000 + +mesa (3.1-10) frozen unstable; urgency=low + + * Fix the mesag3-glide2 postinst. Closes bug#55462 + + -- James A. Treacy Sat, 22 Jan 2000 02:06:27 +0000 + +mesa (3.1-9) frozen unstable; urgency=low + + * The ggi based packages are now built with the other versions of mesa. Closes: bug#49218, #55221 + + -- James A. Treacy Sat, 15 Jan 2000 22:24:13 -0500 + +mesa (3.1-8) unstable; urgency=low + + * fixed the postinst and prerm for the glide packages + * added Provides: mesag-dev to the mesag-glide2-dev package to maintain + backwards compatability + + -- James A. Treacy Sat, 15 Jan 2000 01:01:58 -0500 + +mesa (3.1-7) unstable; urgency=low + + * Fix version number for soname in the shlib file. Closes: bug#54926 + + -- James A. Treacy Thu, 13 Jan 2000 01:37:03 -0500 + +mesa (3.1-6) unstable; urgency=low + + * Include docs/README.3DFX in mesag3-glide2 package. Closes: bug#54625 + * Remove Provides: libgl1 from mesag3-widgets. Closes: bug#54774 + * conflicts with older versions of mesa. Closes: bug#54831 + + -- James A. Treacy Mon, 10 Jan 2000 11:50:49 -0500 + +mesa (3.1-5) unstable; urgency=low + + * now Conflicts: libgl1 + * remove extra '.' in library name + + -- James A. Treacy Sun, 9 Jan 2000 20:47:31 -0500 + +mesa (3.1-4) unstable; urgency=low + + * Added links libGL.so.1 <- libMesaGL.so.3 so existing progs don't break + * Copyright changed for version 3.1 + + -- James A. Treacy Thu, 6 Jan 2000 17:11:11 -0500 + +mesa (3.1-3) unstable; urgency=low + + * copyright file now refers to /usr/share/common-license/LGPL. + + -- James A. Treacy Tue, 4 Jan 2000 11:50:45 -0500 + +mesa (3.1-2) unstable; urgency=low + + * Second try. Fixed shlibs file. + + -- James A. Treacy Tue, 4 Jan 2000 00:00:29 -0500 + +mesa (3.1-1) unstable; urgency=low + + * New upstream version. + * glide version of packages added, since glide is now under the GPL. + * mesa widget libraries are now in a separate package + * library names are changed to lib{GL,GLU}.* + + -- James A. Treacy Tue, 14 Dec 1999 10:06:14 -0500 + +mesa (3.0-2) unstable; urgency=low + + * added symlinks from libMesaGL* -> libGL*. Fixes bug #37160 + * added lines (commented out) for building a glide version of mesa. Fixes bug #39758 + + -- James A. Treacy Thu, 13 May 1999 01:02:42 -0400 + +mesa (3.0-1) unstable; urgency=low + + * mesa libs moved to /usr/lib. Fixes bug #26874 + * motif widget library libMesaGLwM added (compiled using headers from lesstif). Fixes bug #25380 + + -- James A. Treacy Thu, 6 Aug 1998 13:49:37 -0400 + +mesa (2.6-4) unstable; urgency=low + + * call to ldconfig in postinst put back in. Fixes bug #20552 + * changelog.Debian file created for the mesa-doc package. + * deleted miscellaneous files. Fixes bug #21481 + + -- James A. Treacy Sat, 23 May 1998 23:41:34 -0400 + +mesa (2.6-3) frozen unstable; urgency=low + + * No changes. Just trying (again) to get this back in the distribution + + -- James A. Treacy Tue, 24 Mar 1998 00:53:09 -0500 + +mesa (2.6-2) unstable frozen; urgency=low + + * point copyright to LPGL in /usr/doc/copyright. Fixes bug #19633 + + -- James A. Treacy Sun, 15 Mar 1998 14:00:33 -0500 + +mesa (2.6-1) unstable; urgency=low + + * New upstream Release + * strip static lib with --strip-debug and shared with strip--unneeded: Fixes bug#17301 + * create doc package in build-indep: Fixes bug#16090 + * added widgets-mesa library to package: Fixes bug#15729 + * created mesa-glide* packages + + -- James A. Treacy Mon, 19 Jan 1998 23:45:50 -0500 + +mesa (2.5-2) unstable; urgency=low + + * Corrected i386 specific debian/rules file: Fixes bug#15640 + + -- James A. Treacy Fri, 5 Nov 1997 11:46:13 -0500 + +mesa (2.5-1) unstable; urgency=low + + * New upstream release. + + -- James A. Treacy Sun, 23 Nov 1997 20:46:13 -0500 + +mesa (2.4-1) unstable; urgency=low + + * New upstream release. + * New maintainer. + * libc6 release. + + -- James A. Treacy Mon, 3 Nov 1997 01:11:34 -0500 + +mesa (2.2-2) unstable; urgency=low + + * debian/control: mesa-doc no longer depends on mesa (bug #8840). + + -- Karl Sackett Wed, 30 Apr 1997 10:25:25 -0500 + +mesa (2.2-1) unstable; urgency=low + + * New upstream release. + * Make-config: linux-elf libraries compiled with -D_REENTRANT. + + -- Karl Sackett Wed, 19 Mar 1997 09:10:22 -0600 + +mesa (2.1-4) unstable; urgency=low + + * debian/control: lib packages moved from 'graphics' to 'libs'. + * debian/rules: headers moved from /usr/include/mesa to /usr/include + (no more -I/usr/include/mesa). + + -- Karl Sackett Tue, 25 Feb 1997 09:30:23 -0600 + +mesa (2.1-3) unstable; urgency=low + + * debian/control: mesa2 provides mesa and conflicts with mesa + (bug #7394). + + -- Karl Sackett Mon, 17 Feb 1997 09:25:42 -0600 + +mesa (2.1-2) unstable; urgency=low + + * debian/rules: install gmesa.h, osmesa.h, FooMesa.h in mesa-dev + (bug #6864). + + -- Karl Sackett Tue, 28 Jan 1997 09:37:41 -0600 + +mesa (2.1-1) unstable; urgency=low + + * New upstream release. + * Added soname to mesa and mesa-widgets. + * Moved static libraries to mesa2-dbg. + * debian/postinst, postinst-widgets: call ldconfig without explicit + pathname (bugs #6176, 6180). + + -- Karl Sackett Mon, 6 Jan 1997 09:30:10 -0600 + +mesa (2.0-2) unstable; urgency=low + + * Created mesa-widgets and mesa-widgets-dev (Bug #5029). + + -- Karl Sackett Wed, 30 Oct 1996 08:44:19 -0600 + +mesa (2.0-1) unstable; urgency=low + + * src/draw.c: replaced with upstream patch. + * Make-config: linux-elf target builds libMesaGLw.so library, looks + for XLIBS in /usr/X11R6/lib, removed -mieee-mp from CFLAGS. + * widgets-sgi/Makefile: builds libMesaGlw.a library + * New upstream release. + * Converted to new package standard. + * Maintainer address changed. + + -- Karl Sackett Mon, 14 Oct 1996 15:37:19 -0500 + +1.2.8-3 + * Package split into runtime, development, and documentation + packages. + * widgets now made as a sharable library. + * GLUT removed. This will be released as a separate package. + +1.2.8-2 + * Support files now architecture-independent + +1.2.8-1 + * Upgrade to latest release + * Brought support files up to latest packaging requirements + * mondello/Makefile: fixed error in realclean target + +1.2.7-2 + * debian.rules: clean all Makefiles out of widgets directory + * debian.postrm: remove /usr/lib/mesa entry from /etc/ld.so.config + (bug #2817) + +1.2.7-1 + * Added Debian support files + * Included the GLUT OpenGL Utility Toolkit + * Makefile - disable building programs in demos, samples, and book + directories + * mklib.linux - disabled building *.a libraries + * widgets/Makefile.in - disabled building demo programs --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx.install @@ -0,0 +1 @@ +dri/usr/lib/libGL.so.* usr/lib/mesa --- mesa-7.9~git20100924.orig/debian/libglw1-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libglw1-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGLw1 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11.shlibs +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-7.9~git20100924.orig/debian/copyright +++ mesa-7.9~git20100924/debian/copyright @@ -0,0 +1,196 @@ +This package was debianized by James A. Treacy treacy@debian.org on Thu, +6 Jan 2000 01:11:34 -0500. It was newly debianized by Marcelo E. +Magallon on Sat, 25 Dec 2004 14:50:02 -0600. It was +again debianized by Thierry Reding on Sat, 14 Oct 2006 +02:01:12 +0200. + +It was downloaded from http://www.mesa3d.org/download.html + +For more information see: + + http://www.mesa3d.org/ + +The tarball was built by combining MesaLib and MesaDemos tarballs, and +deleting the progs/objviewer/ directory. + +Copyright: + +Upstream Author: Brian Paul + +License: + + License / Copyright Information + + The Mesa distribution consists of several components. Different + copyrights and licenses apply to different components. For + example, GLUT is copyrighted by Mark Kilgard, some demo programs + are copyrighted by SGI, some of the Mesa device drivers are + copyrighted by their authors. See below for a list of Mesa's + components and the copyright/license for each. + + The core Mesa library is licensed according to the terms of the + XFree86 copyright (an MIT-style license). This allows integration + with the XFree86/DRI project. Unless otherwise stated, the Mesa + source code and documentation is licensed as follows: + + Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + + 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 + BRIAN PAUL 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. + + Attention, Contributors + + When contributing to the Mesa project you must agree to relinquish + your work to the holder of the copyright for the particular + component you're contributing to. That is, you can't put your own + copyright on the code, unless it's a modular piece that can be + omitted from Mesa (like a new device driver). If for example, you + contribute a bug fix to Mesa's texture mapping code, your code + will become a part of the body of work which is copyrighted by + Brian Paul and licensed by the above terms. + +---------------------------------------------------------------------- + +Some files, as listed below, are made available under the SGI Free B +license. This license is as follows: + +SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + +Copyright (C) [dates of first publication] Silicon Graphics, Inc. All Rights +Reserved. + +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 including the dates of first publication and either +this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ +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 SILICON GRAPHICS, INC. 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 of Silicon Graphics, Inc. shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Silicon +Graphics, Inc. + +-------------------------------------------------------------------------- + +Some other files listed below are made available from Silicon Graphics, +Inc. under a more liberal, MIT-style license, as follows: + + Permission to use, copy, modify, and distribute this software for + any purpose and without fee is hereby granted, provided that the above + copyright notice appear in all copies and that both the copyright notice + and this permission notice appear in supporting documentation, and that + the name of Silicon Graphics, Inc. not be used in advertising + or publicity pertaining to distribution of the software without specific, + written prior permission. + + THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE + INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + + US Government Users Restricted Rights + Use, duplication, or disclosure by the Government is subject to + restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + (c)(1)(ii) of the Rights in Technical Data and Computer Software + clause at DFARS 252.227-7013 and/or in similar or successor + clauses in the FAR or the DOD or NASA FAR Supplement. + Unpublished-- rights reserved under the copyright laws of the + United States. Contractor/manufacturer is Silicon Graphics, + Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + +-------------------------------------------------------------------------- + + Mesa Component Licenses: + + Component Files Primary Author License + ---------------------------------------------------------------------------- + core Mesa code src/*.[ch] Brian Paul Mesa + include/GL/gl.h + + GLX driver src/X/* Brian Paul Mesa + include/GL/glx.h + include/GL/xmesa.h + + OS/Mesa driver src/OSmesa/* Brian Paul Mesa + include/GL/osmesa.h + + 3Dfx driver src/FX/* David Bucciarelli Mesa + include/GL/fxmesa.h + + BeOS R4 driver mesa/drivers/beos/ Brian Paul Mesa + + MGL driver include/GL/mglmesa.h SciTech, Inc GNU LGPL + + Windows driver mesa/drivers/windows/ Li Wei GNU LGPL + include/GL/wmesa.h + + SVGA driver mesa/drivers/svga/ Brian Paul GNU LGPL + include/GL/svgamesa.h + + DOS driver mesa/drivers/dos/ Charlie Wallace GNU LGPL + include/GL/dosmesa.h + + GGI driver mesa/drivers/ggi/ Uwe Maurer GNU LGPL + include/GL/ggimesa.h + + GLUT src/glut/* Mark Kilgard Mark's copyright + include/GL/*glut*.h + + GLU library src/glu/* Brian Paul GNU LGPL + + SGI GLU library src/glu/sgi/* SGI SGI Free B + include/GL/glu.h + + Ext registry include/GL/glext.h SGI SGI Free B + include/GL/glxext.h + + demo programs progs/demos/* various see source files + + X demos progs/xdemos/* Brian Paul see source files + + SGI demos progs/samples/* SGI SGI MIT-style + + RedBook demos progs/redbook/* SGI SGI MIT-style + + +On Debian systems the full text of the GNU LGPL license is found in +/usr/share/common-licenses/LGPL. + +------------------------------------------------------------------------------ + +The Debian packaging is (C) 2006, Thierry Reding and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + --- mesa-7.9~git20100924.orig/debian/libegl1-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libegl1-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libEGL1 --- mesa-7.9~git20100924.orig/debian/libgles2-mesa.symbols +++ mesa-7.9~git20100924/debian/libgles2-mesa.symbols @@ -0,0 +1,164 @@ +libGLESv2.so.2 libgles2-mesa #MINVER# | libgles2 +# _glapi_* are internal GL dispatch symbols. They should probably be hidden. + (regex)"^_glapi_.*@Base$" 7.8.1 +# These are optimised assembly versions of functions, accessed through a +# dispatch table. They're arch-specific, and should probably be hidden. + (regex|optional=mesa internal ASM optimized functions)"^_mesa_.*@Base$" 7.8.1 + _glthread_GetID@Base 7.8.1 + glActiveTexture@Base 7.8.1 + glAttachShader@Base 7.8.1 + glBindAttribLocation@Base 7.8.1 + glBindBuffer@Base 7.8.1 + glBindFramebuffer@Base 7.8.1 + glBindRenderbuffer@Base 7.8.1 + glBindTexture@Base 7.8.1 + glBlendColor@Base 7.8.1 + glBlendEquation@Base 7.8.1 + glBlendEquationSeparate@Base 7.8.1 + glBlendFunc@Base 7.8.1 + glBlendFuncSeparate@Base 7.8.1 + glBufferData@Base 7.8.1 + glBufferSubData@Base 7.8.1 + glCheckFramebufferStatus@Base 7.8.1 + glClear@Base 7.8.1 + glClearColor@Base 7.8.1 + glClearDepthf@Base 7.8.1 + glClearStencil@Base 7.8.1 + glColorMask@Base 7.8.1 + glCompileShader@Base 7.8.1 + glCompressedTexImage2D@Base 7.8.1 + glCompressedTexImage3DOES@Base 7.8.1 + glCompressedTexSubImage2D@Base 7.8.1 + glCompressedTexSubImage3DOES@Base 7.8.1 + glCopyTexImage2D@Base 7.8.1 + glCopyTexSubImage2D@Base 7.8.1 + glCopyTexSubImage3DOES@Base 7.8.1 + glCreateProgram@Base 7.8.1 + glCreateShader@Base 7.8.1 + glCullFace@Base 7.8.1 + glDeleteBuffers@Base 7.8.1 + glDeleteFramebuffers@Base 7.8.1 + glDeleteProgram@Base 7.8.1 + glDeleteRenderbuffers@Base 7.8.1 + glDeleteShader@Base 7.8.1 + glDeleteTextures@Base 7.8.1 + glDepthFunc@Base 7.8.1 + glDepthMask@Base 7.8.1 + glDepthRangef@Base 7.8.1 + glDetachShader@Base 7.8.1 + glDisable@Base 7.8.1 + glDisableVertexAttribArray@Base 7.8.1 + glDrawArrays@Base 7.8.1 + glDrawElements@Base 7.8.1 + glEGLImageTargetRenderbufferStorageOES@Base 7.8.1 + glEGLImageTargetTexture2DOES@Base 7.8.1 + glEnable@Base 7.8.1 + glEnableVertexAttribArray@Base 7.8.1 + glFinish@Base 7.8.1 + glFlush@Base 7.8.1 + glFramebufferRenderbuffer@Base 7.8.1 + glFramebufferTexture2D@Base 7.8.1 + glFramebufferTexture3DOES@Base 7.8.1 + glFrontFace@Base 7.8.1 + glGenBuffers@Base 7.8.1 + glGenFramebuffers@Base 7.8.1 + glGenRenderbuffers@Base 7.8.1 + glGenTextures@Base 7.8.1 + glGenerateMipmap@Base 7.8.1 + glGetActiveAttrib@Base 7.8.1 + glGetActiveUniform@Base 7.8.1 + glGetAttachedShaders@Base 7.8.1 + glGetAttribLocation@Base 7.8.1 + glGetBooleanv@Base 7.8.1 + glGetBufferParameteriv@Base 7.8.1 + glGetBufferPointervOES@Base 7.8.1 + glGetError@Base 7.8.1 + glGetFloatv@Base 7.8.1 + glGetFramebufferAttachmentParameteriv@Base 7.8.1 + glGetIntegerv@Base 7.8.1 + glGetProgramBinaryOES@Base 7.8.1 + glGetProgramInfoLog@Base 7.8.1 + glGetProgramiv@Base 7.8.1 + glGetRenderbufferParameteriv@Base 7.8.1 + glGetShaderInfoLog@Base 7.8.1 + glGetShaderPrecisionFormat@Base 7.8.1 + glGetShaderSource@Base 7.8.1 + glGetShaderiv@Base 7.8.1 + glGetString@Base 7.8.1 + glGetTexParameterfv@Base 7.8.1 + glGetTexParameteriv@Base 7.8.1 + glGetUniformLocation@Base 7.8.1 + glGetUniformfv@Base 7.8.1 + glGetUniformiv@Base 7.8.1 + glGetVertexAttribPointerv@Base 7.8.1 + glGetVertexAttribfv@Base 7.8.1 + glGetVertexAttribiv@Base 7.8.1 + glHint@Base 7.8.1 + glIsBuffer@Base 7.8.1 + glIsEnabled@Base 7.8.1 + glIsFramebuffer@Base 7.8.1 + glIsProgram@Base 7.8.1 + glIsRenderbuffer@Base 7.8.1 + glIsShader@Base 7.8.1 + glIsTexture@Base 7.8.1 + glLineWidth@Base 7.8.1 + glLinkProgram@Base 7.8.1 + glMapBufferOES@Base 7.8.1 + glMultiDrawArraysEXT@Base 7.8.1 + glMultiDrawElementsEXT@Base 7.8.1 + glPixelStorei@Base 7.8.1 + glPolygonOffset@Base 7.8.1 + glProgramBinaryOES@Base 7.8.1 + glReadPixels@Base 7.8.1 + glReleaseShaderCompiler@Base 7.8.1 + glRenderbufferStorage@Base 7.8.1 + glSampleCoverage@Base 7.8.1 + glScissor@Base 7.8.1 + glShaderBinary@Base 7.8.1 + glShaderSource@Base 7.8.1 + glStencilFunc@Base 7.8.1 + glStencilFuncSeparate@Base 7.8.1 + glStencilMask@Base 7.8.1 + glStencilMaskSeparate@Base 7.8.1 + glStencilOp@Base 7.8.1 + glStencilOpSeparate@Base 7.8.1 + glTexImage2D@Base 7.8.1 + glTexImage3DOES@Base 7.8.1 + glTexParameterf@Base 7.8.1 + glTexParameterfv@Base 7.8.1 + glTexParameteri@Base 7.8.1 + glTexParameteriv@Base 7.8.1 + glTexSubImage2D@Base 7.8.1 + glTexSubImage3DOES@Base 7.8.1 + glUniform1f@Base 7.8.1 + glUniform1fv@Base 7.8.1 + glUniform1i@Base 7.8.1 + glUniform1iv@Base 7.8.1 + glUniform2f@Base 7.8.1 + glUniform2fv@Base 7.8.1 + glUniform2i@Base 7.8.1 + glUniform2iv@Base 7.8.1 + glUniform3f@Base 7.8.1 + glUniform3fv@Base 7.8.1 + glUniform3i@Base 7.8.1 + glUniform3iv@Base 7.8.1 + glUniform4f@Base 7.8.1 + glUniform4fv@Base 7.8.1 + glUniform4i@Base 7.8.1 + glUniform4iv@Base 7.8.1 + glUniformMatrix2fv@Base 7.8.1 + glUniformMatrix3fv@Base 7.8.1 + glUniformMatrix4fv@Base 7.8.1 + glUnmapBufferOES@Base 7.8.1 + glUseProgram@Base 7.8.1 + glValidateProgram@Base 7.8.1 + glVertexAttrib1f@Base 7.8.1 + glVertexAttrib1fv@Base 7.8.1 + glVertexAttrib2f@Base 7.8.1 + glVertexAttrib2fv@Base 7.8.1 + glVertexAttrib3f@Base 7.8.1 + glVertexAttrib3fv@Base 7.8.1 + glVertexAttrib4f@Base 7.8.1 + glVertexAttrib4fv@Base 7.8.1 + glVertexAttribPointer@Base 7.8.1 + glViewport@Base 7.8.1 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11.postinst +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11.postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=libgl1-mesa-swx11 +THIS_SCRIPT=postinst + +case "$1" in + configure) + # Use alternatives to make it easier to switch between Mesa and 3rd party modules + update-alternatives --force \ + --install /etc/ld.so.conf.d/GL.conf gl_conf /usr/lib/mesa/ld.so.conf 500 \ + --slave /usr/lib/xorg/extra-modules xorg_extra_modules /usr/lib/xorg/x11-extra-modules + + # ldconfig needs to be run immediately as we're changing /etc/ld.so.conf.d/ with + # alternatives. + LDCONFIG_NOTRIGGER=y ldconfig + +esac + +#DEBHELPER# + +exit 0 + +# vim:set ai et sw=2 ts=2 tw=80: + --- mesa-7.9~git20100924.orig/debian/libopenvg1-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libopenvg1-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libOpenVG1 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11.install @@ -0,0 +1 @@ +usr/lib/libGL.so.* usr/lib/mesa/ --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-dev.install @@ -0,0 +1,2 @@ +usr/lib/libGL.so usr/lib/mesa/ +usr/lib/pkgconfig/gl.pc --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx.prerm +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx.prerm @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=libgl1-mesa-glx +THIS_SCRIPT=prerm + +case "$1" in + remove) + # Use alternatives to make it easier to switch between Mesa and 3rd party modules + update-alternatives --remove gl_conf /usr/lib/GL/ld.so.conf + + # explicit ldconfig due to alternatives + ldconfig + +esac + +#DEBHELPER# + +exit 0 + +# vim:set ai et sw=2 ts=2 tw=80: + --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx-i686.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx-i686.install @@ -0,0 +1 @@ +dri/usr/lib/i686/cmov/libGL.so.* usr/lib/i686/cmov --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx.lintian-overrides +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGL1 --- mesa-7.9~git20100924.orig/debian/libegl1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libegl1-mesa-dev.install @@ -0,0 +1,4 @@ +dri/usr/lib/libEGL.so usr/lib +dri/usr/include/EGL usr/include +dri/usr/include/KHR usr/include +dri/usr/lib/pkgconfig/egl.pc usr/lib/pkgconfig --- mesa-7.9~git20100924.orig/debian/libglw1-mesa.shlibs +++ mesa-7.9~git20100924/debian/libglw1-mesa.shlibs @@ -0,0 +1 @@ +libGLw 1 libglw1-mesa | libglw1 --- mesa-7.9~git20100924.orig/debian/libgles1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libgles1-mesa-dev.install @@ -0,0 +1,3 @@ +dri/usr/lib/libGLESv1_CM.so usr/lib +dri/usr/include/GLES usr/include +dri/usr/lib/pkgconfig/glesv1_cm.pc usr/lib/pkgconfig --- mesa-7.9~git20100924.orig/debian/watch +++ mesa-7.9~git20100924/debian/watch @@ -0,0 +1,6 @@ +version=3 +opts="uversionmangle=s/-rc/~rc/" \ +http://sf.net/mesa3d/MesaLib-(.*)\.tar\.gz + +opts="uversionmangle=s/-rc/~rc/" \ +ftp://freedesktop.org/pub/mesa/([\d\.]*)/ MesaLib-(.*)\.tar\.gz --- mesa-7.9~git20100924.orig/debian/libgles1-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libgles1-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGLESv1-CM1 --- mesa-7.9~git20100924.orig/debian/mesa-common-dev.docs +++ mesa-7.9~git20100924/debian/mesa-common-dev.docs @@ -0,0 +1,8 @@ +docs/bugs.html +docs/debugging.html +docs/envvars.html +docs/faq.html +docs/osmesa.html +docs/RELNOTES-* +docs/relnotes* +docs/*.spec --- mesa-7.9~git20100924.orig/debian/libopenvg1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libopenvg1-mesa-dev.install @@ -0,0 +1,3 @@ +dri/usr/lib/libOpenVG.so usr/lib +dri/usr/include/VG usr/include +dri/usr/lib/pkgconfig/vg.pc usr/lib/pkgconfig --- mesa-7.9~git20100924.orig/debian/libegl1-mesa.install +++ mesa-7.9~git20100924/debian/libegl1-mesa.install @@ -0,0 +1,4 @@ +dri/usr/lib/libEGL.so.1* usr/lib +dri/usr/lib/egl/egl_dri2.so usr/lib/egl +dri/usr/lib/egl/egl_glx.so usr/lib/egl +dri/usr/lib/egl/st_GL.so usr/lib/egl --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-dri.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-dri.install @@ -0,0 +1 @@ +build/dri/lib/*_dri.so usr/lib/dri/ --- mesa-7.9~git20100924.orig/debian/libopenvg1-mesa.install +++ mesa-7.9~git20100924/debian/libopenvg1-mesa.install @@ -0,0 +1,2 @@ +dri/usr/lib/libOpenVG.so.1* usr/lib +dri/usr/lib/egl/st_OpenVG.so usr/lib/egl --- mesa-7.9~git20100924.orig/debian/libglw1-mesa.install +++ mesa-7.9~git20100924/debian/libglw1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLw.so.* --- mesa-7.9~git20100924.orig/debian/rules +++ mesa-7.9~git20100924/debian/rules @@ -0,0 +1,325 @@ +#!/usr/bin/make -f +# debian/rules for the Debian mesa package +# Copyright © 2006 Thierry Reding + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) +DEB_BUILD_DIR ?= $(CURDIR)/build +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_HOST_GNU_TYPE) +else + confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + +# choose which configurations to build +include debian/scripts/choose-configs + +# build the following configurations by default +CONFIGS = $(SWX11_GLU_CONFIGS) \ + dri \ + osmesa \ + osmesa-static \ + osmesa16 \ + osmesa16-static \ + osmesa32 \ + osmesa32-static + +STAMP_DIR = debian/stamp +STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE) +BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS)) + +QUILT_STAMPFN = $(STAMP_DIR)/patch +include /usr/share/quilt/quilt.make + +confflags-common = \ + --disable-glu \ + --disable-glut \ + --disable-glw \ + CFLAGS="$(CFLAGS)" + +DRI_DRIVERS = swrast +GALLIUM_DRIVERS = swrast +EGL_DISPLAYS = x11 + +# hurd doesn't do direct rendering +ifeq ($(DEB_HOST_ARCH_OS), hurd) + DIRECT_RENDERING = --disable-driglx-direct +else + DIRECT_RENDERING = --enable-driglx-direct + + ifeq ($(DEB_HOST_ARCH_OS), linux) +# Gallium drivers require libdrm-{nouveau,radeon}, only available on Linux + GALLIUM_DRIVERS += nouveau radeon r600 +# Although the KMS egl drivers will probably build on kfreebsd & hurd +# only linux actually has KMS drivers implemented at this point. + EGL_DISPLAYS += drm + endif + + ifeq ($(DEB_HOST_ARCH), lpia) + DRI_DRIVERS += i915 i965 + GALLIUM_DRIVERS += i915 + else ifneq ($(DEB_HOST_ARCH), s390) + DRI_DRIVERS += mga r128 r200 r300 r600 radeon savage tdfx + ifeq ($(DEB_HOST_ARCH_CPU), i386) + DRI_DRIVERS += i810 i915 i965 sis unichrome + GALLIUM_DRIVERS += i915 + else ifeq ($(DEB_HOST_ARCH_CPU), amd64) + DRI_DRIVERS += i915 i965 sis unichrome + GALLIUM_DRIVERS += i915 + endif + endif +endif + +confflags-dri = \ + --with-driver=dri \ + --with-dri-drivers="$(DRI_DRIVERS)" \ + --with-dri-driverdir=/usr/lib/dri \ + --with-egl-displays="$(EGL_DISPLAYS)" \ + --enable-glx-tls \ + $(addprefix --enable-gallium-,$(GALLIUM_DRIVERS)) \ + --with-state-trackers=egl,glx,dri,vega \ + --enable-gles-overlay \ + --enable-gles1 \ + --enable-gles2 \ + $(DIRECT_RENDERING) \ + $(confflags-common) + +confflags-osmesa = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + $(confflags-common) + +confflags-osmesa-static = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + --enable-static \ + $(confflags-common) + +confflags-osmesa16 = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + $(confflags-common) + +confflags-osmesa16-static = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + --with-osmesa-bits=16 \ + --enable-static \ + $(confflags-common) + +confflags-osmesa32 = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + $(confflags-common) + +confflags-osmesa32-static = \ + --disable-egl \ + --disable-gallium \ + --with-driver=osmesa \ + --with-osmesa-bits=32 \ + --enable-static \ + $(confflags-common) + +confflags-swx11+glu = \ + --disable-egl \ + --disable-gallium \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --disable-egl \ + --disable-glut \ + --disable-glw \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-static = \ + --disable-egl \ + --disable-gallium \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --enable-static \ + --disable-egl \ + --disable-glut \ + --disable-glw \ + CFLAGS="$(CFLAGS)" + +confflags-swx11+glu-i386-i686 = \ + --disable-egl \ + --disable-gallium \ + --with-driver=xlib \ + --disable-gl-osmesa \ + --disable-glut \ + --disable-egl \ + --disable-glw \ + --libdir=/usr/lib/i686/cmov \ + CFLAGS="$(CFLAGS) -march=i686" + +# Add /usr/lib32/dri/ on 32 bit systems so that this path is used +# for 32 bit compatibility on 64 bit systems +ifeq ($(DEB_BUILD_ARCH),i386) + confflags-dri += --with-dri-searchpath=/usr/lib/dri:/usr/lib32/dri +endif + +configure: $(QUILT_STAMPFN) configure.ac + autoreconf -vfi + +# list the configurations that will built +configs: + @echo Building the following configurations: $(CONFIGS) + +$(STAMP_DIR)/stamp: + dh_testdir + mkdir -p $(STAMP_DIR) + >$@ + +$(QUILT_STAMPFN): $(STAMP_DIR)/stamp + +build: build-stamp + +build-stamp: $(BUILD_STAMPS) +# Remove gallium drivers which replace existing classic drivers. +# Intel gallium is significantly behind the classic mesa drivers... +ifeq (i915,$(findstring i915, $(GALLIUM_DRIVERS))) + rm build/dri/lib/gallium/i915_dri.so +endif +ifeq (i965,$(findstring i965, $(GALLIUM_DRIVERS))) + rm build/dri/lib/gallium/i965_dri.so +endif +# We should switch to r300g soon, but it won't support UMS. Stick +# with r300c for now +ifeq (radeon,$(findstring radeon, $(GALLIUM_DRIVERS))) + rm build/dri/lib/gallium/r300_dri.so +endif +# r600g is not yet in a fit state to ship, and the same caveats apply +# as for r300g +ifeq (r600,$(findstring r600, $(GALLIUM_DRIVERS))) + rm build/dri/lib/gallium/r600_dri.so +endif + >$@ + +$(STAMP)-build-%: configure + dh_testdir + + mkdir -p $(DEB_BUILD_DIR)/$* + find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \ + xargs cp -rlf -t $(DEB_BUILD_DIR)/$* + cd $(DEB_BUILD_DIR)/$* && \ + ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --sysconfdir=/etc \ + --localstatedir=/var $(confflags) $(confflags-$*) + cd $(DEB_BUILD_DIR)/$* && $(MAKE) + >$@ + +install: build + # Add here commands to install the package into debian/tmp + dh_testdir + dh_testroot + dh_prep + dh_installdirs + set -e; for config in $(filter-out dri, $(CONFIGS)); do \ + $(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \ + done + $(MAKE) -C $(DEB_BUILD_DIR)/dri DESTDIR=$(CURDIR)/debian/tmp/dri install + +clean: unpatch + dh_testdir + dh_testroot + rm -rf .pc + + rm -f config.cache config.log config.status + rm -f */config.cache */config.log */config.status + rm -f conftest* */conftest* + rm -rf autom4te.cache */autom4te.cache + rm -rf build + rm -rf configure config.guess config.sub config.h.in + rm -rf $$(find -name Makefile.in) + rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh + rm -rf $(STAMP_DIR) + + dh_clean + +# Build architecture-independent files here. +binary-indep: install + + +# Build architecture-dependent files here. +binary-arch: install + dh_testdir + dh_testroot + dh_installchangelogs -s + dh_installchangelogs -pmesa-common-dev + dh_installdocs -s + dh_installexamples -s + + # Classic DRI and Gallium DRI are mixed up together here + # Remove the whole tree to avoid false-positives in --list-missing, and + # install the right files manually. + rm -r debian/tmp/dri/usr/lib/dri + + dh_install -s --list-missing + + # Create an ld.so.conf which says where to find libGL from Mesa + echo "/usr/lib/mesa" \ + > $(CURDIR)/debian/libgl1-mesa-glx/usr/lib/mesa/ld.so.conf + echo "/usr/lib/mesa" \ + > $(CURDIR)/debian/libgl1-mesa-swx11/usr/lib/mesa/ld.so.conf + +ifeq ($(DEB_BUILD_ARCH),amd64) + # Add the path to 32bit libGL from Mesa (on 64 bit) + echo "/usr/lib32/mesa" \ + >> $(CURDIR)/debian/libgl1-mesa-glx/usr/lib/mesa/ld.so.conf + echo "/usr/lib32/mesa" \ + >> $(CURDIR)/debian/libgl1-mesa-swx11/usr/lib/mesa/ld.so.conf +endif + + # Empty directory for the alternative + mkdir -p $(CURDIR)/debian/libgl1-mesa-glx/usr/lib/xorg/x11-extra-modules + mkdir -p $(CURDIR)/debian/libgl1-mesa-swx11/usr/lib/xorg/x11-extra-modules + + dh_installman -s + dh_lintian -s + dh_link -s + dh_strip -plibgl1-mesa-swx11 --dbg-package=libgl1-mesa-swx11-dbg + dh_strip -plibgl1-mesa-glx --dbg-package=libgl1-mesa-glx-dbg + dh_strip -plibgl1-mesa-dri --dbg-package=libgl1-mesa-dri-dbg + dh_strip -plibgl1-mesa-dri-experimental --dbg-package=libgl1-mesa-dri-experimental-dbg + dh_strip -plibopenvg1-mesa --dbg-package=libopenvg1-mesa-dbg + dh_strip -plibegl1-mesa --dbg-package=libegl1-mesa-dbg + dh_strip -plibgles1-mesa --dbg-package=libgles1-mesa-dbg + dh_strip -plibgles2-mesa --dbg-package=libgles2-mesa-dbg + dh_strip -plibegl1-mesa-drivers --dbg-package=libegl1-mesa-drivers-dbg + dh_strip -s --remaining-packages + dh_compress -s + dh_fixperms -s + dh_makeshlibs -s + dh_installdeb -s + dh_shlibdeps -s -l/usr/lib/mesa + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s -- -Zlzma + +binary: binary-indep binary-arch +.PHONY: configs build clean binary-indep binary-arch binary install --- mesa-7.9~git20100924.orig/debian/libegl1-mesa-drivers.install +++ mesa-7.9~git20100924/debian/libegl1-mesa-drivers.install @@ -0,0 +1,2 @@ +dri/usr/lib/egl/egl_gallium.so usr/lib/egl +dri/usr/lib/egl/pipe_*.so usr/lib/egl --- mesa-7.9~git20100924.orig/debian/libgles1-mesa.install +++ mesa-7.9~git20100924/debian/libgles1-mesa.install @@ -0,0 +1,2 @@ +dri/usr/lib/libGLESv1_CM.so.1* usr/lib +dri/usr/lib/egl/st_GLESv1_CM.so usr/lib/egl --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx.postinst +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx.postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=libgl1-mesa-glx +THIS_SCRIPT=postinst + +case "$1" in + configure) + # Use alternatives to make it easier to switch between Mesa and 3rd party modules + update-alternatives --force \ + --install /etc/ld.so.conf.d/GL.conf gl_conf /usr/lib/mesa/ld.so.conf 500 \ + --slave /usr/lib/xorg/extra-modules xorg_extra_modules /usr/lib/xorg/x11-extra-modules + + # ldconfig needs to be run immediately as we're changing /etc/ld.so.conf.d/ with + # alternatives. + LDCONFIG_NOTRIGGER=y ldconfig + +esac + +#DEBHELPER# + +exit 0 + +# vim:set ai et sw=2 ts=2 tw=80: + --- mesa-7.9~git20100924.orig/debian/libgles2-mesa-dev.install +++ mesa-7.9~git20100924/debian/libgles2-mesa-dev.install @@ -0,0 +1,3 @@ +dri/usr/lib/libGLESv2.so usr/lib +dri/usr/include/GLES2 usr/include +dri/usr/lib/pkgconfig/glesv2.pc usr/lib/pkgconfig --- mesa-7.9~git20100924.orig/debian/libgles1-mesa.symbols +++ mesa-7.9~git20100924/debian/libgles1-mesa.symbols @@ -0,0 +1,240 @@ +libGLESv1_CM.so.1 libgles1-mesa #MINVER# | libgles1 +# _glapi_* are internal GL dispatch symbols. They should probably be hidden + (regex)"^_glapi_.*@Base$" 7.8.1 +# These are optimised assembly versions of functions, accessed through a +# dispatch table. They're arch-specific, and should probably be hidden. + (regex|optional=mesa internal ASM optimized functions)"^_mesa_.*@Base$" 7.8.1 + _glthread_GetID@Base 7.8.1 + glActiveTexture@Base 7.8.1 + glAlphaFunc@Base 7.8.1 + glAlphaFuncx@Base 7.8.1 + glAlphaFuncxOES@Base 7.8.1 + glBindBuffer@Base 7.8.1 + glBindFramebufferOES@Base 7.8.1 + glBindRenderbufferOES@Base 7.8.1 + glBindTexture@Base 7.8.1 + glBlendEquationOES@Base 7.8.1 + glBlendEquationSeparateOES@Base 7.8.1 + glBlendFunc@Base 7.8.1 + glBlendFuncSeparateOES@Base 7.8.1 + glBufferData@Base 7.8.1 + glBufferSubData@Base 7.8.1 + glCheckFramebufferStatusOES@Base 7.8.1 + glClear@Base 7.8.1 + glClearColor@Base 7.8.1 + glClearColorx@Base 7.8.1 + glClearColorxOES@Base 7.8.1 + glClearDepthf@Base 7.8.1 + glClearDepthfOES@Base 7.8.1 + glClearDepthx@Base 7.8.1 + glClearDepthxOES@Base 7.8.1 + glClearStencil@Base 7.8.1 + glClientActiveTexture@Base 7.8.1 + glClipPlanef@Base 7.8.1 + glClipPlanefOES@Base 7.8.1 + glClipPlanex@Base 7.8.1 + glClipPlanexOES@Base 7.8.1 + glColor4f@Base 7.8.1 + glColor4ub@Base 7.8.1 + glColor4x@Base 7.8.1 + glColor4xOES@Base 7.8.1 + glColorMask@Base 7.8.1 + glColorPointer@Base 7.8.1 + glCompressedTexImage2D@Base 7.8.1 + glCompressedTexSubImage2D@Base 7.8.1 + glCopyTexImage2D@Base 7.8.1 + glCopyTexSubImage2D@Base 7.8.1 + glCullFace@Base 7.8.1 + glDeleteBuffers@Base 7.8.1 + glDeleteFramebuffersOES@Base 7.8.1 + glDeleteRenderbuffersOES@Base 7.8.1 + glDeleteTextures@Base 7.8.1 + glDepthFunc@Base 7.8.1 + glDepthMask@Base 7.8.1 + glDepthRangef@Base 7.8.1 + glDepthRangefOES@Base 7.8.1 + glDepthRangex@Base 7.8.1 + glDepthRangexOES@Base 7.8.1 + glDisable@Base 7.8.1 + glDisableClientState@Base 7.8.1 + glDrawArrays@Base 7.8.1 + glDrawElements@Base 7.8.1 + glDrawTexfOES@Base 7.8.1 + glDrawTexfvOES@Base 7.8.1 + glDrawTexiOES@Base 7.8.1 + glDrawTexivOES@Base 7.8.1 + glDrawTexsOES@Base 7.8.1 + glDrawTexsvOES@Base 7.8.1 + glDrawTexxOES@Base 7.8.1 + glDrawTexxvOES@Base 7.8.1 + glEGLImageTargetRenderbufferStorageOES@Base 7.8.1 + glEGLImageTargetTexture2DOES@Base 7.8.1 + glEnable@Base 7.8.1 + glEnableClientState@Base 7.8.1 + glFinish@Base 7.8.1 + glFlush@Base 7.8.1 + glFogf@Base 7.8.1 + glFogfv@Base 7.8.1 + glFogx@Base 7.8.1 + glFogxOES@Base 7.8.1 + glFogxv@Base 7.8.1 + glFogxvOES@Base 7.8.1 + glFramebufferRenderbufferOES@Base 7.8.1 + glFramebufferTexture2DOES@Base 7.8.1 + glFrontFace@Base 7.8.1 + glFrustumf@Base 7.8.1 + glFrustumfOES@Base 7.8.1 + glFrustumx@Base 7.8.1 + glFrustumxOES@Base 7.8.1 + glGenBuffers@Base 7.8.1 + glGenFramebuffersOES@Base 7.8.1 + glGenRenderbuffersOES@Base 7.8.1 + glGenTextures@Base 7.8.1 + glGenerateMipmapOES@Base 7.8.1 + glGetBooleanv@Base 7.8.1 + glGetBufferParameteriv@Base 7.8.1 + glGetBufferPointervOES@Base 7.8.1 + glGetClipPlanef@Base 7.8.1 + glGetClipPlanefOES@Base 7.8.1 + glGetClipPlanex@Base 7.8.1 + glGetClipPlanexOES@Base 7.8.1 + glGetError@Base 7.8.1 + glGetFixedv@Base 7.8.1 + glGetFixedvOES@Base 7.8.1 + glGetFloatv@Base 7.8.1 + glGetFramebufferAttachmentParameterivOES@Base 7.8.1 + glGetIntegerv@Base 7.8.1 + glGetLightfv@Base 7.8.1 + glGetLightxv@Base 7.8.1 + glGetLightxvOES@Base 7.8.1 + glGetMaterialfv@Base 7.8.1 + glGetMaterialxv@Base 7.8.1 + glGetMaterialxvOES@Base 7.8.1 + glGetPointerv@Base 7.8.1 + glGetRenderbufferParameterivOES@Base 7.8.1 + glGetString@Base 7.8.1 + glGetTexEnvfv@Base 7.8.1 + glGetTexEnviv@Base 7.8.1 + glGetTexEnvxv@Base 7.8.1 + glGetTexEnvxvOES@Base 7.8.1 + glGetTexGenfvOES@Base 7.8.1 + glGetTexGenivOES@Base 7.8.1 + glGetTexGenxvOES@Base 7.8.1 + glGetTexParameterfv@Base 7.8.1 + glGetTexParameteriv@Base 7.8.1 + glGetTexParameterxv@Base 7.8.1 + glGetTexParameterxvOES@Base 7.8.1 + glHint@Base 7.8.1 + glIsBuffer@Base 7.8.1 + glIsEnabled@Base 7.8.1 + glIsFramebufferOES@Base 7.8.1 + glIsRenderbufferOES@Base 7.8.1 + glIsTexture@Base 7.8.1 + glLightModelf@Base 7.8.1 + glLightModelfv@Base 7.8.1 + glLightModelx@Base 7.8.1 + glLightModelxOES@Base 7.8.1 + glLightModelxv@Base 7.8.1 + glLightModelxvOES@Base 7.8.1 + glLightf@Base 7.8.1 + glLightfv@Base 7.8.1 + glLightx@Base 7.8.1 + glLightxOES@Base 7.8.1 + glLightxv@Base 7.8.1 + glLightxvOES@Base 7.8.1 + glLineWidth@Base 7.8.1 + glLineWidthx@Base 7.8.1 + glLineWidthxOES@Base 7.8.1 + glLoadIdentity@Base 7.8.1 + glLoadMatrixf@Base 7.8.1 + glLoadMatrixx@Base 7.8.1 + glLoadMatrixxOES@Base 7.8.1 + glLogicOp@Base 7.8.1 + glMapBufferOES@Base 7.8.1 + glMaterialf@Base 7.8.1 + glMaterialfv@Base 7.8.1 + glMaterialx@Base 7.8.1 + glMaterialxOES@Base 7.8.1 + glMaterialxv@Base 7.8.1 + glMaterialxvOES@Base 7.8.1 + glMatrixMode@Base 7.8.1 + glMultMatrixf@Base 7.8.1 + glMultMatrixx@Base 7.8.1 + glMultMatrixxOES@Base 7.8.1 + glMultiDrawArraysEXT@Base 7.8.1 + glMultiDrawElementsEXT@Base 7.8.1 + glMultiTexCoord4f@Base 7.8.1 + glMultiTexCoord4x@Base 7.8.1 + glMultiTexCoord4xOES@Base 7.8.1 + glNormal3f@Base 7.8.1 + glNormal3x@Base 7.8.1 + glNormal3xOES@Base 7.8.1 + glNormalPointer@Base 7.8.1 + glOrthof@Base 7.8.1 + glOrthofOES@Base 7.8.1 + glOrthox@Base 7.8.1 + glOrthoxOES@Base 7.8.1 + glPixelStorei@Base 7.8.1 + glPointParameterf@Base 7.8.1 + glPointParameterfv@Base 7.8.1 + glPointParameterx@Base 7.8.1 + glPointParameterxOES@Base 7.8.1 + glPointParameterxv@Base 7.8.1 + glPointParameterxvOES@Base 7.8.1 + glPointSize@Base 7.8.1 + glPointSizePointerOES@Base 7.8.1 + glPointSizex@Base 7.8.1 + glPointSizexOES@Base 7.8.1 + glPolygonOffset@Base 7.8.1 + glPolygonOffsetx@Base 7.8.1 + glPolygonOffsetxOES@Base 7.8.1 + glPopMatrix@Base 7.8.1 + glPushMatrix@Base 7.8.1 + glQueryMatrixxOES@Base 7.8.1 + glReadPixels@Base 7.8.1 + glRenderbufferStorageOES@Base 7.8.1 + glRotatef@Base 7.8.1 + glRotatex@Base 7.8.1 + glRotatexOES@Base 7.8.1 + glSampleCoverage@Base 7.8.1 + glSampleCoveragex@Base 7.8.1 + glSampleCoveragexOES@Base 7.8.1 + glScalef@Base 7.8.1 + glScalex@Base 7.8.1 + glScalexOES@Base 7.8.1 + glScissor@Base 7.8.1 + glShadeModel@Base 7.8.1 + glStencilFunc@Base 7.8.1 + glStencilMask@Base 7.8.1 + glStencilOp@Base 7.8.1 + glTexCoordPointer@Base 7.8.1 + glTexEnvf@Base 7.8.1 + glTexEnvfv@Base 7.8.1 + glTexEnvi@Base 7.8.1 + glTexEnviv@Base 7.8.1 + glTexEnvx@Base 7.8.1 + glTexEnvxOES@Base 7.8.1 + glTexEnvxv@Base 7.8.1 + glTexEnvxvOES@Base 7.8.1 + glTexGenfOES@Base 7.8.1 + glTexGenfvOES@Base 7.8.1 + glTexGeniOES@Base 7.8.1 + glTexGenivOES@Base 7.8.1 + glTexGenxOES@Base 7.8.1 + glTexGenxvOES@Base 7.8.1 + glTexImage2D@Base 7.8.1 + glTexParameterf@Base 7.8.1 + glTexParameterfv@Base 7.8.1 + glTexParameteri@Base 7.8.1 + glTexParameteriv@Base 7.8.1 + glTexParameterx@Base 7.8.1 + glTexParameterxOES@Base 7.8.1 + glTexParameterxv@Base 7.8.1 + glTexParameterxvOES@Base 7.8.1 + glTexSubImage2D@Base 7.8.1 + glTranslatef@Base 7.8.1 + glTranslatex@Base 7.8.1 + glTranslatexOES@Base 7.8.1 + glUnmapBufferOES@Base 7.8.1 + glVertexPointer@Base 7.8.1 + glViewport@Base 7.8.1 --- mesa-7.9~git20100924.orig/debian/libopenvg1-mesa.symbols +++ mesa-7.9~git20100924/debian/libopenvg1-mesa.symbols @@ -0,0 +1,82 @@ +libOpenVG.so.1 libopenvg1-mesa #MINVER# | libopenvg1 + mapi_get_proc_address@Base 7.9~ + mapi_init@Base 7.9~ + mapi_table_create@Base 7.9~ + mapi_table_destroy@Base 7.9~ + mapi_table_fill@Base 7.9~ + mapi_table_make_current@Base 7.9~ + vgAppendPath@Base 7.8.1 + vgAppendPathData@Base 7.8.1 + vgChildImage@Base 7.8.1 + vgClear@Base 7.8.1 + vgClearImage@Base 7.8.1 + vgClearPath@Base 7.8.1 + vgColorMatrix@Base 7.8.1 + vgConvolve@Base 7.8.1 + vgCopyImage@Base 7.8.1 + vgCopyPixels@Base 7.8.1 + vgCreateImage@Base 7.8.1 + vgCreatePaint@Base 7.8.1 + vgCreatePath@Base 7.8.1 + vgDestroyImage@Base 7.8.1 + vgDestroyPaint@Base 7.8.1 + vgDestroyPath@Base 7.8.1 + vgDrawImage@Base 7.8.1 + vgDrawPath@Base 7.8.1 + vgFinish@Base 7.8.1 + vgFlush@Base 7.8.1 + vgGaussianBlur@Base 7.8.1 + vgGetColor@Base 7.8.1 + vgGetError@Base 7.8.1 + vgGetImageSubData@Base 7.8.1 + vgGetMatrix@Base 7.8.1 + vgGetPaint@Base 7.8.1 + vgGetParameterVectorSize@Base 7.8.1 + vgGetParameterf@Base 7.8.1 + vgGetParameterfv@Base 7.8.1 + vgGetParameteri@Base 7.8.1 + vgGetParameteriv@Base 7.8.1 + vgGetParent@Base 7.8.1 + vgGetPathCapabilities@Base 7.8.1 + vgGetPixels@Base 7.8.1 + vgGetString@Base 7.8.1 + vgGetVectorSize@Base 7.8.1 + vgGetf@Base 7.8.1 + vgGetfv@Base 7.8.1 + vgGeti@Base 7.8.1 + vgGetiv@Base 7.8.1 + vgHardwareQuery@Base 7.8.1 + vgImageSubData@Base 7.8.1 + vgInterpolatePath@Base 7.8.1 + vgLoadIdentity@Base 7.8.1 + vgLoadMatrix@Base 7.8.1 + vgLookup@Base 7.8.1 + vgLookupSingle@Base 7.8.1 + vgMask@Base 7.8.1 + vgModifyPathCoords@Base 7.8.1 + vgMultMatrix@Base 7.8.1 + vgPaintPattern@Base 7.8.1 + vgPathBounds@Base 7.8.1 + vgPathLength@Base 7.8.1 + vgPathTransformedBounds@Base 7.8.1 + vgPointAlongPath@Base 7.8.1 + vgReadPixels@Base 7.8.1 + vgRemovePathCapabilities@Base 7.8.1 + vgRotate@Base 7.8.1 + vgScale@Base 7.8.1 + vgSeparableConvolve@Base 7.8.1 + vgSetColor@Base 7.8.1 + vgSetPaint@Base 7.8.1 + vgSetParameterf@Base 7.8.1 + vgSetParameterfv@Base 7.8.1 + vgSetParameteri@Base 7.8.1 + vgSetParameteriv@Base 7.8.1 + vgSetPixels@Base 7.8.1 + vgSetf@Base 7.8.1 + vgSetfv@Base 7.8.1 + vgSeti@Base 7.8.1 + vgSetiv@Base 7.8.1 + vgShear@Base 7.8.1 + vgTransformPath@Base 7.8.1 + vgTranslate@Base 7.8.1 + vgWritePixels@Base 7.8.1 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11-i686.shlibs +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11-i686.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-7.9~git20100924.orig/debian/libosmesa6.install +++ mesa-7.9~git20100924/debian/libosmesa6.install @@ -0,0 +1,3 @@ +usr/lib/libOSMesa.so.* +usr/lib/libOSMesa16.so.* +usr/lib/libOSMesa32.so.* --- mesa-7.9~git20100924.orig/debian/README.source +++ mesa-7.9~git20100924/debian/README.source @@ -0,0 +1,39 @@ +------------------------------------------------------ +Quick Guide To Patching This Package For The Impatient +------------------------------------------------------ + +1. Make sure you have quilt installed +2. Unpack the package as usual with "dpkg-source -x" +3. Run the "patch" target in debian/rules +4. Create a new patch with "quilt new" (see quilt(1)) +5. Edit all the files you want to include in the patch with "quilt edit" + (see quilt(1)). +6. Write the patch with "quilt refresh" (see quilt(1)) +7. Run the "clean" target in debian/rules + +Alternatively, instead of using quilt directly, you can drop the patch in to +debian/patches and add the name of the patch to debian/patches/series. + + +The X Strike Force team maintains X packages in git repositories on +git.debian.org in the pkg-xorg subdirectory. Most upstream packages +are actually maintained in git repositories as well, so they often +just need to be pulled into git.debian.org in a "upstream-*" branch. + +The .orig.tar.gz upstream source file could be generated this +"upstream-*" branch in the Debian git repository but it is actually +generated from upstream tarballs directly. +Upstream ships Mesa as 2 different tarballs (MesaLib, MesaGLUT) +which are re-bundled together into a single .orig.tar.gz. + +The Debian packaging is added by creating the "debian-*" git branch +which contains the aforementioned "upstream-*" branch plus the debian/ +repository files. +When a patch has to be applied to the Debian package, two solutions +are involved: +* If the patch is available in one of the upstream branches, it + may be git'cherry-picked into the Debian repository. In this + case, it appears directly in the .diff.gz. +* Otherwise, the patch is added to debian/patches/ which is managed + with quilt as documented in /usr/share/doc/quilt/README.source. + Thus, the patching system requires a build dependency on quilt. --- mesa-7.9~git20100924.orig/debian/libosmesa6.shlibs +++ mesa-7.9~git20100924/debian/libosmesa6.shlibs @@ -0,0 +1,3 @@ +libOSMesa 6 libosmesa6 (>= 6.5.2-1) | libgl1-mesa-glide3 +libOSMesa16 6 libosmesa6 (>= 6.5.2-1) +libOSMesa32 6 libosmesa6 (>= 6.5.2-1) --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11.prerm +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11.prerm @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=libgl1-mesa-swx11 +THIS_SCRIPT=prerm + +case "$1" in + remove) + # Use alternatives to make it easier to switch between Mesa and 3rd party modules + update-alternatives --remove gl_conf /usr/lib/GL/ld.so.conf + + # explicit ldconfig due to alternatives + ldconfig + +esac + +#DEBHELPER# + +exit 0 + +# vim:set ai et sw=2 ts=2 tw=80: + --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-glx.shlibs +++ mesa-7.9~git20100924/debian/libgl1-mesa-glx.shlibs @@ -0,0 +1 @@ +libGL 1 libgl1-mesa-glx | libgl1 --- mesa-7.9~git20100924.orig/debian/README.Debian +++ mesa-7.9~git20100924/debian/README.Debian @@ -0,0 +1,18 @@ +Documentation for the libegl1-x11, libgles1, libgles2, and libopenvg1 virtual +packages. + +Although there are is no standardised linux ABI for GL|ES or OpenVG, there is +a “strongly encouraged†set of standard headers, type and linkage definitions +supplied by the Khronos group[1]. The mesa implementation provides this ABI. +Any non-mesa implementation that wants to provide these packages should +conform to the Khronos group's de-facto ABI. + +The case of EGL is similar; Khronos again supplies a de-facto linux ABI. +The EGL ABI is necessarily tied to the native windowing system by the +eglNativeDisplayType, eglNativeWindowType, and eglNativePixmapType typedefs. +The EGL virtual package therefore includes the name of the x11 windowing +system to leave room should further windowing ABIs be standardised. + +[1]: http://www.khronos.org/registry/implementers_guide.html#uncontrolled + + -- Christopher James Halse Rogers , Fri, 30 Jul 2010 17:55:56 +1000 --- mesa-7.9~git20100924.orig/debian/control +++ mesa-7.9~git20100924/debian/control @@ -0,0 +1,675 @@ +Source: mesa +Section: graphics +Priority: optional +Maintainer: Ubuntu X-SWAT +XSBC-Original-Maintainer: Debian X Strike Force +Uploaders: David Nusinow , Brice Goglin +Standards-Version: 3.8.4 +Build-Depends: debhelper (>= 7.2.7), quilt (>= 0.40), pkg-config, + libdrm-dev (>= 2.4.19) [!hurd-i386], libx11-dev, xutils-dev, + x11proto-gl-dev (>= 1.4.11), libxxf86vm-dev, + libexpat1-dev, dpkg-dev (>= 1.15.6), libxfixes-dev, + libxdamage-dev, libxext-dev, autoconf, automake, x11proto-dri2-dev (>= 2.1), + linux-libc-dev (>= 2.6.31) [!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386], + libx11-xcb-dev, libxcb-dri2-0-dev, libxcb-xfixes0-dev, python-libxml2, + libtalloc-dev +Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa +Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git +Homepage: http://mesa3d.sourceforge.net/ + +Package: libgl1-mesa-swx11 +Section: libs +Priority: extra +Architecture: any +Depends: + libosmesa6 (>= 6.5.2-1), + ${shlibs:Depends}, + ${misc:Depends}, +Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast +Provides: libgl1, mesag3, libgl1-mesa-swrast +Replaces: libgl1, mesag3, libgl1-mesa-swrast +Description: A free implementation of the OpenGL API -- runtime + Mesa is a 3-D graphics library with an API which is very similar to + that of OpenGL. To the extent that Mesa utilizes the OpenGL command + syntax or state machine, it is being used with authorization from + Silicon Graphics, Inc. However, the author makes no claim that Mesa + is in any way a compatible replacement for OpenGL or associated with + Silicon Graphics, Inc. + . + This library provides a pure software rasteriser; it does not provide + a direct rendering-capable library, or one which uses GLX. For that, + please see libgl1-mesa-glx. + . + On Linux, this library is also known as libGL or libGL.so.1. + +Package: libgl1-mesa-swx11-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgl1-mesa-swx11 (= ${binary:Version}), + ${misc:Depends}, +Conflicts: libgl1-mesa-swrast-dbg +Provides: libgl1-mesa-swrast-dbg +Replaces: libgl1-mesa-swrast-dbg +Description: A free implementation of the OpenGL API -- debugging symbols + Mesa is a 3-D graphics library with an API which is very similar to + that of OpenGL. To the extent that Mesa utilizes the OpenGL command + syntax or state machine, it is being used with authorization from + Silicon Graphics, Inc. However, the author makes no claim that Mesa + is in any way a compatible replacement for OpenGL or associated with + Silicon Graphics, Inc. + . + This library provides a pure software rasteriser; it does not provide + a direct rendering-capable library, or one which uses GLX. For that, + please see libgl1-mesa-glx. + . + On Linux, this library is also known as libGL or libGL.so.1. + . + This package contains debugging symbols for the software rasterization GL + library. + +# Package: libgl1-mesa-swx11-i686 +# Section: libs +# Priority: extra +# Architecture: i386 kfreebsd-i386 hurd-i386 +# Depends: +# libgl1-mesa-swx11 (= ${binary:Version}), +# ${shlibs:Depends}, +# ${misc:Depends}, +# Description: Mesa OpenGL runtime [i686 optimized] +# Mesa is a 3-D graphics library with an API which is very similar to +# that of OpenGL. To the extent that Mesa utilizes the OpenGL command +# syntax or state machine, it is being used with authorization from +# Silicon Graphics, Inc. However, the author makes no claim that Mesa +# is in any way a compatible replacement for OpenGL or associated with +# Silicon Graphics, Inc. +# . +# This library provides a pure software rasteriser; it does not provide +# a direct rendering-capable library, or one which uses GLX. For that, +# please see libgl1-mesa-glx. +# . +# On Linux, this library is also known as libGL or libGL.so.1. +# . +# This set of libraries is optimized for i686 machines and will only be used if +# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro, +# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones +# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla). + +Package: libgl1-mesa-swx11-dev +Section: libdevel +Priority: extra +Architecture: any +Depends: + libgl1-mesa-swx11 (= ${binary:Version}), + libx11-dev, + libxext6, + mesa-common-dev (= ${binary:Version}), + ${misc:Depends}, +Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev +Conflicts: mesa-dev, libgl-dev, mesag3 (<< 3.1-1), nvidia-glx-dev, mesag-dev, libgl1-mesa-swrast-dev +Replaces: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev +Description: A free implementation of the OpenGL API -- development files + This package provides the development environment required for + compiling programs with Mesa. For a complete description of Mesa, + please look at the libgl1-mesa-swx11 package. + . + This library provides a pure software rasteriser; it does not provide + a direct rendering-capable library, or one which uses GLX. For that, + please see libgl1-mesa-dev. + +Package: libegl1-mesa +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Recommends: libegl1-mesa-drivers +Provides: libegl1-x11 +Conflicts: libegl1-x11 +Replaces: libegl1-x11 +Description: A free implementation of the EGL API -- runtime + This package contains the EGL native platform graphics interface library. + EGL provides a platform-agnostic mechanism for creating rendering surfaces + for use with other graphics libraries, such as OpenGL|ES and OpenVG. + . + This package contains modules to interface with the existing system GLX or + DRI2 drivers to provide OpenGL via EGL. The libegl1-mesa-drivers package + provides drivers to provide hardware-accelerated OpenGL|ES and OpenVG support. + +Package: libegl1-mesa-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libegl1-mesa (= ${binary:Version}), + ${misc:Depends}, +Description: A free implementation of the EGL API -- debugging symbols + This package contains the EGL native platform graphics interface library. + EGL provides a platform-agnostic mechanism for creating rendering surfaces + for use with other graphics libraries, such as OpenGL|ES and OpenVG. + . + This package contains the debugging symbols for the EGL library. + +Package: libegl1-mesa-dev +Section: libdevel +Architecture: any +Depends: + libegl1-mesa (= ${binary:Version}), + libdrm-dev (>= 2.4.19) [!hurd-i386], + x11proto-dri2-dev (>= 2.1), + x11proto-gl-dev (>= 1.4.11), + libx11-dev, + libxext-dev, + libxxf86vm-dev, + libxdamage-dev, + libxfixes-dev, + ${misc:Depends}, +Description: A free implementation of the EGL API -- development files + This package contains the development environment required for compiling + programs against EGL native platform graphics interface library. + EGL provides a platform-agnostic mechanism for creating rendering surfaces + for use with other graphics libraries, such as OpenGL|ES and OpenVG. + . + This package provides the development environment for compiling programs + against the EGL library. + +Package: libegl1-mesa-drivers +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + libegl1-mesa (= ${binary:Version}), +Description: A free implementation of the EGL API -- hardware drivers. + This package contains the EGL native platform graphics interface library. + EGL provides a platform-agnostic mechanism for creating rendering surfaces + for use with other graphics libraries, such as OpenGL|ES and OpenVG. + . + This package contains the drivers required for hardware accelerated rendering + of EGL-based graphics libraries, such as OpenGL|ES and OpenVG. + +Package: libegl1-mesa-drivers-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libegl1-mesa-drivers (= ${binary:Version}), + ${misc:Depends}, +Description: A free implementation of the EGL API -- driver debugging symbols + This package contains the EGL native platform graphics interface library. + EGL provides a platform-agnostic mechanism for creating rendering surfaces + for use with other graphics libraries, such as OpenGL|ES and OpenVG. + . + This package contains the debugging symbols for the drivers required for + hardware accelerated rendering of EGL-based graphics libraries. + +Package: libopenvg1-mesa +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Provides: libopenvg1 +Conflicts: libopenvg1 +Replaces: libopenvg1 +Description: A free implementation of the OpenVG API -- runtime + This package contains the mesa implementation of the OpenVG 2D acceleration + library. OpenVG provides a device independent and vendor-neutral interface + for sophisticated 2D graphical applications, while allowing device + manufacturers to provide hardware acceleration on devices ranging from wrist + watches to full microprocessor-based desktop and server machines. + +Package: libopenvg1-mesa-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libopenvg1-mesa (= ${binary:Version}), + ${misc:Depends}, +Description: A free implementation of the OpenVG API -- debugging symbols + This package contains the mesa implementation of the OpenVG 2D acceleration + library. OpenVG provides a device independent and vendor-neutral interface + for sophisticated 2D graphical applications, while allowing device + manufacturers to provide hardware acceleration on devices ranging from wrist + watches to full microprocessor-based desktop and server machines. + . + This package contains the debugging symbols for the OpenVG library. + +Package: libopenvg1-mesa-dev +Section: libdevel +Architecture: any +Depends: + libopenvg1-mesa (= ${binary:Version}), + libegl1-mesa-dev, + ${misc:Depends}, +Description: A free implementation of the OpenVG API -- development files + This package contains the mesa implementation of the OpenVG 2D acceleration + library. OpenVG provides a device independent and vendor-neutral interface + for sophisticated 2D graphical applications, while allowing device + manufacturers to provide hardware acceleration on devices ranging from wrist + watches to full microprocessor-based desktop and server machines. + . + This package contains the development environment required for compiling + programs against the OpenVG 2D acceleration library. + +Package: libgles1-mesa +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Provides: libgles1 +Conflicts: libgles1 +Replaces: libgles1 +Description: A free implementation of the OpenGL|ES 1.x API -- runtime + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 1.x provides an API for fixed-function hardware. + +Package: libgles1-mesa-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgles1-mesa (= ${binary:Version}), + ${misc:Depends}, +Description: A free implementation of the OpenGL|ES 1.x API -- debugging symbols + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 1.x provides an API for fixed-function hardware. + . + This package contains the debugging symbols for the libGLESv1_CM library. + +Package: libgles1-mesa-dev +Section: libdevel +Architecture: any +Depends: + libgles1-mesa (= ${binary:Version}), + libegl1-mesa-dev, + ${misc:Depends}, +Description: A free implementation of the OpenGL|ES 1.x API -- development files + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 1.x provides an API for fixed-function hardware. + . + This package provides a development environment for building programs using + the OpenGL|ES 1.x APIs. + +Package: libgles2-mesa +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Provides: libgles2 +Conflicts: libgles2 +Replaces: libgles2 +Description: A free implementation of the OpenGL|ES 2.x API -- runtime + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 2.x provides an API for programmable hardware including vertex + and fragment shaders. + +Package: libgles2-mesa-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgles2-mesa (= ${binary:Version}), + ${misc:Depends}, +Description: A free implementation of the OpenGL|ES 2.x API -- debugging symbols + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 2.x provides an API for programmable hardware including vertex + and fragment shaders. + . + This package contains the debugging symbols for the libGLESv2 library. + +Package: libgles2-mesa-dev +Section: libdevel +Architecture: any +Depends: + libgles2-mesa (= ${binary:Version}), + libegl1-mesa-dev, + ${misc:Depends}, +Description: A free implementation of the OpenGL|ES 2.x API -- development files + OpenGL|ES is a cross-platform API for full-function 2D and 3D graphics on + embedded systems - including consoles, phones, appliances and vehicles. + It contains a subset of OpenGL plus a number of extensions for the + special needs of embedded systems. + . + OpenGL|ES 2.x provides an API for programmable hardware including vertex + and fragment shaders. + . + This package provides a development environment for building applications + using the OpenGL|ES 2.x APIs. + +Package: libgl1-mesa-glx +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends} +Recommends: libgl1-mesa-dri (>= 7.2) +Conflicts: libgl1, libgl1-mesa-dri (<< 6.4.0) +Replaces: libgl1, libgl1-mesa-dri (<< 6.4.0) +Provides: libgl1 +Description: A free implementation of the OpenGL API -- GLX runtime + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the modules themselves: these can be found + in the libgl1-mesa-dri package. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + +Package: libgl1-mesa-glx-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgl1-mesa-glx (= ${binary:Version}), + ${misc:Depends}, +Description: Debugging symbols for the Mesa GLX runtime + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the modules themselves: these can be found + in the libgl1-mesa-dri package. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + . + This package contains debugging symbols for the GL library with GLX and DRI + capabilities. + +#Package: libgl1-mesa-glx-i686 +#Section: libs +#Priority: extra +#Architecture: i386 kfreebsd-i386 hurd-i386 +#Pre-Depends: libgl1-mesa-glx +#Description: A free implementation of the OpenGL API -- GLX runtime [i686 optimized] +# This version of Mesa provides GLX and DRI capabilities: it is capable of +# both direct and indirect rendering. For direct rendering, it can use DRI +# modules from the libgl1-mesa-dri package to accelerate drawing. +# . +# This package does not include the modules themselves: these can be found +# in the libgl1-mesa-dri package. +# . +# For a complete description of Mesa, please look at the +# libgl1-mesa-swx11 package. +# . +# This set of libraries is optimized for i686 machines and will only be used if +# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro, +# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones +# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla). + +Package: libgl1-mesa-dri +Section: libs +Priority: optional +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends} +Suggests: libglide3 +Conflicts: xlibmesa-dri (<< 1:7.0.0) +Replaces: xlibmesa-dri (<< 1:7.0.0) +Breaks: xserver-xorg-core (<< 2:1.5), libgl1-mesa-glx (<< 7.2) +Description: A free implementation of the OpenGL API -- DRI modules + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the OpenGL library itself, only the DRI + modules for accelerating direct rendering. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + . + The tdfx DRI module needs libglide3 to enable direct rendering. + +Package: libgl1-mesa-dri-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgl1-mesa-dri (= ${binary:Version}), + ${misc:Depends}, +Description: Debugging symbols for the Mesa DRI modules + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the OpenGL library itself, only the DRI + modules for accelerating direct rendering. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + . + This package contains debugging symbols for the DRI modules. + +Package: libgl1-mesa-dri-experimental +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Description: A free implementation of the OpenGL API -- Extra DRI modules + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the OpenGL library itself, only the DRI + modules for accelerating direct and indirect rendering. The drivers + in this package may provide more features than the drivers in the + libgl1-mesa-dri at the cost of less stability. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + +Package: libgl1-mesa-dri-experimental-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libgl1-mesa-dri-experimental (= ${binary:Version}), + ${misc:Depends}, +Description: Debugging symbols for the experimental Mesa DRI modules + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package does not include the OpenGL library itself, only the DRI + modules for accelerating direct rendering. + . + For a complete description of Mesa, please look at the + libgl1-mesa-swx11 package. + . + This package contains debugging symbols for the extra DRI modules. + +#Package: libgl1-mesa-dri-i686 +#Section: libs +#Priority: extra +#Architecture: i386 kfreebsd-i386 hurd-i386 +#Pre-Depends: libgl1-mesa-dri +#Description: A free implementation of the OpenGL API -- DRI modules [i686 optimized] +# This version of Mesa provides GLX and DRI capabilities: it is capable of +# both direct and indirect rendering. For direct rendering, it can use DRI +# modules from the libgl1-mesa-dri package to accelerate drawing. +# . +# This package does not include the OpenGL library itself, only the DRI +# modules for accelerating direct rendering. +# . +# For a complete description of Mesa, please look at the +# libgl1-mesa-swx11 package. +# . +# This set of libraries is optimized for i686 machines and will only be used if +# you are running a 2.6 kernel on an i686 class CPU. This includes Pentium Pro, +# Pentium II/II/IV, Celeron CPU's and similar class CPU's (including clones +# such as AMD Athlon/Opteron, VIA C3 Nehemiah, but not VIA C3 Ezla). + +Package: libgl1-mesa-dev +Section: libdevel +Architecture: any +Depends: + mesa-common-dev (= ${binary:Version}), + libgl1-mesa-glx (= ${binary:Version}), + ${misc:Depends}, +Conflicts: libgl-dev, libgl1-mesa-dri-dev +Replaces: libgl-dev, libgl1-mesa-dri-dev +Provides: libgl-dev, libgl1-mesa-dri-dev +Description: A free implementation of the OpenGL API -- GLX development files + This version of Mesa provides GLX and DRI capabilities: it is capable of + both direct and indirect rendering. For direct rendering, it can use DRI + modules from the libgl1-mesa-dri package to accelerate drawing. + . + This package includes headers and static libraries for compiling + programs with Mesa. + . + For a complete description of Mesa, please look at the libgl1-mesa-swx11 + package. + +Package: mesa-common-dev +Section: libdevel +Architecture: any +Replaces: xlibmesa-gl-dev (<< 1:7), xlibosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), libgl1-mesa-dev (<< 7.5~rc4-2) +Depends: + libx11-dev, + libdrm-dev, + ${misc:Depends}, +Description: Developer documentation for Mesa + This package includes the specifications for the Mesa-specific OpenGL + extensions, the complete set of release notes and the development header + files common to all Mesa packages. + +Package: libosmesa6 +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Replaces: libgl1-mesa-swx11 (<< 6.5.2) +Description: Mesa Off-screen rendering extension + OSmesa is a Mesa extension that allows programs to render to an + off-screen buffer using the OpenGL API without having to create a + rendering context on an X Server. It uses a pure software renderer. + . + This package provides both 16-bit and 32-bit versions of the off-screen + renderer which do not require external libraries to work. + +Package: libosmesa6-dev +Section: libdevel +Architecture: any +Depends: + libosmesa6 (= ${binary:Version}), + mesa-common-dev (= ${binary:Version}) | libgl-dev, + ${misc:Depends}, +Conflicts: xlibosmesa-dev, libosmesa4-dev, libosmesa-dev +Replaces: xlibosmesa-dev, libosmesa-dev, libgl1-mesa-swx11-dev (<< 6.5.2), mesa-common-dev (<< 6.5.2) +Provides: xlibosmesa-dev, libosmesa-dev +Description: Mesa Off-screen rendering extension -- development files + This package provides the required environment for developing programs + that use the off-screen rendering extension of Mesa. + . + For more information on OSmesa see the libosmesa6 package. + +Package: libglu1-mesa +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Provides: libglu1 +Conflicts: mesag3 (<< 5.0.0-1), xlibmesa3, libglu1 +Replaces: libglu1 +Description: The OpenGL utility library (GLU) + GLU offers simple interfaces for building mipmaps; checking for the + presence of extensions in the OpenGL (or other libraries which follow + the same conventions for advertising extensions); drawing + piecewise-linear curves, NURBS, quadrics and other primitives + (including, but not limited to, teapots); tesselating surfaces; setting + up projection matrices and unprojecting screen coordinates to world + coordinates. + . + On Linux, this library is also known as libGLU or libGLU.so.1. + . + This package provides the SGI implementation of GLU shipped with the + Mesa package (ergo the "-mesa" suffix). + +Package: libglu1-mesa-dev +Section: libdevel +Architecture: any +Depends: + libglu1-mesa (= ${binary:Version}), + libgl1-mesa-dev | libgl-dev, + ${misc:Depends}, +Provides: libglu-dev, xlibmesa-glu-dev +Conflicts: mesag-dev (<< 5.0.0-1), mesa-glide2-dev (<< 5.0.0-1), mesag3+ggi-dev (<< 5.0.0-1), xlibmesa-dev +Replaces: libglu-dev +Description: The OpenGL utility library -- development files + Includes headers and static libraries for compiling programs with GLU. + . + For a complete description of GLU, please look at the libglu1-mesa + package. + +# Package: libglw1-mesa +# Section: libs +# Architecture: any +# Depends: +# ${shlibs:Depends}, +# ${misc:Depends}, +# Provides: libglw1 +# Description: A free implementation of the OpenGL API -- runtime +# Mesa is a 3-D graphics library with an API which is very similar to +# that of OpenGL. To the extent that Mesa utilizes the OpenGL command +# syntax or state machine, it is being used with authorization from +# Silicon Graphics, Inc. However, the author makes no claim that Mesa +# is in any way a compatible replacement for OpenGL or associated with +# Silicon Graphics, Inc. +# . +# This package provides a simple widgets library, libGLw, which +# allows Motif-based applications to embed an OpenGL drawing context. +# . +# On Linux, this library is also known as libGLw or libGLw.so.1. + +# Package: libglw1-mesa-dev +# Section: libdevel +# Architecture: any +# Depends: +# libglw1-mesa (= ${binary:Version}), +# libx11-dev, +# libxt-dev, +# lesstif2-dev, +# mesa-common-dev (= ${binary:Version}), +# ${shlibs:Depends}, +# ${misc:Depends}, +# Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev +# Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4) +# Replaces: libglw-dev +# Description: A free implementation of the OpenGL API -- development files +# This package provides the development environment required for +# compiling programs with the Mesa widgets library, libGLw, which +# allows Motif-based applications to embed an OpenGL drawing context. +# The headers and static libraries for compiling programs that use this +# library are included. + +# vim: tw=0 --- mesa-7.9~git20100924.orig/debian/compat +++ mesa-7.9~git20100924/debian/compat @@ -0,0 +1 @@ +7 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-dev.links +++ mesa-7.9~git20100924/debian/libgl1-mesa-dev.links @@ -0,0 +1 @@ +/usr/lib/mesa/libGL.so /usr/lib/libGL.so --- mesa-7.9~git20100924.orig/debian/libgles2-mesa.install +++ mesa-7.9~git20100924/debian/libgles2-mesa.install @@ -0,0 +1,2 @@ +dri/usr/lib/libGLESv2.so.2* usr/lib +dri/usr/lib/egl/st_GLESv2.so usr/lib/egl --- mesa-7.9~git20100924.orig/debian/libglu1-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libglu1-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGLU1 --- mesa-7.9~git20100924.orig/debian/mesa-common-dev.install +++ mesa-7.9~git20100924/debian/mesa-common-dev.install @@ -0,0 +1,8 @@ +dri/usr/include/GL/gl.h usr/include/GL +dri/usr/include/GL/glext.h usr/include/GL +dri/usr/include/GL/gl_mangle.h usr/include/GL +dri/usr/include/GL/glx.h usr/include/GL +dri/usr/include/GL/glxext.h usr/include/GL +dri/usr/include/GL/glx_mangle.h usr/include/GL +dri/usr/include/GL/internal/dri_interface.h usr/include/GL/internal +dri/usr/lib/pkgconfig/dri.pc usr/lib/pkgconfig/ --- mesa-7.9~git20100924.orig/debian/libglu1-mesa.install +++ mesa-7.9~git20100924/debian/libglu1-mesa.install @@ -0,0 +1 @@ +usr/lib/libGLU.so.* --- mesa-7.9~git20100924.orig/debian/libglu1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libglu1-mesa-dev.install @@ -0,0 +1,5 @@ +usr/include/GL/glu.h +usr/include/GL/glu_mangle.h +usr/lib/libGLU.a +usr/lib/libGLU.so +usr/lib/pkgconfig/glu.pc --- mesa-7.9~git20100924.orig/debian/libglw1-mesa-dev.install +++ mesa-7.9~git20100924/debian/libglw1-mesa-dev.install @@ -0,0 +1,4 @@ +usr/include/GL/GLw*A.h +usr/lib/libGLw.a +usr/lib/libGLw.so +usr/lib/pkgconfig/glw.pc --- mesa-7.9~git20100924.orig/debian/gbp.conf +++ mesa-7.9~git20100924/debian/gbp.conf @@ -0,0 +1,4 @@ +[DEFAULT] +debian-branch=ubuntu-maverick +upstream-branch=upstream-maverick +pristine-tar=true --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-dri-i686.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-dri-i686.install @@ -0,0 +1 @@ +dri/usr/lib/dri/i686/cmov/*.so --- mesa-7.9~git20100924.orig/debian/libgles2-mesa.lintian-overrides +++ mesa-7.9~git20100924/debian/libgles2-mesa.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGLESv2-2 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11.lintian-overrides +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11.lintian-overrides @@ -0,0 +1 @@ +package-name-doesnt-match-sonames libGL1 --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11-i686.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11-i686.install @@ -0,0 +1 @@ +usr/lib/i686/cmov/libGL.so.* --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-dri-experimental.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-dri-experimental.install @@ -0,0 +1 @@ +build/dri/lib/gallium/*_dri.so usr/lib/dri --- mesa-7.9~git20100924.orig/debian/libglu1-mesa.shlibs +++ mesa-7.9~git20100924/debian/libglu1-mesa.shlibs @@ -0,0 +1 @@ +libGLU 1 libglu1-mesa | libglu1 --- mesa-7.9~git20100924.orig/debian/libosmesa6-dev.install +++ mesa-7.9~git20100924/debian/libosmesa6-dev.install @@ -0,0 +1,8 @@ +usr/include/GL/osmesa.h +usr/lib/libOSMesa.a +usr/lib/libOSMesa.so +usr/lib/libOSMesa16.a +usr/lib/libOSMesa16.so +usr/lib/libOSMesa32.a +usr/lib/libOSMesa32.so +usr/lib/pkgconfig/osmesa.pc --- mesa-7.9~git20100924.orig/debian/libgl1-mesa-swx11-dev.install +++ mesa-7.9~git20100924/debian/libgl1-mesa-swx11-dev.install @@ -0,0 +1,2 @@ +usr/lib/libGL.a usr/lib/mesa/ +usr/lib/libGL.so usr/lib/mesa/ --- mesa-7.9~git20100924.orig/debian/libegl1-mesa.symbols +++ mesa-7.9~git20100924/debian/libegl1-mesa.symbols @@ -0,0 +1,63 @@ +libEGL.so.1 libegl1-mesa #MINVER# | libegl1-x11 + # These are all internal symbols between libEGL and the + # drivers. Handle the dependency explicitly in the driver + # package. + (regex)"^_egl.*@Base$" 7.8.1 + # Public symbols + eglBindAPI@Base 7.8.1 + eglBindTexImage@Base 7.8.1 + eglChooseConfig@Base 7.8.1 + eglChooseModeMESA@Base 7.8.1 + eglClientWaitSyncKHR@Base 7.9~git20100825 + eglCopyBuffers@Base 7.8.1 + eglCopyContextMESA@Base 7.8.1 + eglCreateContext@Base 7.8.1 + eglCreateDRMImageMESA@Base 7.9~git20100825 + eglCreateImageKHR@Base 7.8.1 + eglCreatePbufferFromClientBuffer@Base 7.8.1 + eglCreatePbufferSurface@Base 7.8.1 + eglCreatePixmapSurface@Base 7.8.1 + eglCreateScreenSurfaceMESA@Base 7.8.1 + eglCreateSyncKHR@Base 7.9~git20100825 + eglCreateWindowSurface@Base 7.8.1 + eglDestroyContext@Base 7.8.1 + eglDestroyImageKHR@Base 7.8.1 + eglDestroySurface@Base 7.8.1 + eglDestroySyncKHR@Base 7.9~git20100825 + eglExportDRMImageMESA@Base 7.9~git20100825 + eglGetConfigAttrib@Base 7.8.1 + eglGetConfigs@Base 7.8.1 + eglGetCurrentContext@Base 7.8.1 + eglGetCurrentDisplay@Base 7.8.1 + eglGetCurrentSurface@Base 7.8.1 + eglGetDRMDisplayMESA@Base 7.9~git20100825 + eglGetDisplay@Base 7.8.1 + eglGetError@Base 7.8.1 + eglGetModeAttribMESA@Base 7.8.1 + eglGetSyncAttribKHR@Base 7.9~git20100825 + eglGetModesMESA@Base 7.8.1 + eglGetProcAddress@Base 7.8.1 + eglGetScreensMESA@Base 7.8.1 + eglInitialize@Base 7.8.1 + eglMakeCurrent@Base 7.8.1 + eglQueryAPI@Base 7.8.1 + eglQueryContext@Base 7.8.1 + eglQueryModeStringMESA@Base 7.8.1 + eglQueryScreenMESA@Base 7.8.1 + eglQueryScreenModeMESA@Base 7.8.1 + eglQueryScreenSurfaceMESA@Base 7.8.1 + eglQueryString@Base 7.8.1 + eglQuerySurface@Base 7.8.1 + eglReleaseTexImage@Base 7.8.1 + eglReleaseThread@Base 7.8.1 + eglScreenPositionMESA@Base 7.8.1 + eglShowScreenSurfaceMESA@Base 7.8.1 + eglSignalSyncKHR@Base 7.9~git20100825 + eglSurfaceAttrib@Base 7.8.1 + eglSwapBuffers@Base 7.8.1 + eglSwapBuffersRegionNOK@Base 7.9~git20100825 + eglSwapInterval@Base 7.8.1 + eglTerminate@Base 7.8.1 + eglWaitClient@Base 7.8.1 + eglWaitGL@Base 7.8.1 + eglWaitNative@Base 7.8.1 --- mesa-7.9~git20100924.orig/debian/scripts/choose-configs +++ mesa-7.9~git20100924/debian/scripts/choose-configs @@ -0,0 +1,47 @@ +# Script to choose which configurations are to be built depending on the value +# of the DEB_BUILD_ARCH variable. +# +# Copyright © 2006 Thierry Reding + +############################################################################## +## architecture-specific configurations ###################################### + +# choose an architecture-specific build of swx11 and GLU if a matching +# configuration exists +#ifneq ($(wildcard configs/debian-swx11+glu-$(DEB_BUILD_ARCH)),) +# SWX11_GLU_CONFIGS := debian-swx11+glu-$(DEB_BUILD_ARCH) +#else +# SWX11_GLU_CONFIGS := debian-swx11+glu-any +#endif + +# same for static builds +#ifneq ($(wildcard configs/debian-swx11+glu-static-$(DEB_BUILD_ARCH)),) +# SWX11_GLU_CONFIGS += debian-swx11+glu-static-$(DEB_BUILD_ARCH) +#else +# SWX11_GLU_CONFIGS += debian-swx11+glu-static-any +#endif + +SWX11_GLU_CONFIGS := swx11+glu swx11+glu-static + +############################################################################## +## CPU-optimized configurations ############################################## + +#ifneq (,$(filter $(DEB_BUILD_ARCH), i386 kfreebsd-i386 hurd-i386)) +# SWX11_GLU_CONFIGS += swx11+glu-i386-i686 +# DRI_CONFIGS += debian-dri-i386-i686 +#endif + +#ifeq ($(DEB_BUILD_ARCH), alpha) +# SWX11_GLU_CONFIGS += debian-swx11+glu-alpha-ev5 +#endif + +#ifeq ($(DEB_BUILD_ARCH), powerpc) +# SWX11_GLU_CONFIGS += debian-swx11+glu-powerpc-603 +#endif + +#ifeq ($(DEB_BUILD_ARCH), sparc) +# SWX11_GLU_CONFIGS += debian-swx11+glu-sparc-ultrasparc +#endif + +# vim: ft=make + --- mesa-7.9~git20100924.orig/debian/patches/104_i915_fragment_shader_disable.patch +++ mesa-7.9~git20100924/debian/patches/104_i915_fragment_shader_disable.patch @@ -0,0 +1,26 @@ +From e5a4106be7c8b87821f6b5d21fec99a402825740 Mon Sep 17 00:00:00 2001 +From: Robert Hooker +Date: Wed, 8 Sep 2010 12:33:09 -0400 +Subject: [PATCH] Revert "i915: Enable ARB_fragment_shader by default." + +This reverts commit a58514cc9c5cc5867f9140700462c5ac5749550d. +--- + src/mesa/drivers/dri/intel/intel_screen.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c +index 0a542a7..8ae2cd2 100644 +--- a/src/mesa/drivers/dri/intel/intel_screen.c ++++ b/src/mesa/drivers/dri/intel/intel_screen.c +@@ -70,7 +70,7 @@ PUBLIC const char __driConfigOptions[] = + DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).") + DRI_CONF_OPT_END + +- DRI_CONF_OPT_BEGIN(fragment_shader, bool, true) ++ DRI_CONF_OPT_BEGIN(fragment_shader, bool, false) + DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.") + DRI_CONF_OPT_END + +-- +1.7.2 + --- mesa-7.9~git20100924.orig/debian/patches/100_no_abi_tag.patch +++ mesa-7.9~git20100924/debian/patches/100_no_abi_tag.patch @@ -0,0 +1,42 @@ +--- a/src/mapi/glapi/glapi_x86-64.S ++++ b/src/mapi/glapi/glapi_x86-64.S +@@ -30885,18 +30885,6 @@ GL_PREFIX(EGLImageTargetTexture2DOES): + .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT) + .globl GL_PREFIX(ProvokingVertex) ; .set GL_PREFIX(ProvokingVertex), GL_PREFIX(ProvokingVertexEXT) + +-#if defined(GLX_USE_TLS) && defined(__linux__) +- .section ".note.ABI-tag", "a" +- .p2align 2 +- .long 1f - 0f /* name length */ +- .long 3f - 2f /* data length */ +- .long 1 /* note length */ +-0: .asciz "GNU" /* vendor name */ +-1: .p2align 2 +-2: .long 0 /* note data: the ABI tag */ +- .long 2,4,20 /* Minimum kernel version w/TLS */ +-3: .p2align 2 /* pad out section */ +-#endif /* GLX_USE_TLS */ + + #if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +--- a/src/mapi/glapi/glapi_x86.S ++++ b/src/mapi/glapi/glapi_x86.S +@@ -1279,18 +1279,6 @@ GLNAME(gl_dispatch_functions_start): + ALIGNTEXT16 + GLNAME(gl_dispatch_functions_end): + +-#if defined(GLX_USE_TLS) && defined(__linux__) +- .section ".note.ABI-tag", "a" +- .p2align 2 +- .long 1f - 0f /* name length */ +- .long 3f - 2f /* data length */ +- .long 1 /* note length */ +-0: .asciz "GNU" /* vendor name */ +-1: .p2align 2 +-2: .long 0 /* note data: the ABI tag */ +- .long 2,4,20 /* Minimum kernel version w/TLS */ +-3: .p2align 2 /* pad out section */ +-#endif /* GLX_USE_TLS */ + + #if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits --- mesa-7.9~git20100924.orig/debian/patches/04_osmesa_version.diff +++ mesa-7.9~git20100924/debian/patches/04_osmesa_version.diff @@ -0,0 +1,17 @@ +--- + src/mesa/drivers/osmesa/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mesa/src/mesa/drivers/osmesa/Makefile +=================================================================== +--- mesa.orig/src/mesa/drivers/osmesa/Makefile 2010-09-01 10:15:50.000000000 +1000 ++++ mesa/src/mesa/drivers/osmesa/Makefile 2010-09-01 10:22:30.000000000 +1000 +@@ -37,7 +37,7 @@ + # -DCHAN_BITS=16/32. + $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(CORE_MESA) + $(MKLIB) -o $(OSMESA_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ +- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ ++ -major 6 -minor 5 -patch 3 \ + -install $(TOP)/$(LIB_DIR) -cplusplus $(MKLIB_OPTIONS) \ + -id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \ + $(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA) --- mesa-7.9~git20100924.orig/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch +++ mesa-7.9~git20100924/debian/patches/02_use-ieee-fp-on-s390-and-m68k.patch @@ -0,0 +1,21 @@ +Patch that fixes Debian bug #349437. + +This patch by David Nusinow. + +--- + src/mesa/main/compiler.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/mesa/main/compiler.h ++++ b/src/mesa/main/compiler.h +@@ -353,8 +353,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint + * USE_IEEE: Determine if we're using IEEE floating point + */ + #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ +- defined(__s390x__) || defined(__powerpc__) || \ ++ defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ + defined(__x86_64__) || \ ++ defined(__m68k__) || \ + defined(ia64) || defined(__ia64__) || \ + defined(__hppa__) || defined(hpux) || \ + defined(__mips) || defined(_MIPS_ARCH) || \ --- mesa-7.9~git20100924.orig/debian/patches/05_hurd-ftbfs.diff +++ mesa-7.9~git20100924/debian/patches/05_hurd-ftbfs.diff @@ -0,0 +1,59 @@ +From: Samuel Thibault +Subject: Fix build on GNU/Hurd + +--- + configure.ac | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +Index: mesa/configure.ac +=================================================================== +--- mesa.orig/configure.ac ++++ mesa/configure.ac +@@ -585,6 +585,13 @@ + enable_xcb=no + fi + ++dnl Direct rendering or just indirect rendering ++AC_ARG_ENABLE([driglx-direct], ++ [AS_HELP_STRING([--disable-driglx-direct], ++ [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])], ++ [driglx_direct="$enableval"], ++ [driglx_direct="yes"]) ++ + dnl + dnl libGL configuration per driver + dnl +@@ -618,12 +625,14 @@ + AC_MSG_ERROR([Can't use static libraries for DRI drivers]) + fi + +- # Check for libdrm +- PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED]) +- PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) +- PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) +- GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED" +- DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" ++ if test x"$driglx_direct" = xyes; then ++ # Check for libdrm ++ PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED]) ++ PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) ++ PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) ++ GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED" ++ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" ++ fi + + # find the DRI deps for libGL + if test "$x11_pkgconfig" = yes; then +@@ -697,12 +706,6 @@ + [DRI_DRIVER_SEARCH_DIR="$withval"], + [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}']) + AC_SUBST([DRI_DRIVER_SEARCH_DIR]) +-dnl Direct rendering or just indirect rendering +-AC_ARG_ENABLE([driglx-direct], +- [AS_HELP_STRING([--disable-driglx-direct], +- [enable direct rendering in GLX and EGL for DRI @<:@default=enabled@:>@])], +- [driglx_direct="$enableval"], +- [driglx_direct="yes"]) + dnl Which drivers to build - default is chosen by platform + AC_ARG_WITH([dri-drivers], + [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], --- mesa-7.9~git20100924.orig/debian/patches/06_kfreebsd-ftbfs.diff +++ mesa-7.9~git20100924/debian/patches/06_kfreebsd-ftbfs.diff @@ -0,0 +1,23 @@ +From: Aurelien Jarno + +mesa fails to build on GNU/kFreeBSD, since some parts are not enabled. + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524690 + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mesa/configure.ac +=================================================================== +--- mesa.orig/configure.ac ++++ mesa/configure.ac +@@ -777,7 +777,7 @@ + ;; + esac + ;; +- freebsd* | dragonfly*) ++ freebsd* | dragonfly* | kfreebsd*-gnu*) + DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" + DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" --- mesa-7.9~git20100924.orig/debian/patches/series +++ mesa-7.9~git20100924/debian/patches/series @@ -0,0 +1,9 @@ +02_use-ieee-fp-on-s390-and-m68k.patch +04_osmesa_version.diff +05_hurd-ftbfs.diff +06_kfreebsd-ftbfs.diff +08-kfreebsd-gallium.diff +100_no_abi_tag.patch +101_ubuntu_hidden_glname.patch +103_savage-expose_fbmodes_with_nonzero_alpha.patch +104_i915_fragment_shader_disable.patch --- mesa-7.9~git20100924.orig/debian/patches/103_savage-expose_fbmodes_with_nonzero_alpha.patch +++ mesa-7.9~git20100924/debian/patches/103_savage-expose_fbmodes_with_nonzero_alpha.patch @@ -0,0 +1,99 @@ +Index: mesa/src/mesa/drivers/dri/savage/savage_xmesa.c +=================================================================== +--- mesa.orig/src/mesa/drivers/dri/savage/savage_xmesa.c 2010-05-19 08:53:43.544920275 +1000 ++++ mesa/src/mesa/drivers/dri/savage/savage_xmesa.c 2010-05-19 10:59:49.573978367 +1000 +@@ -64,6 +64,8 @@ + + #include "xmlpool.h" + ++#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) ++ + /* Driver-specific options + */ + #define SAVAGE_ENABLE_VDMA(def) \ +@@ -893,32 +895,33 @@ + unsigned stencil_bits, GLboolean have_back_buffer ) + { + __DRIconfig **configs; ++ __DRIconfig **configs_a8r8g8b8; ++ __DRIconfig **configs_x8r8g8b8; + __GLcontextModes * m; + unsigned depth_buffer_factor; + unsigned back_buffer_factor; +- GLenum fb_format; +- GLenum fb_type; ++ uint8_t depth_bits_array[2]; ++ uint8_t stencil_bits_array[2]; ++ uint8_t msaa_samples_array[1]; + int i; + + /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy + * enough to add support. Basically, if a context is created with an + * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping + * will never be used. +- * +- * FK: What about drivers that don't use page flipping? Could they +- * just expose GLX_SWAP_COPY_OML? + */ + static const GLenum back_buffer_modes[] = { + GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ + }; + +- uint8_t depth_bits_array[2]; +- uint8_t stencil_bits_array[2]; +- uint8_t msaa_samples_array[1]; +- ++ /* This being a DRI1 driver the depth buffer is always allocated, ++ * so it does not make sense to expose visuals without it. If this ++ * driver ever gets ported to DRI2 the first array value should be ++ * changed to 0 to expose modes without a depth buffer. ++ */ + depth_bits_array[0] = depth_bits; + depth_bits_array[1] = depth_bits; +- ++ + /* Just like with the accumulation buffer, always provide some modes + * with a stencil buffer. It will be a sw fallback, but some apps won't + * care about that. +@@ -932,19 +935,32 @@ + back_buffer_factor = (have_back_buffer) ? 2 : 1; + + if ( pixel_bits == 16 ) { +- fb_format = GL_RGB; +- fb_type = GL_UNSIGNED_SHORT_5_6_5; ++ configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, ++ depth_bits_array, stencil_bits_array, ++ depth_buffer_factor, ++ back_buffer_modes, back_buffer_factor, ++ msaa_samples_array, 1, GL_TRUE); + } + else { +- fb_format = GL_BGR; +- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; ++ configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, ++ depth_bits_array, ++ stencil_bits_array, ++ depth_buffer_factor, ++ back_buffer_modes, ++ back_buffer_factor, ++ msaa_samples_array, 1, ++ GL_TRUE); ++ configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV, ++ depth_bits_array, ++ stencil_bits_array, ++ depth_buffer_factor, ++ back_buffer_modes, ++ back_buffer_factor, ++ msaa_samples_array, 1, ++ GL_TRUE); ++ configs = driConcatConfigs(configs_a8r8g8b8, configs_x8r8g8b8); + } + +- configs = driCreateConfigs(fb_format, fb_type, +- depth_bits_array, stencil_bits_array, +- depth_buffer_factor, +- back_buffer_modes, back_buffer_factor, +- msaa_samples_array, 1, GL_TRUE); + if (configs == NULL) { + fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", + __func__, __LINE__ ); --- mesa-7.9~git20100924.orig/debian/patches/08-kfreebsd-gallium.diff +++ mesa-7.9~git20100924/debian/patches/08-kfreebsd-gallium.diff @@ -0,0 +1,26 @@ +Index: mesa/src/gallium/auxiliary/rtasm/rtasm_execmem.c +=================================================================== +--- mesa.orig/src/gallium/auxiliary/rtasm/rtasm_execmem.c ++++ mesa/src/gallium/auxiliary/rtasm/rtasm_execmem.c +@@ -37,7 +37,7 @@ + + #include "rtasm_execmem.h" + +-#if defined(PIPE_OS_BSD) ++#ifndef MAP_ANONYMOUS + #define MAP_ANONYMOUS MAP_ANON + #endif + +Index: mesa/src/gallium/include/pipe/p_config.h +=================================================================== +--- mesa.orig/src/gallium/include/pipe/p_config.h ++++ mesa/src/gallium/include/pipe/p_config.h +@@ -128,7 +128,7 @@ + #define PIPE_OS_UNIX + #endif + +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + #define PIPE_OS_FREEBSD + #define PIPE_OS_BSD + #define PIPE_OS_UNIX --- mesa-7.9~git20100924.orig/debian/patches/101_ubuntu_hidden_glname.patch +++ mesa-7.9~git20100924/debian/patches/101_ubuntu_hidden_glname.patch @@ -0,0 +1,12 @@ +Index: mesa/src/mesa/x86/glapi_x86.S +=================================================================== +--- mesa.orig/src/mapi/glapi/glapi_x86.S 2009-06-29 14:43:07.000000000 +0300 ++++ mesa/src/mapi/glapi/glapi_x86.S 2009-06-29 14:45:38.000000000 +0300 +@@ -148,7 +148,6 @@ + + ALIGNTEXT16 + GLOBL GLNAME(gl_dispatch_functions_start) +- HIDDEN(GLNAME(gl_dispatch_functions_start)) + GLNAME(gl_dispatch_functions_start): + + GL_STUB(NewList, _gloffset_NewList, NewList@8) --- mesa-7.9~git20100924.orig/scons/x11.py +++ mesa-7.9~git20100924/scons/x11.py @@ -0,0 +1,52 @@ +"""x11 + +Tool-specific initialization for X11 + +""" + +# +# Copyright (c) 2010 VMware, 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. +# + + +def generate(env): + env.Append(CPPPATH = ['/usr/X11R6/include']) + env.Append(LIBPATH = ['/usr/X11R6/lib']) + + env.Append(LIBS = [ + 'X11', + 'Xext', + 'Xxf86vm', + 'Xdamage', + 'Xfixes', + ]) + + +def exists(env): + # TODO: actually detect the presence of the headers + if env['platform'] in ('linux', 'freebsd', 'darwin'): + return True + else: + return False + + +# vim:set ts=4 sw=4 et: --- mesa-7.9~git20100924.orig/scons/crossmingw.py +++ mesa-7.9~git20100924/scons/crossmingw.py @@ -0,0 +1,196 @@ +"""SCons.Tool.gcc + +Tool-specific initialization for MinGW (http://www.mingw.org/) + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +See also http://www.scons.org/wiki/CrossCompilingMingw +""" + +# +# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation +# +# 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. +# + +import os +import os.path +import string + +import SCons.Action +import SCons.Builder +import SCons.Tool +import SCons.Util + +# This is what we search for to find mingw: +prefixes32 = SCons.Util.Split(""" + mingw32- + mingw32msvc- + i386-mingw32- + i486-mingw32- + i586-mingw32- + i686-mingw32- + i386-mingw32msvc- + i486-mingw32msvc- + i586-mingw32msvc- + i686-mingw32msvc- + i686-pc-mingw32- +""") +prefixes64 = SCons.Util.Split(""" + amd64-mingw32- + amd64-mingw32msvc- + amd64-pc-mingw32- +""") + +def find(env): + if env['machine'] == 'x86_64': + prefixes = prefixes64 + else: + prefixes = prefixes32 + for prefix in prefixes: + # First search in the SCons path and then the OS path: + if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'): + return prefix + + return '' + +def shlib_generator(target, source, env, for_signature): + cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) + + dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') + if dll: cmd.extend(['-o', dll]) + + cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) + + implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') + if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) + + def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') + if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) + + return [cmd] + +def shlib_emitter(target, source, env): + dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') + no_import_lib = env.get('no_import_lib', 0) + + if not dll: + raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX") + + if not no_import_lib and \ + not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): + + # Append an import library to the list of targets. + target.append(env.ReplaceIxes(dll, + 'SHLIBPREFIX', 'SHLIBSUFFIX', + 'LIBPREFIX', 'LIBSUFFIX')) + + # Append a def file target if there isn't already a def file target + # or a def file source. There is no option to disable def file + # target emitting, because I can't figure out why someone would ever + # want to turn it off. + def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') + def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX') + if not def_source and not def_target: + target.append(env.ReplaceIxes(dll, + 'SHLIBPREFIX', 'SHLIBSUFFIX', + 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')) + + return (target, source) + + +shlib_action = SCons.Action.Action(shlib_generator, '$SHLINKCOMSTR', generator=1) + +res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') + +res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', + source_scanner=SCons.Tool.SourceFileScanner) +SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) + +def generate(env): + mingw_prefix = find(env) + + if mingw_prefix: + dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc')) + + # The mingw bin directory must be added to the path: + path = env['ENV'].get('PATH', []) + if not path: + path = [] + if SCons.Util.is_String(path): + path = string.split(path, os.pathsep) + + env['ENV']['PATH'] = string.join([dir] + path, os.pathsep) + + # Most of mingw is the same as gcc and friends... + gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas'] + for tool in gnu_tools: + SCons.Tool.Tool(tool)(env) + + #... but a few things differ: + env['CC'] = mingw_prefix + 'gcc' + env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') + env['CXX'] = mingw_prefix + 'g++' + env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') + env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') + env['SHLINKCOM'] = shlib_action + env.Append(SHLIBEMITTER = [shlib_emitter]) + env['LINK'] = mingw_prefix + 'g++' + env['AR'] = mingw_prefix + 'ar' + env['RANLIB'] = mingw_prefix + 'ranlib' + env['LINK'] = mingw_prefix + 'g++' + env['AS'] = mingw_prefix + 'as' + env['WIN32DEFPREFIX'] = '' + env['WIN32DEFSUFFIX'] = '.def' + env['SHOBJSUFFIX'] = '.o' + env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 + + env['RC'] = mingw_prefix + 'windres' + env['RCFLAGS'] = SCons.Util.CLVar('') + env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS ${INCPREFIX}${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' + env['BUILDERS']['RES'] = res_builder + + # Some setting from the platform also have to be overridden: + env['OBJPREFIX'] = '' + env['OBJSUFFIX'] = '.o' + env['SHOBJPREFIX'] = '$OBJPREFIX' + env['SHOBJSUFFIX'] = '$OBJSUFFIX' + env['PROGPREFIX'] = '' + env['PROGSUFFIX'] = '.exe' + env['LIBPREFIX'] = 'lib' + env['LIBSUFFIX'] = '.a' + env['SHLIBPREFIX'] = '' + env['SHLIBSUFFIX'] = '.dll' + env['LIBPREFIXES'] = [ 'lib', '' ] + env['LIBSUFFIXES'] = [ '.a', '.lib' ] + + # MinGW port of gdb does not handle well dwarf debug info which is the + # default in recent gcc versions + env.AppendUnique(CCFLAGS = ['-gstabs']) + + env.AppendUnique(CPPDEFINES = [('__MSVCRT_VERSION__', '0x0700')]) + #env.AppendUnique(LIBS = ['iberty']) + env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup']) + #env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at']) + +def exists(env): + return find(env) --- mesa-7.9~git20100924.orig/scons/gallium.py +++ mesa-7.9~git20100924/scons/gallium.py @@ -0,0 +1,493 @@ +"""gallium + +Frontend-tool for Gallium3D architecture. + +""" + +# +# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. +# All Rights Reserved. +# +# 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, sub license, 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 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 NON-INFRINGEMENT. +# IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. +# + + +import distutils.version +import os +import os.path +import re +import subprocess + +import SCons.Action +import SCons.Builder +import SCons.Scanner + + +def symlink(target, source, env): + target = str(target[0]) + source = str(source[0]) + if os.path.islink(target) or os.path.exists(target): + os.remove(target) + os.symlink(os.path.basename(source), target) + +def install(env, source, subdir): + target_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build'], subdir) + env.Install(target_dir, source) + +def install_program(env, source): + install(env, source, 'bin') + +def install_shared_library(env, sources, version = ()): + install_dir = os.path.join(env.Dir('#.').srcnode().abspath, env['build']) + version = tuple(map(str, version)) + if env['SHLIBSUFFIX'] == '.dll': + dlls = env.FindIxes(sources, 'SHLIBPREFIX', 'SHLIBSUFFIX') + install(env, dlls, 'bin') + libs = env.FindIxes(sources, 'LIBPREFIX', 'LIBSUFFIX') + install(env, libs, 'lib') + else: + for source in sources: + target_dir = os.path.join(install_dir, 'lib') + target_name = '.'.join((str(source),) + version) + last = env.InstallAs(os.path.join(target_dir, target_name), source) + while len(version): + version = version[:-1] + target_name = '.'.join((str(source),) + version) + action = SCons.Action.Action(symlink, "$TARGET -> $SOURCE") + last = env.Command(os.path.join(target_dir, target_name), last, action) + +def createInstallMethods(env): + env.AddMethod(install_program, 'InstallProgram') + env.AddMethod(install_shared_library, 'InstallSharedLibrary') + + +def num_jobs(): + try: + return int(os.environ['NUMBER_OF_PROCESSORS']) + except (ValueError, KeyError): + pass + + try: + return os.sysconf('SC_NPROCESSORS_ONLN') + except (ValueError, OSError, AttributeError): + pass + + try: + return int(os.popen2("sysctl -n hw.ncpu")[1].read()) + except ValueError: + pass + + return 1 + + +def generate(env): + """Common environment generation code""" + + # Toolchain + platform = env['platform'] + if env['toolchain'] == 'default': + if platform == 'winddk': + env['toolchain'] = 'winddk' + elif platform == 'wince': + env['toolchain'] = 'wcesdk' + env.Tool(env['toolchain']) + + if env['platform'] == 'embedded': + # Allow overriding compiler from environment + if os.environ.has_key('CC'): + env['CC'] = os.environ['CC'] + # Update CCVERSION to match + pipe = SCons.Action._subproc(env, [env['CC'], '--version'], + stdin = 'devnull', + stderr = 'devnull', + stdout = subprocess.PIPE) + if pipe.wait() == 0: + line = pipe.stdout.readline() + match = re.search(r'[0-9]+(\.[0-9]+)+', line) + if match: + env['CCVERSION'] = match.group(0) + + + env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-') + env['msvc'] = env['CC'] == 'cl' + + # shortcuts + debug = env['debug'] + machine = env['machine'] + platform = env['platform'] + x86 = env['machine'] == 'x86' + ppc = env['machine'] == 'ppc' + gcc = env['gcc'] + msvc = env['msvc'] + + # Put build output in a separate dir, which depends on the current + # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample + build_topdir = 'build' + build_subdir = env['platform'] + if env['machine'] != 'generic': + build_subdir += '-' + env['machine'] + if env['debug']: + build_subdir += "-debug" + if env['profile']: + build_subdir += "-profile" + build_dir = os.path.join(build_topdir, build_subdir) + # Place the .sconsign file in the build dir too, to avoid issues with + # different scons versions building the same source file + env['build'] = build_dir + env.SConsignFile(os.path.join(build_dir, '.sconsign')) + if 'SCONS_CACHE_DIR' in os.environ: + print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],) + env.CacheDir(os.environ['SCONS_CACHE_DIR']) + env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf') + env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log') + + # Parallel build + if env.GetOption('num_jobs') <= 1: + env.SetOption('num_jobs', num_jobs()) + + # C preprocessor options + cppdefines = [] + if debug: + cppdefines += ['DEBUG'] + else: + cppdefines += ['NDEBUG'] + if env['profile']: + cppdefines += ['PROFILE'] + if platform == 'windows': + cppdefines += [ + 'WIN32', + '_WINDOWS', + #'_UNICODE', + #'UNICODE', + # http://msdn.microsoft.com/en-us/library/aa383745.aspx + ('_WIN32_WINNT', '0x0601'), + ('WINVER', '0x0601'), + ] + if msvc and env['toolchain'] != 'winddk': + cppdefines += [ + 'VC_EXTRALEAN', + '_USE_MATH_DEFINES', + '_CRT_SECURE_NO_WARNINGS', + '_CRT_SECURE_NO_DEPRECATE', + '_SCL_SECURE_NO_WARNINGS', + '_SCL_SECURE_NO_DEPRECATE', + ] + if debug: + cppdefines += ['_DEBUG'] + if env['toolchain'] == 'winddk': + # Mimic WINDDK's builtin flags. See also: + # - WINDDK's bin/makefile.new i386mk.inc for more info. + # - buildchk_wxp_x86.log files, generated by the WINDDK's build + # - http://alter.org.ua/docs/nt_kernel/vc8_proj/ + if machine == 'x86': + cppdefines += ['_X86_', 'i386'] + if machine == 'x86_64': + cppdefines += ['_AMD64_', 'AMD64'] + if platform == 'winddk': + cppdefines += [ + 'STD_CALL', + ('CONDITION_HANDLING', '1'), + ('NT_INST', '0'), + ('WIN32', '100'), + ('_NT1X_', '100'), + ('WINNT', '1'), + ('_WIN32_WINNT', '0x0501'), # minimum required OS version + ('WINVER', '0x0501'), + ('_WIN32_IE', '0x0603'), + ('WIN32_LEAN_AND_MEAN', '1'), + ('DEVL', '1'), + ('__BUILDMACHINE__', 'WinDDK'), + ('FPO', '0'), + ] + if debug: + cppdefines += [('DBG', 1)] + if platform == 'wince': + cppdefines += [ + '_CRT_SECURE_NO_DEPRECATE', + '_USE_32BIT_TIME_T', + 'UNICODE', + '_UNICODE', + ('UNDER_CE', '600'), + ('_WIN32_WCE', '0x600'), + 'WINCEOEM', + 'WINCEINTERNAL', + 'WIN32', + 'STRICT', + 'x86', + '_X86_', + 'INTERNATIONAL', + ('INTLMSG_CODEPAGE', '1252'), + ] + if platform == 'windows': + cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER'] + if platform == 'winddk': + cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_DISPLAY'] + if platform == 'wince': + cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE'] + cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL'] + if platform == 'embedded': + cppdefines += ['PIPE_OS_EMBEDDED'] + env.Append(CPPDEFINES = cppdefines) + + # C compiler options + cflags = [] # C + cxxflags = [] # C++ + ccflags = [] # C & C++ + if gcc: + ccversion = env['CCVERSION'] + if debug: + ccflags += ['-O0', '-g3'] + elif ccversion.startswith('4.2.'): + # gcc 4.2.x optimizer is broken + print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations" + ccflags += ['-O0', '-g3'] + else: + ccflags += ['-O3', '-g3'] + if env['profile']: + # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling? + ccflags += [ + '-fno-omit-frame-pointer', + '-fno-optimize-sibling-calls', + ] + if env['machine'] == 'x86': + ccflags += [ + '-m32', + #'-march=pentium4', + ] + if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'): + # NOTE: We need to ensure stack is realigned given that we + # produce shared objects, and have no control over the stack + # alignment policy of the application. Therefore we need + # -mstackrealign ore -mincoming-stack-boundary=2. + # + # XXX: We could have SSE without -mstackrealign if we always used + # __attribute__((force_align_arg_pointer)), but that's not + # always the case. + ccflags += [ + '-mstackrealign', # ensure stack is aligned + '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics + #'-mfpmath=sse', + ] + if platform in ['windows', 'darwin']: + # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216 + ccflags += ['-fno-common'] + if env['machine'] == 'x86_64': + ccflags += ['-m64'] + if platform == 'darwin': + ccflags += ['-fno-common'] + # See also: + # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html + ccflags += [ + '-Wall', + '-Wno-long-long', + '-ffast-math', + '-fmessage-length=0', # be nice to Eclipse + ] + cflags += [ + '-Wmissing-prototypes', + '-std=gnu99', + ] + if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.0'): + ccflags += [ + '-Wmissing-field-initializers', + ] + if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'): + ccflags += [ + '-Werror=pointer-arith', + ] + cflags += [ + '-Werror=declaration-after-statement', + ] + if msvc: + # See also: + # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx + # - cl /? + if debug: + ccflags += [ + '/Od', # disable optimizations + '/Oi', # enable intrinsic functions + '/Oy-', # disable frame pointer omission + '/GL-', # disable whole program optimization + ] + else: + ccflags += [ + '/O2', # optimize for speed + '/GL', # enable whole program optimization + ] + ccflags += [ + '/fp:fast', # fast floating point + '/W3', # warning level + #'/Wp64', # enable 64 bit porting warnings + ] + if env['machine'] == 'x86': + ccflags += [ + #'/arch:SSE2', # use the SSE2 instructions + ] + if platform == 'windows': + ccflags += [ + # TODO + ] + if platform == 'winddk': + ccflags += [ + '/Zl', # omit default library name in .OBJ + '/Zp8', # 8bytes struct member alignment + '/Gy', # separate functions for linker + '/Gm-', # disable minimal rebuild + '/WX', # treat warnings as errors + '/Gz', # __stdcall Calling convention + '/GX-', # disable C++ EH + '/GR-', # disable C++ RTTI + '/GF', # enable read-only string pooling + '/G6', # optimize for PPro, P-II, P-III + '/Ze', # enable extensions + '/Gi-', # disable incremental compilation + '/QIfdiv-', # disable Pentium FDIV fix + '/hotpatch', # prepares an image for hotpatching. + #'/Z7', #enable old-style debug info + ] + if platform == 'wince': + # See also C:\WINCE600\public\common\oak\misc\makefile.def + ccflags += [ + '/Zl', # omit default library name in .OBJ + '/GF', # enable read-only string pooling + '/GR-', # disable C++ RTTI + '/GS', # enable security checks + # Allow disabling language conformance to maintain backward compat + #'/Zc:wchar_t-', # don't force wchar_t as native type, instead of typedef + #'/Zc:forScope-', # don't enforce Standard C++ for scoping rules + #'/wd4867', + #'/wd4430', + #'/MT', + #'/U_MT', + ] + # Automatic pdb generation + # See http://scons.tigris.org/issues/show_bug.cgi?id=1656 + env.EnsureSConsVersion(0, 98, 0) + env['PDB'] = '${TARGET.base}.pdb' + env.Append(CCFLAGS = ccflags) + env.Append(CFLAGS = cflags) + env.Append(CXXFLAGS = cxxflags) + + if env['platform'] == 'windows' and msvc: + # Choose the appropriate MSVC CRT + # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx + if env['debug']: + env.Append(CCFLAGS = ['/MTd']) + env.Append(SHCCFLAGS = ['/LDd']) + else: + env.Append(CCFLAGS = ['/MT']) + env.Append(SHCCFLAGS = ['/LD']) + + # Assembler options + if gcc: + if env['machine'] == 'x86': + env.Append(ASFLAGS = ['-m32']) + if env['machine'] == 'x86_64': + env.Append(ASFLAGS = ['-m64']) + + # Linker options + linkflags = [] + shlinkflags = [] + if gcc: + if env['machine'] == 'x86': + linkflags += ['-m32'] + if env['machine'] == 'x86_64': + linkflags += ['-m64'] + if env['platform'] not in ('darwin'): + shlinkflags += [ + '-Wl,-Bsymbolic', + ] + # Handle circular dependencies in the libraries + if env['platform'] in ('darwin'): + pass + else: + env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group' + if msvc: + if not env['debug']: + # enable Link-time Code Generation + linkflags += ['/LTCG'] + env.Append(ARFLAGS = ['/LTCG']) + if platform == 'windows' and msvc: + # See also: + # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx + linkflags += [ + '/fixed:no', + '/incremental:no', + ] + if platform == 'winddk': + linkflags += [ + '/merge:_PAGE=PAGE', + '/merge:_TEXT=.text', + '/section:INIT,d', + '/opt:ref', + '/opt:icf', + '/ignore:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221', + '/incremental:no', + '/fullbuild', + '/release', + '/nodefaultlib', + '/wx', + '/debug', + '/debugtype:cv', + '/version:5.1', + '/osversion:5.1', + '/functionpadmin:5', + '/safeseh', + '/pdbcompress', + '/stack:0x40000,0x1000', + '/driver', + '/align:0x80', + '/subsystem:native,5.01', + '/base:0x10000', + + '/entry:DrvEnableDriver', + ] + if env['debug'] or env['profile']: + linkflags += [ + '/MAP', # http://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx + ] + if platform == 'wince': + linkflags += [ + '/nodefaultlib', + #'/incremental:no', + #'/fullbuild', + '/entry:_DllMainCRTStartup', + ] + env.Append(LINKFLAGS = linkflags) + env.Append(SHLINKFLAGS = shlinkflags) + + # Default libs + env.Append(LIBS = []) + + # Load LLVM + if env['llvm']: + env.Tool('llvm') + + # Custom builders and methods + env.Tool('custom') + createInstallMethods(env) + + # for debugging + #print env.Dump() + + +def exists(env): + return 1 --- mesa-7.9~git20100924.orig/scons/llvm.py +++ mesa-7.9~git20100924/scons/llvm.py @@ -0,0 +1,165 @@ +"""llvm + +Tool-specific initialization for LLVM + +""" + +# +# Copyright (c) 2009 VMware, 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. +# + +import os +import os.path +import re +import sys +import distutils.version + +import SCons.Errors +import SCons.Util + + +def generate(env): + try: + llvm_dir = os.environ['LLVM'] + except KeyError: + # Do nothing -- use the system headers/libs + llvm_dir = None + else: + if not os.path.isdir(llvm_dir): + raise SCons.Errors.InternalError, "Specified LLVM directory not found" + + if env['debug']: + llvm_subdir = 'Debug' + else: + llvm_subdir = 'Release' + + llvm_bin_dir = os.path.join(llvm_dir, llvm_subdir, 'bin') + if not os.path.isdir(llvm_bin_dir): + llvm_bin_dir = os.path.join(llvm_dir, 'bin') + if not os.path.isdir(llvm_bin_dir): + raise SCons.Errors.InternalError, "LLVM binary directory not found" + + env.PrependENVPath('PATH', llvm_bin_dir) + + if env['platform'] == 'windows': + # XXX: There is no llvm-config on Windows, so assume a standard layout + if llvm_dir is None: + print 'scons: LLVM environment variable must be specified when building for windows' + env.Exit(1) + + # Try to determine the LLVM version from llvm/Config/config.h + llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/config.h') + if not os.path.exists(llvm_config): + print 'scons: could not find %s' % llvm_config + env.Exit(1) + llvm_version_re = re.compile(r'^#define PACKAGE_VERSION "([^"]*)"') + llvm_version = None + for line in open(llvm_config, 'rt'): + mo = llvm_version_re.match(line) + if mo: + llvm_version = mo.group(1) + llvm_version = distutils.version.LooseVersion(llvm_version) + break + if llvm_version is None: + print 'scons: could not determine the LLVM version from %s' % llvm_config + env.Exit(1) + + env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) + env.AppendUnique(CPPDEFINES = [ + '__STDC_LIMIT_MACROS', + '__STDC_CONSTANT_MACROS', + 'HAVE_STDINT_H', + ]) + env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')]) + if llvm_version >= distutils.version.LooseVersion('2.7'): + # 2.7 + env.Prepend(LIBS = [ + 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter', + 'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine', + 'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser', + 'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen', + 'LLVMSelectionDAG', 'LLVMX86Info', 'LLVMAsmPrinter', + 'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine', + 'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser', + 'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget', + 'LLVMMC', 'LLVMCore', 'LLVMSupport', 'LLVMSystem', + ]) + else: + # 2.6 + env.Prepend(LIBS = [ + 'LLVMX86AsmParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen', + 'LLVMX86Info', 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter', + 'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine', + 'LLVMDebugger', 'LLVMBitWriter', 'LLVMAsmParser', + 'LLVMArchive', 'LLVMBitReader', 'LLVMSelectionDAG', + 'LLVMAsmPrinter', 'LLVMCodeGen', 'LLVMScalarOpts', + 'LLVMTransformUtils', 'LLVMipa', 'LLVMAnalysis', + 'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport', + 'LLVMSystem', + ]) + env.Append(LIBS = [ + 'imagehlp', + 'psapi', + ]) + if env['msvc']: + # Some of the LLVM C headers use the inline keyword without + # defining it. + env.Append(CPPDEFINES = [('inline', '__inline')]) + if env['debug']: + # LLVM libraries are static, build with /MT, and they + # automatically link agains LIBCMT. When we're doing a + # debug build we'll be linking against LIBCMTD, so disable + # that. + env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT']) + else: + if not env.Detect('llvm-config'): + print 'scons: llvm-config script not found' % llvm_version + env.Exit(1) + + llvm_version = env.backtick('llvm-config --version').rstrip() + llvm_version = distutils.version.LooseVersion(llvm_version) + + try: + env.ParseConfig('llvm-config --cppflags') + env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter') + env.ParseConfig('llvm-config --ldflags') + except OSError: + print 'scons: llvm-config version %s failed' % llvm_version + env.Exit(1) + else: + env['LINK'] = env['CXX'] + + assert llvm_version is not None + + print 'scons: Found LLVM version %s' % llvm_version + env['LLVM_VERSION'] = llvm_version + + # Define HAVE_LLVM macro with the major/minor version number (e.g., 0x0206 for 2.6) + llvm_version_major = int(llvm_version.version[0]) + llvm_version_minor = int(llvm_version.version[1]) + llvm_version_hex = '0x%02x%02x' % (llvm_version_major, llvm_version_minor) + env.Prepend(CPPDEFINES = [('HAVE_LLVM', llvm_version_hex)]) + +def exists(env): + return True + +# vim:set ts=4 sw=4 et: --- mesa-7.9~git20100924.orig/bin/installmesa +++ mesa-7.9~git20100924/bin/installmesa @@ -0,0 +1,74 @@ +#!/bin/sh + +# +# Simple shell script for installing Mesa's header and library files. +# If the copy commands below don't work on a particular system (i.e. the +# -f or -d flags), we may need to branch on `uname` to do the right thing. +# + + +TOP=. + +INCLUDE_DIR="/usr/local/include" +LIB_DIR="/usr/local/lib" + +if [ "x$#" = "x0" ] ; then +echo +echo "***** Mesa installation - You may need root privileges to do this *****" +echo +echo "Default directory for header files is:" ${INCLUDE_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + INCLUDE_DIR=${INPUT} +fi + +echo +echo "Default directory for library files is:" ${LIB_DIR} +echo "Enter new directory or press to accept this default." + +read INPUT +if [ "x${INPUT}" != "x" ] ; then + LIB_DIR=${INPUT} +fi + +echo +echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL +echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR} +echo "Press to continue, or -C to abort." + +read INPUT + +else +INCLUDE_DIR=$1/include +LIB_DIR=$1/lib +fi + +# flags: +# -f = force +# -d = preserve symlinks (does not work on BSD) + +if [ `uname` = "FreeBSD" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "Darwin" ] ; then + CP_FLAGS="-f" +elif [ `uname` = "AIX" ] ; then + CP_FLAGS="-fh" +else + CP_FLAGS="-fd" +fi + + +set -v + +mkdir -p ${INCLUDE_DIR} +mkdir -p ${INCLUDE_DIR}/GL +# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES +mkdir -p ${LIB_DIR} +cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL +cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL +# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES +cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR} + +echo "Done." --- mesa-7.9~git20100924.orig/bin/confdiff.sh +++ mesa-7.9~git20100924/bin/confdiff.sh @@ -0,0 +1,48 @@ +#!/bin/bash -e + +usage() +{ + echo "Usage: $0 " + echo "Highlight differences between Mesa configs" + echo "Example:" + echo " $0 linux linux-x86" +} + +die() +{ + echo "$@" >&2 + return 1 +} + +case "$1" in +-h|--help) usage; exit 0;; +esac + +[ $# -lt 2 ] && die 2 targets needed. See $0 --help +target1=$1 +target2=$2 + +topdir=$(cd "`dirname $0`"/..; pwd) +cd "$topdir" + +[ -f "./configs/$target1" ] || die Missing configs/$target1 +[ -f "./configs/$target2" ] || die Missing configs/$target2 + +trap 'rm -f "$t1" "$t2"' 0 + +t1=$(mktemp) +t2=$(mktemp) + +make -f- -n -p < $t1 +TOP = . +include \$(TOP)/configs/$target1 +default: +EOF + +make -f- -n -p < $t2 +TOP = . +include \$(TOP)/configs/$target2 +default: +EOF + +diff -pu -I'^#' $t1 $t2 --- mesa-7.9~git20100924.orig/docs/mesa.css +++ mesa-7.9~git20100924/docs/mesa.css @@ -0,0 +1,33 @@ +/* Mesa CSS */ +body { + background-color: #ffffff; + font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + color: black; + link: #111188; +} + +h1 { + font: 24px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif; + font-weight: bold; + color: black; +} + +h2 { + font: 18px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif, bold; + font-weight: bold; + color: black; +} + +code { + font-family: monospace; + font-size: 10pt; + color: black; +} + + +pre { + /*font-family: monospace;*/ + font-size: 10pt; + /*color: black;*/ +} + --- mesa-7.9~git20100924.orig/docs/GL3.txt +++ mesa-7.9~git20100924/docs/GL3.txt @@ -0,0 +1,101 @@ + +Status of OpenGL 3.x features in Mesa + + +Note: when an item is marked as "DONE" it means all the core Mesa +infrastructure is complete but it may be the case that few (if any) drivers +implement the features. + + +Feature Status +----------------------------------------------------- ------------------------ + +GL 3.0: + +GLSL changes (GL_EXT_gpu_shader4, etc) not started +Conditional rendering (GL_NV_conditional_render) DONE (swrast & softpipe) +Map buffer subranges (GL_ARB_map_buffer_range) DONE +Float textures, renderbuffers some infrastructure done + (incl. GL_EXT_packed_float, GL_EXT_shared_exponent) +Framebuffer objects (GL_EXT_framebuffer_object) DONE +Half-float some infrastructure done +Multisample blit DONE +Non-normalized Integer texture/framebuffer formats not started +1D/2D Texture arrays core Mesa, swrast done +Packed depth/stencil formats DONE +Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE +GL_EXT_texture_compression_rgtc not started +Red and red/green texture formats Ian? +Transform feedback (GL_EXT_transform_feedback) ~50% done + glBindFragDataLocation, glGetFragDataLocation, + glBindBufferRange, glBindBufferBase commands +Vertex array objects (GL_APPLE_vertex_array_object) DONE +sRGB framebuffer format (GL_EXT_framebuffer_sRGB) not started +glClearBuffer commands DONE, except for dispatch +glGetStringi command DONE, except for dispatch +glTexParameterI, glGetTexParameterI commands DONE, except for dispatch +glVertexAttribI commands not started + + +GL 3.1: + +GLSL 1.30 and 1.40 not started +Instanced drawing (GL_ARB_draw_instanced) ~50% done +Buffer copying (GL_ARB_copy_buffer) DONE +Primitive restart (GL_NV_primitive_restart) not started +16 vertex texture image units not started +Texture buffer objs (GL_ARB_textur_buffer_object) not started +Rectangular textures (GL_ARB_texture_rectangle) DONE +Uniform buffer objs (GL_ARB_uniform_buffer_object) not started +Signed normalized texture formats ~50% done + + +GL 3.2: + +Core/compatibility profiles not started +GLSL 1.50 not started +Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack) +BGRA vertex order (GL_ARB_vertex_array_bgra) DONE +Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE +Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (swrast, gallium) +Provoking vertex (GL_ARB_provoking_vertex) DONE +Seamless cubemaps (GL_ARB_seamless_cube_map) DONE, mostly? +Multisample textures (GL_ARB_texture_multisample) not started +Frag depth clamp (GL_ARB_depth_clamp) DONE +Fence objects (GL_ARB_sync) DONE + + +GL 3.3: + +GLSL 3.30 not started +GL_ARB_blend_func_extended not started +GL_ARB_explicit_attrib_location not started +GL_ARB_occlusion_query2 not started +GL_ARB_sampler_objects not started +GL_ARB_texture_rgb10_a2ui not started +GL_ARB_texture_swizzle DONE (same as EXT version) +GL_ARB_timer_query DONE (only Xlib sw driver) +GL_ARB_instanced_arrays not started +GL_ARB_vertex_type_2_10_10_10_rev not started + + +GL 4.0: + +GLSL 4.0 not started +GL_ARB_texture_query_lod not started +GL_ARB_draw_buffers_blend not started +GL_ARB_draw_indirect not started +GL_ARB_gpu_shader_fp64 not started +GL_ARB_sample_shading not started +GL_ARB_shader_subroutine not started +GL_ARB_tessellation_shader not started +GL_ARB_texture_buffer_object_rgb32 not started +GL_ARB_texture_cube_map_array not started +GL_ARB_texture_gather not started +GL_ARB_transform_feedback2 not started + + + + +More info about these features and the work involved can be found at +http://dri.freedesktop.org/wiki/MissingFunctionality --- mesa-7.9~git20100924.orig/docs/libGL.txt +++ mesa-7.9~git20100924/docs/libGL.txt @@ -0,0 +1,197 @@ + + + +Introduction +------------ + +This document describes the implementation of the XFree86 4.0 libGL.so +library defined by the Linux/OpenGL Base specification found at +http://reality.sgi.com/opengl/linux/linuxbase.html. + +The documentation is divided into two sections: + User's Guide + Driver Developer's Guide + +Author: Brian Paul (brian@precisioninsight.com) +Date: February 2000 + + + +User's Guide +------------ + +Using libGL.so + +The libGL.so library defines the gl- and glX-prefixed functions needed to +run OpenGL programs. OpenGL client applications should link with the +-lGL option to use it. + +libGL.so serves two primary functions: GLX protocol generation for indirect +rendering and loading/management of hardware drivers for direct rendering. + +When libGL.so initializes itself it uses the DRI to determine the +appropriate hardware driver for each screen on the local X display. +The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/ +directory. Drivers are named with the convention _dri.so where + is a driver such as "tdfx", "i810", "gamma", etc. + +The LIBGL_DRIVERS_DIR environment variable may be used to specify a +different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/. +This environment variable is ignored in setuid programs for security +reasons. + +When libGL.so is unable to locate appropriate hardware drivers it will +fall back to using indirect GLX rendering. + +To aid in solving problems, libGL.so will print diagnostic messages to +stderr if the LIBGL_DEBUG environment variable is defined. + +libGL.so is thread safe. The overhead of thread safety for common, +single-thread clients is negligible. However, the overhead of thread +safety for multi-threaded clients is significant. Each GL API call +requires two calls to pthread_get_specific() which can noticably +impact performance. Warning: libGL.so is thread safe but individual +DRI drivers may not be. Please consult the documentation for a driver +to learn if it is thread safe. + + + +Indirect Rendering + +You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT +environment variable. Hardware acceleration will not be used. + + + +libGL.so Extensibility + +libGL.so is designed to be extended without upgrading. That is, +drivers may install new OpenGL extension functions into libGL.so +without requiring libGL.so to be replaced. Clients of libGL.so should +use the glXGetProcAddressEXT() function to obtain the address of +functions by name. For more details of GLX_ARB_get_proc_address see +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.spec + +libGL.so is also designed with flexibility such that it may be used +with many generations of hardware drivers to come. + + + + +Driver Developer's Guide +------------------------ + +This section describes the requirements to make an XFree86 4.0 +libGL.so-compatible hardware driver. It is not intended for end +users of libGL.so. + + +XFree86 source files + +libGL.so is built inside XFree86 with sources found in xc/lib/GL/. +Specifically, libGL.so is built from: + + xc/lib/GL/glx/*.c + xc/lib/dri/XF86dri.c + xc/lib/dri/dri_glx.c + xc/lib/GL/mesa/src/glapi.c + xc/lib/GL/mesa/src/glapitemp.h + xc/lib/GL/mesa/src/glapitable.h + xc/lib/GL/mesa/src/glapioffsets.h + xc/lib/GL/mesa/src/glapinoop.c + xc/lib/GL/mesa/src/glheader.h + xc/lib/GL/mesa/src/glthread.c + xc/lib/GL/mesa/src/glthread.h + xc/lib/GL/mesa/src/X86/glapi_x86.S + xc/lib/GL/mesa/src/X86/assyntax.h + +Understand that the mesa/src/gl*.[ch] files are not tied to Mesa. They +have no dependencies on the rest of Mesa and are designed to be reusable +in a number of projects. + +The glapi_x86.X and assyntax.h files implement x86-optimized dispatch +of GL functions. They are not required; C-based dispatch can be used +instead, with a slight performance penalty. + + + +Driver loading and binding + +When libGL.so initializes itself (via the __glXInitialize function) a +call is made to driCreateDisplay(). This function uses DRI facilities +to determine the driver file appropriate for each screen on the local +display. Each screen's driver is then opened with dlopen() and asked +for its __driCreateScreen() function. The pointers to the __driCreateScreen() +functions are kept in an array, indexed by screen number, in the +__DRIdisplayRec struct. + +When a driver's __driCreateScreen() function is called, it must initialize +a __DRIscreenRec struct. This struct acts as the root of a tree of +function pointers which are called to create and destroy contexts and +drawables and perform all the operations needed by the GLX interface. +See the xc/lib/GL/glx/glxclient.h file for details. + + + +Dynamic Extension Function Registration + +In order to provide forward compatibility with future drivers, libGL.so +allows drivers to register new OpenGL extension functions which weren't +known when libGL.so was built. + +The register_extensions() function in xc/lib/GL/dri/dri_glx.c is called +as soon as libGL.so is loaded. This is done with gcc's constructor +attribute. This mechanism will likely have to be changed for other compilers. + +register_extensions() loops over all local displays and screens, determines +the DRI driver for each, and calls the driver's __driRegisterExtensions() +function, if present. + +The __driRegisterExtensions() function can add new entrypoints to libGL +by calling: + + GLboolean _glapi_add_entrypoint(const char *funcName, GLuint offset) + +The parameters are the name of the function (such as "glFoobarEXT") and the +offset of the dispatch slot in the API dispatch table. The return value +indicates success (GL_TRUE) or failure (GL_FALSE). + +_glapi_add_entrypoint() will synthesize entrypoint code in assembly +language. Assembly languages is required since parameter passing +can't be handled correctly using a C-based solution. + +The address of the new entrypoint is obtained by calling the +glXGetProcAddressARB() function. + +The dispatch offset number MUST be a number allocated by SGI in the same +manner in which new GL_* constants are allocated. Using an arbitrary +offset number will result in many problems. + + + +Dispatch Management + +When a GL context is made current, the driver must install its dispatch +table as the current dispatch table. This is done by calling + + void _glapi_set_dispatch(struct _glapi_table *dispatch); + +This will install the named dispatch table for the calling thread. +The current dispatch table for a thread can be obtained by calling + + struct _glapi_table *_glapi_get_dispatch(void); + +For higher performance in the common single-thread case, the global +variable _glapi_Dispatch will point to the current dispatch table. +This variable will be NULL when in multi-thread mode. + + + +Context Management + +libGL.so uses the XFree86 xthreads package to manage a thread-specific +current context pointer. See __glXGet/SetCurrentContext() in glext.c + +Drivers may use the _glapi_set/get_context() functions to maintain +a private thread-specific context pointer. + --- mesa-7.9~git20100924.orig/docs/VERSIONS +++ mesa-7.9~git20100924/docs/VERSIONS @@ -0,0 +1,1514 @@ + + +Mesa Version History +==================== + +1.0 beta February 1995 + Initial release + +1.1 beta March 4, 1995 + Changes: + faster point and line drawing (2x faster) + more systems supported, better Makefiles + Renamed lib*.a files to avoid collisions + many small bug fixes + New: + pseudo-GLX functions added + new implementation of evaluators (eval2.c) + GLUT support + +1.1.1 beta March 7, 1995 + Changes: + Reverted from eval2.c to eval.c due to FPE on Linux + more speed improvements + more Makefile changes + +1.1.2 beta March 14, 1995 + New: + implementation of SGI's blending extensions + glXUseXFont implemented + added MESA_DEBUG environment variable support + Changes: + Using eval2.c again + more FPE-prevention checks (0-length normals are OK) + a few small bug fixes + much faster pixel logic ops! + faster transformation arithmetic + +1.1.3 beta March 31, 1995 + New: + gluScaleImage() and gluBuild2DMipMaps() implemented + Mesa widgets for Xt/Motif + blendEXT demos + added environment variables for selecting visuals + Changes: + almost all GLUT demos work correctly now + faster X device driver functions + more bug fixes + +1.1.4 beta April 20, 1995 + Bug fixes: + - missing #define SEEK_SET in src-tk/image.c + - compile glShadeModel into display lists + - fixed pow() domain error in src/light.c + - fixed "flickering bitmaps" in double buffer mode + - fixed tk.h and aux.h for C++ + - state of LIGHT_MODEL_LOCAL_VIEWER was inverted + New features: + - MUCH, MUCH nicer dithering in 8-bit RGB mode + - updated widgets and widget demos + - Implemented GLXPixmap functions + - Added GLU 1.1 and GLX 1.1 functions + - Changed the X/Mesa interface API, more versatile + - Implemented gluPartialDisk() + +1.2 May 22, 1995 + Bug fixes: + - IRIX 4.x makefile problem + - modified tk to share root colormap as needed + - gluLookAt normalization problem + - suppress Expose, NoExpose events in swapbuffers + - glBitmap() and glDrawPixels() clipping + New features: + - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture + modes implemented + - texture maps stored more efficiently + - texture maps can be compiled into display lists + - Bogdan Sikorski's GLU polygon tesselation code + - Linas Vepstas's sweep and extrusion library + - glXCreateContext()'s shareList parameter works as it's supposed to. + XMesaCreateContext() updated to accept a shareList parameter too. + - Mesa can be compiled with real OpenGL .h files + - MESA_BACK_BUFFER environment variable + - better GLX error checking + +1.2.1 June 22, 1995 + Bug fixes: + - X/Mesa double buffer window resize crash + - widgets now pass PointerMotion events + - X/Mesa incorrect default clear color and drawing color + - more robust X MIT-SHM support in X/Mesa + - glTexImage( format=GL_LUMINANCE ) didn't work + - GL_LINE mode polygons with line width > 1.0 could cause a crash + - numerous feedback bugs + - glReadPixels() from depth buffer was wrong + - error prone depth and stencil buffer allocation + New features: + - Preliminary Microsoft Windows driver + - Implemented a number of missing functions: glEvalCoord[12][df]v(), + glGet...(), etc. + - Added a few missing symbols to gl.h and glu.h + - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons. + - Faster rendering of lines when width=2.0 + - Stencil-related functions now work in display lists + Changes: + - renamed aux.h as glaux.h (MS-DOS names can't start with aux) + - most filenames are in 8.3 format to accomodate MS-DOS + - use GLubytes to store arrays of colors instead of GLints + +1.2.2 August 2, 1995 + New features: + - texture mapped points and lines + - NURBS! (but not 100% complete) + - viewports may safely extend beyond window boundaries + - MESA_PRIVATE_CMAP environment variable + - Grayscale X display support + - two new demos: demos/gears.c and demos/shadow.c + - MachTen for Macintosh configuration + Bug fixes: + - glGet*(GL_DEPTH_BITS) returned bytes, not bits + - point, line, and bitmap rasterization suffered from roundoff errors + - fixed a division by zero error in line clippping + - occasional wrong default background color really fixed! + - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work + - gluBuild2DMipmaps malloc problem fixed + - view volume clipping of smooth shaded lines resulted in bad colors + Changes: + - new visual selection method in glXChooseVisual() + - improved GLU quadric functions + - call XSync for glFinish and XFlush for glFlush + - glVertex() calls now use a function pointer to avoid conditionals + - removed contrib directory from Mesa tar file (available on ftp site) + - AIX shared library support + - Removed GLUenum type as it's not in OpenGL + +1.2.3 September 26, 1995 + New features: + - Mesa header files now equivalent to SGI OpenGL headers + - Support for HP's Color Recovery dithering displays + - Faster vertex transformation + - Faster raster operations into X windows under certain conditions + - New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General + - 4-bit visuals now supported + Bug fixes: + - glScissor bug fixed + - round-off errors in clipping lines against clip planes fixed + - byte swapping between hosts and display servers implemented + - glGetError() can be called without a current rendering context + - problem with accidentally culled polygons is fixed + - fixed some widget compilation problems + +1.2.4 November 17, 1995 + New features: + - More speed improvements (lighting, fogging, polygon drawing) + - Window system and OS-independent off-screen rendering + - Preliminary Fortran bindings + - glPolygonOffsetEXT implemented + - glColorMask and glIndexMask now fully implemented + - glPixelZoom implemented + - display lists fully implemented + - gamma correction + - dithering in 8-bit TrueColor/DirectColor visuals + Changes: + - Improved device driver interface + - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk + - Dithering support moved from core into device driver + Bug fixes: + - glEnable/Disable( GL_LIGHTING ) didn't always take effect + - glReadPixels byte swapping was broken + - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken + - duplicate glColor4b() prototype in GL/gl.h removed + - stripes in wave -ci demo fixed + - GL_LINEAR_MIPMAP_NEAREST had wrong value + - bugs in HP Color Recovery support fixed + - fixed bug when blending lines, points, bitmaps outside of window + +1.2.5 November 30, 1995 + New Features: + - updated MS Windows driver + - new implementation of StaticGray/GrayScale visual support + Bug fixes: + - pixelzooming with gamma correction or blending didn't work + - HP color recovery visual wasn't being picked by glXChooseVisual + - glClear didn't always observe glColorMask changes + - olympic and offset demos didn't compile on some Suns + - texcoord clamping wasn't correct + - a polygon optimization introduced an occasional sampling problem + +1.2.6 January 26, 1996 + New Features: + - faster line and polygon rendering under certain conditions. See + Performance Tips 9 and 10 in README + - profiling + - lighting is a bit faster + - better perspective corrected texture mapping + - Amiga AmiWin (X11) support + - preliminary Linux SVGA driver + Changes: + - now using a 16-bit depth buffer, faster, smaller + - GL_NORMALIZE is disabled by default + Bug fixes: + - projective texture mapping + - fixed a memory leak in the context destroy function + - GL_POLYGON with less than 3 vertices caused a crash + - glGet*() returned wrong result for GL_INDEX_MODE + - reading pixels from an unmapped X window caused a BadMatch error + +1.2.7 March 5, 1996 + New: + - faster lighting + - faster 16-bit TrueColor rendering on Linux + - faster 32-bit TrueColor rendering on Linux, HP, IBM + - non-depth-buffered XImage polygons are faster + - vertex array extension + - software alpha planes + - updated Macintosh driver + - new NeXT driver + - GLU quadric functions generate texture coordinates + - reflect.c demo - reflective, textured surface demo + Changes: + - gamma correction code moved into the X driver for better performance + Bug fixes: + - multiple glClipPlane()'s didn't work reliably + - glPolygonMode() didn't always work + - glCullFace( GL_FRONT_AND_BACK ) didn't work + - texture mapping with gamma correction was buggy + - floating point exceptions in texture coordinate interpolation + - XImage byte swapping didn't always work + - polygon edge flags weren't always used correctly + +1.2.8 May 22, 1996 + New: + - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property + - better monochrome output + - more IRIX 6.x configurations + - more robust RGB mode color allocation + - added MESA_XSYNC environment variable + - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions + - GL_MESA_window_pos extension + - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT + and GL_UNSIGNED_INT + - driver for prototype Cirrus Mondello 3-D board + - updated AmigaDOS driver + - a few small speed optimizations in polygon rendering + Changes: + - internal device driver interface modified to simplify device + driver implementations and to support hardware Z buffers + - several changes to the X/Mesa interface (xmesa.h) + Bug fixes: + - fixed pow(0,0) domain error triggered on some systems + - glStencilClear() in a display list caused an infinite loop + - glRasterPos*() was sometimes off by +/-0.5 in X and Y + - color masking and blending were performed in wrong order + - auxSolidCylinder() sometimes drew a wire-frame cylinder + - fixed file writing bug in osdemo.c + - pixel mapping didn't always work + - the GL_GEQUAL stencil func didn't work + - the GL_INVERT stencil op didn't work + - the stencil write mask didn't work + - glPush/PopAttrib() didn't do enough error checking + - glIsList() didn't always work correctly + +2.0 October 10, 1996 + New: + - Implements OpenGL 1.1 API functions + - all texture filtering modes supported (mipmapping) + - faster texture mapping, see Performance Tip 11 in README + - antialiased RGB points + - X support for line and polygon stippling + - glDrawBuffer( GL_FRONT_AND_BACK ) works + - util/ directory of useful stuff + - demos/texobj demo of texture objects + Changes: + - major internal changes for thread-safeness + - new device driver interface + - MESA_ALPHA env variable removed + - triangle rasterizer replaces polygon rasterizer + Bug fixes: + - glPopAttrib() bug + - glDrawBuffer(GL_NONE) works now + +2.1 December 14, 1996 + New: + - VMS support + - MS-DOS driver + - OpenStep support + - updated, combined Windows 95/NT driver + - implemented glGetLighti() and glGetTexGen*() + - GLX does garbage collection of ancillary buffers + Bug fixes: + - removed unused _EXT constants from gl.h + - fixed polygon offset bugs + - Z coordinates of clipped lines were incorrect + - glEdgeFlag() in display lists didn't always work + - glLight*() in display lists didn't work + - fixed X line stipple bugs (Michael Pichler) + - glXUseXfonts XFreeFont/XFreeFontInfo bug fixed + - fixed a feedback bug + - glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix + - polygons were sometimes culled instead of clipped + - triangle rasterizer suffered from float/int overflow exceptions + - fixed FP underflow exception in lighting (specular exponent) + - glEnable/glDisable of GL_EXT_vertex_array enums didn't work + - fixed free(NULL) in GLU tesselator code + - using 24-bit color on some X servers resulted in garbage rendering + - 32-bit per pixel mode for XFree86 now works + - glRotate(a,0,0,0) gave unpredictable results + - GL_LINE_STRIP with > 480 vertices had occasional clipping problems + - 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap + - glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled + - glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right + - accumulation buffer was limited to positive values + - projective textures didn't work + - selection buffer overflows weren't handled correctly + Changes: + - restored the GL_EXT_polygon_offset extension + - slightly faster RGB dithering + - the SVGA driver works again + - Amiga driver now distributed separately + - NeXT driver updated for Mesa 2.x + +2.2 March 14, 1997 + New: + - better color selection when dithering + - added GL_EXT_texture_object extension + - updated MS-DOS driver for DJGPP + - added openbsd make configuration + - faster dithered flat-shaded triangles + - various compilation problems with Motif widgets fixed + - gl.h, glx.h and glu.h name mangling option + - BeOS driver + - 3D texture mapping extension + - GL_MESA_resize_buffers extension + - morph3d, stex3d and spectex demos + - 3Dfx support + Bug fixes: + - glColorMaterial should finally work right in all respects + - linear interpolation of mipmap levels was incorrectly weighted + - readpix.c didn't compile on Macintosh + - GL_INVERT and related logic ops didn't work right + - glTexImage[12]D() didn't check its parameters consistantly + - fixed a memory leak in glTexImage[12]D() + - kludged around a SunOS 5.x/GCC compiler bug in the feedback code + - glReadPixels aborted instead of normally catching some errors + - a few 1.1 constants were missing or misnamed in gl.h + - glBegin(p); glBegin(q); didn't generate an error + - fixed a memory leak in GLX code + - clipping of concave polygons could cause a core dump + - 1-component alpha texture maps didn't work + - fixed a GLU polygon tesselator bug + - polygons with colinear vertices were sometimes culled + - feedback triangle colors were wrong when using smooth shading + - textures with borders didn't work correctly + - colors returned in feedback mode were wrong when using lighting + - spotlights didn't effect ambient lighting correctly + - gluPartialDisk() had a few bugs + Changes: + - device driver interface expanded to support texture mapping + - faster matrix inversion subroutine + - commented out #include "wmesa_extend.h" from src/wmesa.c + - fixed many compiler warnings in the demo programs + +2.3 June 30, 1997 + New: + - Mesa distribution divided into two pieces: library code and demos + - faster vertex transformation, clip testing, lighting + - faster line drawing + - TrueColor visuals how have dithering (for depths < 24 bits) + - added MESA_NO_DITHER environment variable + - new device driver function: NearFar(), RenderVB(), RasterSetup() + - added LynxOS configuration + - added cygnus Win32 configuration + - added texcyl.c GLUT demo + - added XMesaDitherColor() to X/Mesa interface + - new NURBS code from Bogdan Sikorski + - added demos/shape.c (non-rectangular X window!) + Bug fixes: + - glEnable/DisableClientState() were missing from GL/gl.h + - GL_SPHERE_MAP texcoord generation didn't work correctly + - glXGetConfig() returned wrong number of depth, stencil, accum bits + - glDrawPixels feedback/selection didn't examine RasterPos valid bit + - black and white were reversed on some monochrome displays + - fixed potential image memory leak (wasn't setting reference counter) + - glDrawPixels sometimes didn't recognize some GL state changes + - gluProject/UnProject() didn't check for divide by zero + - stex3d demo called random() and srandom(), not portable + - fixed memory leaks in context.c and drawpix.c + - fixed NULL dereferencing problem in gl_update_texture_state() + - glReadPixels between glBegin/glEnd didn't generate an error. + - fixed memory leak in polygon tesselator (Randy Frank) + - fixed seg fault bug drawing flat-shaded, depth-tested lines + - clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded + - glBindTexture sometimes didn't work + - fixed a bug deep in glXReleaseBuffersMESA() + - fog was mistakenly applied to alpha + - glPopMatrix didn't set "dirty matrix" flag + - glPolygonStipple pattern was sometimes wrong + - glClear wasn't disabled during feedback and selection + - fixed memory leak in glTexSubImage[123]D + Changes: + - many library source files reorganized + - faster X color allocation, colors also freed when finished with them + - new texture sampling function pointer in texture objects + - incorporated 3Dfx VooDoo driver v0.16 into main source tree + - many 3Dfx driver updates + - cygnus Makefiles now included + - updated DOS driver + - made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) + - internally, colors now stored in GLubytes, not GLfixed + - optimized changing of GL_SHININESS parameter + +2.4 September 18, 1997 + New: + - updated 3Dfx Glide driver + - hacks for 3Dfx rendering into an X window or fullscreen + - added depth buffer access functions to X/Mesa and OS/Mesa interfaces + Bug fixes: + - pixel buffer could overflow with long, wide lines + - fixed FP underflow problems in lighting + - glTexSubImage1D() had an unitialized variable + - incomplete texture objects could cause a segfault + - glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop + - flat-shaded quads in a strip were miscolored if clipped + - mipmapped triangle lod computation now works correctly + - fixed a few under/overflow bugs in triangle rasterizer + - glArrayElement() assigned bad normal if normal array disabled + - changed argument to glXReleaseBuffersMESA() + - fixed small triangle underflow bugs in tritemp.h (hopefully) + - glBindTexture(target, 0) caused a crash + - glTexImage[123]D() with NULL image pointer caused crash + - glPixelStore parameters are now ignored during display list execution + - fixed a two-sided lighting w/ clipping bug (black vertices) + - textures with width!=height were sometimes mis-rendered + - "weird" projection matrices could cause div by 0, other fp errors + Changes: + - changed precompiled header symbol from PCH to PC_HEADER + - split api.c into api1.c and api2.c + - added hash.c source file (but not used yet) + - a few Sun and HP configuration file changes + - MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN + - fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c) + +2.5 November 20, 1997 + New: + - updated 3Dfx driver (v20) for GLQuake + - added GL_EXT_paletted_texture extension + - added GL_EXT_shared_texture_palette extension + - added GL_EXT_point_parameters extension + - now including Mark Kilgard's GLUT library v3.6 + - new GLUT-based demos in gdemos/ + - added a few more Unix config targets + - added Intel X86 assembly language vertex transformation code + - 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var + - Windows 95 S3 Virge driver + Bug fixes: + - glCopyTexImage?D would crash due to uninitialized variable + - glColor w/ glColorMaterial in a display list caused a bug + - fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver + - glVertex4*() vertices weren't always projected correctly + - trying to use mipmapped textured points or lines caused crash + - glColor[34][fd]() values now clamped to [0,1] before int conversion + Changes: + - new device driver functions for texture mapping + - hash tables used for display list and texture object lookup + - fixed GLX visual handling code to avoid saving redundant visuals + - 3Dfx Glide libraries automatically linked to libMesaGL.so + - dropped the Cirrus Logic Mondello code since it's obsolete + - updated Cygnus Makefiles (Stephane Rehel) + - updated Windows MSVC++ Makefiles (Oleg Letsinsky) + - procedure for making library files has changed: scripts now take + a major and minor version arguments. Make-config changed a lot. + - new implementation of glTexSubImage2D() + - updated widgets-mesa directory to create libMesaGLwM.a (Motif widget) + - separate linux-glide and linux-386-glide configurations + +2.6 February 12, 1998 + New: + - Windows WGL functions + - updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support + - v0.22 of 3Dfx Glide driver + - more X86 assembly language optimizations + - faster blending for some modes + - XMesaSetFXmode() to switch between 3Dfx window and full-screen mode + - added preliminary thread support + - added GLX_MESA_copy_sub_buffer extension + - some clipping optimizations + Bug fixes: + - fixed shading/material bug when drawing long primitive strips + - fixed clipping problem in long primitive strips + - fixed clipping bug when using 3Dfx driver + - fixed a problem when trying to use X fonts w/ 3Dfx driver + - fixed a texture filter bug in 3Dfx/Glide driver + - fixed bug in 3Dfx/Glide driver involving depth mask & clearing + - glLoadMatrix to set projection matrix confused the 3Dfx driver + - non-identity texture matrices didn't work with linux-386 configs + - glGenTextures() didn't reserve the returned texture IDs + - NULL proxy image sent to glTexImageXD() caused crash + - added texture state validation optimization (Henk Kok) + - fixed colormap reuse problem when using both RGB and CI windows + - 32bpp True/DirectColor X visuals weren't recognized + - fixed potential problem in evaluators memory allocation + - fixed assorted demo compilation bugs + Changes: + - replaced old Mesa/windows/ directory with Mesa/WIN32/ directory + - converted a few old glaux/gltk demos to GLUT + - renamed directories: demos -> xdemos, gdemos -> demos + + +3.0 September 17, 1998 + New: + - OpenGL 1.2 API + - GL_EXT_abgr pixel format extension + - GL_SGIS_texture_edge_clamp extension + - GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_rescale_normal extension and renormal.c demo + - GLX_SGI_video_sync extension (a no-op) + - antialiased lines + - glGetTexImage() now implemented + - glDraw/Copy/ReadPixels() optimizations + - optimized textured triangle code (Marten Stromberg) + - more optimization of dithered TrueColor triangles in X driver + - Linux GGI driver + - updated MGL driver + Bug fixes: + - lots of assorted compilation fixes + - glInitNames didn't write initial hit record + - glBitmap didn't always check for invalid raster position + - switching between GLX and OSMesa contexts caused a crash + - fixed uninitialized variable in Mesa widget code + - fixed typo in texture code which caused book/texgen to crash + - fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP + - gluDisk() in POINT or LINE mode sometimes failed + - fixed texture + fog bug + - GL_COMPILE_AND_EXECUTE mode didn't work reliably + - glMultMatrix in projection matrix mode w/ 3Dfx driver could fail + - glDrawPixels(color index pixels) weren't converted to RGBA + - fixed possible getenv() buffer overflow security bug + - glBitmap in feedback mode was offset by xOrig, yOrig params + - device driver's DrawPixels hook was never used + - glDrawPixels with zoomY!=1 and top/bottom clipping didn't work + - glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte + - fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c + - glCopyTexSubImage2D() didn't work with 3Dfx driver + - lines with width = 2 could cause crash + - glClear with scissor rect sometimes cleared whole buffer + - glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work + - glTexImageXD( .. GL_ABGR_EXT .. ) didn't work + - computation of inverse modelview matrix sometimes failed + - fixed GL_CLAMP mode texture sampling bug + - textured line interpolation was somewhat broken + - textured triangle interpolation was also somewhat broken + - glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one + - evaluator state wasn't fully initialized + - texture coordinate clipping was buggy + - evaluator surfaces could be mis-colored + - glAccum(GL_RETURN, s) didn't obey glColorMask() settings + - zero area polygons shouldn't be culled if polygon mode is point/line + - clipped width and height of glReadPixels was sometimes off by one + - blending with alpha = 0 or 1.0 wasn't always exact + - reading of pixels from clipped region was buggy + - minor tweaking of X visual management in GLX emulator + - glPolygonStipple now obeys pixel unpacking parameters + - glGetPolygonStipple now obeys pixel packing parameters + - interleaved vertex array texture coordinates were broken + - query of proxy texture internal format was broken + - alpha channel wasn't reliably cleared + - fixed divide by zero error in gluScaleImage if dest size = 1 x 1 + Conformance bug fixes: + - GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing + - GL_TEXTURE_INTERNAL_FORMAT was missing + - glGet*(GL_POLYGON_STIPPLE) was broken + - glPush/PopAttrib() didn't save/restore all texture state + - glBitmap in feedback mode didn't work + - feedback of texture coords didn't always work + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke + - glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke + Changes: + - upgraded GLUT to version 3.7 + - only GL and GLU library code included in MesaLib.tar.gz + - GLUT and all demos now in MesaDemos.tar.gz + - glaux and gltk libraries removed + - IRIX -n32 and -64 libs go in lib32/ and lib64/ directories + + +3.1 beta 1 November 19, 1998 + New: + - GL_EXT_stencil_wrap extension + - GL_INGR_blend_func_separate extension + - GL_ARB_multitexture extension + - GL_NV_texgen_reflection extension + - newly optimized vertex transformation code + - updated GLUT 3.7 code + - better precision when using 32-bit Z buffer + - Allegro DJGPP driver + Bug fixes: + - glCopyPixels between front/back buffers didn't copy alpha correctly + - fixed out-of-bounds memory access in optimized 2-D texture code + - glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter + - glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter + - clipping of texture coordinates sometimes had bad R,Q values + - GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels + - glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean * + - texture was sometimes applied twice with 3Dfx driver + - glPush/PopAttrib() fouled up texture object reference counts + - glDeleteLists(0, n) caused assertion failure + - bilinear texture sampling wasn't accurate enough + - glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx + - color components were reversed on big endian 32 bpp X visuals + Changes: + - removed GL_EXT_multitexture extension + + +3.1 beta 2 May 24, 1999 + New: + - multi-textured points and lines (mjk@nvidia.com) + - optimized 24bpp X rendering (bernd.paysan@gmx.de) + - added allegro support (bernie-t@geocities.com) + - cleaned-up Windows-related stuff (Ted Jump) + - minor stereo changes (KendallB@scitechsoft.com) + - new BeOS driver which implements BGLView class + - new Direct3D driver (see src/D3D) + - more efficient filled gluCylinder() function + - utilities: util/showbuffer.[ch] and util/glstate.[ch] + - fixed some IRIX compiler warnings + - added support for building Mesa in XFree86 with + SGI's GLX (kevin@precisioninsight.com) + Bug fixes: + - a variety of Windows/Mesa bug fixes (mjk@nvidia.com) + - packed pixel images weren't unpacked correctly + - patches some win32 files in GLUT (mjk@nvidia.com) + - glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX + - fixed lighting bug in Keith's new shading code + - fixed texture segfault seen in Lament screensaver + - fixed miscellaneous low-memory bugs + - glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken + - GL_LINEAR sampling of 3D textures was broken + - fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org) + - added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk) + - fixed wide point and wide line conformance bugs (brianp) + Changes: + - some device driver changes (see src/dd.h) + - new copyright on core Mesa code + + +3.1 beta 3 September 17, 1999 + New: + - optimized glAccum function + - optimized 24bpp rendering in XMesa driver + - GLU 1.2 polygon tessellator + Bug Fixes: + - glGetTexLevelParameter wasn't fully implemented + - glXUseXFont now handles multi-byte fonts + - glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result + - alpha channel of blending points, lines was sometimes incorrect + Changes: + - New library names: "libGL" instead of "libMesaGL" + - New library numbering: libGL.so.1.2.310 + - New subdirectories: docs/ and bin/ + - New Makefile-system (autoconf,automake,libtool) + + +3.1 final December 14, 1999 + New: + - added demos/gloss.c + - added xdemos/glxdpyinfo.c + - added GLX_ARB_get_proc_address extension + - rewritten glTexImage code paths (faster, less memory, bug fixes) + Bug Fixes: + - several vertex array bug fixes + - overlapping glCopyPixels with pixel zooming now works + - glXUseXFont() bitmaps were vertically shifted by one pixel + - glCopyPixels with pixel zooming now works + + +3.2 final April 24, 2000 + Bug fixes: + - fixed memcpy bugs in span.c + - fixed missing glEnd problem in demos/tessdemo.c + - fixed bug when clearing 24bpp Ximages + - fixed clipping problem found in Unreal Tournament + - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2 + - fixed Loki's 3dfx RGB vs BGR bug + - fixed Loki's 3dfx smooth/flat shading bug in SoF + Changes: + - updated docs/README file + - use bcopy() optimizations on FreeBSD + - re-enabled the optimized persp_textured_triangle() function + + +3.2.1 July 19, 2000 + Bug fixes: + - gluBuild2DMipmaps() didn't accept GL_BGRA + - Fixed compile/makefile problems on IRIX + - fixed segfault in 3dfx driver when using GL selection/feedback + - no longer cull very, very tiny triangles + - blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering) + - fixed Motif detection code in widgets-mesa/configure.in + - glColorMaterial and glMaterial updates to emissive and ambient + didn't always work right + - Specular highlights weren't always in the right place + - clipped GL_LINE mode polygons had interior lines appear + - blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken + - GL_NICEST fog didn't always work with flat shading + - glRect commands in display lists were sometimes miscolored + - Line Z offset didn't always work + - fixed texgen normal vector problem (gloss's teapot) + - numerous GL conformance bugs fixed + Changes: + - glColorMask(false, false, false, false) handled better/faster + - reverted to old GLU polygon tessellator, GLU 1.1 + - updated Win32 build files + + +3.3 July 21, 2000 + New: + - antialiased triangles now implemented + - GL_EXT_texture_env_add texture mode extension + - GLX 1.3 API + - support for separate draw/read buffers (ie GL_SGI_make_current_read) + - thread-safe API dispath + - improved glxinfo program + - demos/texdown program to measure texture download performance + - glext.h header file + - demos/geartrain program + - GL_EXT_texture_lod_bias extension + - demos/lodbias program + - further optimized glRead/DrawPixels for 16-bit TrueColor X visuals + - GLX_EXT_visual_rating extension (a no-op, however) + - GL_HP_occlusion_test extension (for X and OS/Mesa drivers) + - demos/occlude program + - GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions + - demos/pixeltex program + - GL_SGI_color_matrix extension + - GL_SGI_color_table extension + - GL_EXT_histogram extension + - GL_ARB_texture_cube_map extension + - added xdemos/glxheads and xdemos/manywin + - demos/texenv.c demo + - GL_EXT_texture_env_combine extension (by Holger Waechtler) + - Xlib driver is now thread-safe (see xdemos/glthreads) + Bug Fixes: + - various GL conformance failures fixed since 3.2.1 + Changes: + - gl.h now uses #defines instead of C enums for all tokens + - glu.h now uses #defines instead of C enums for all tokens + - moved programs from 3Dfx/demos/ into demos/ directory + + +3.4 November 3, 2000 + New: + - optimized glDrawPixels for glPixelZoom(1,-1) + Bug Fixes: + - widgets-mesa/src/*.c files were missing from 3.3 distro + - include/GL/mesa_wgl.h file was missing from 3.3 distro + - fixed some Win32 compile problems + - texture object priorities weren't getting initialized to 1.0 + - glAreTexturesResident return value was wrong when using hardware + - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) + - glReadPixels with GLushort packed types was broken + - fixed a few bugs in the GL_EXT_texture_env_combine texture code + - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables + - fixed some typos/bugs in the VB code + - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work + - optimized glDrawPixels paths weren't being used + - per-fragment fog calculation didn't work without a Z buffer + - improved blending accuracy, fixes Glean blendFunc test failures + - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly + - glXGetProcAddressARB() didn't always return the right address + - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format + - texture matrix changes weren't always detected (GLUT projtex demo) + - fixed random color problem in vertex fog code + - fixed Glide-related bug that let Quake get a 24-bit Z buffer + Changes: + - finished internal support for compressed textures for DRI + + +3.4.1 February 14, 2001 + New: + - fixed some Linux build problems + - fixed some Windows build problems + - GL_EXT_texture_env_dot3 extension (Gareth Hughes) + Bug fixes: + - added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI + - various state-update code changes needed for DRI bugs + - disabled pixel transfer ops in glColorTable commands, not needed + - fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter + - updated sources and fixed compile problems in widgets-mesa/ + - GLX_PBUFFER enum value was wrong in glx.h + - fixed a glColorMaterial lighting bug + - fixed bad args to Read/WriteStencilSpan in h/w stencil clear function + - glXCopySubBufferMESA() Y position was off by one + - Error checking of glTexSubImage3D() was broken (bug 128775) + - glPopAttrib() didn't restore all derived Mesa state correctly + - Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL + conformance problems at 16bpp. + - clearing depth buffer with scissoring was broken, would segfault + - OSMesaGetDepthBuffer() returned bad bytesPerValue value + - fixed a line clipping bug (reported by Craig McDaniel) + - fixed RGB color over/underflow bug for very tiny triangles + Known problems: + - NURBS or evaluator surfaces inside display lists don't always work + + +3.4.2 May 17, 2001 + Bug fixes: + - deleting the currently bound texture could cause bad problems + - using fog could result in random vertex alpha values + - AA triangle rendering could touch pixels outside right window bound + - fixed byteswapping problem in clear_32bit_ximage() function + - fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam + - fixed memory leak in glXUseXFont() + - fragment sampling in AA triangle function was off by 1/2 pixel + - Windows: reading pixels from framebuffer didn't always work + - glConvolutionFilter2D could segfault or cause FP exception + - fixed segfaults in FX and X drivers when using tex unit 1 but not 0 + - GL_NAND logicop didn't work right in RGBA mode + - fixed a memory corruption bug in vertex buffer reset code + - clearing the softwara alpha buffer with scissoring was broken + - fixed a few color index mode fog bugs + - fixed some bad assertions in color index mode + - fixed FX line 'stipple' bug #420091 + - fixed stencil buffer clear width/height typo + - fixed GL error glitches in gl[Client]ActiveTextureARB() + - fixed Windows compilation problem in texutil.c + - fixed 1/8-pixel AA triangle sampling error + Changes: + - optimized writing mono-colored pixel spans to X pixmaps + - increased max viewport size to 2048 x 2048 + + +3.5 June 21, 2001 + New: + - internals of Mesa divided into modular pieces (Keith Whitwell) + - 100% OpenGL 1.2 conformance (passes all conformance tests) + - new AA line algorithm + - GL_EXT_convolution extension + - GL_ARB_imaging subset + - OSMesaCreateContextExt() function + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_MAX_TEXTURE_UNITS_ARB now defaults to eight + - GL_EXT_fog_coord extension (Keith Whitwell) + - GL_EXT_secondary_color extension (Keith Whitwell) + - GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add) + - GL_SGIX_depth_texture extension + - GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions + - demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow + - GL_ARB_texture_env_combine extension + - GL_ARB_texture_env_dot3 extension + - GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp) + - OSMesaCreateContextExt() function + - libOSMesa.so library, contains the OSMesa driver interface + - GL/glxext.h header file for GLX extensions + - somewhat faster software texturing, fogging, depth testing + - all color-index conformance tests now pass (only 8bpp tested) + - SPARC assembly language TCL optimizations (David Miller) + - GL_SGIS_generate_mipmap extension + Bug Fixes: + - fbiRev and tmuRev were unitialized when using Glide3 + - fixed a few color index mode conformance failures; all pass now + - now appling antialiasing coverage to alpha after texturing + - colors weren't getting clamped to [0,1] before color table lookup + - fixed RISC alignment errors caused by COPY_4UBV macro + - drawing wide, flat-shaded lines could cause a segfault + - vertices now snapped to 1/16 pixel to fix rendering of tiny triangles + Changes: + - SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU + - new libOSMesa.so library, contains the OSMesa driver interface + + +4.0 October 22, 2001 + New: + - Mesa 4.0 implements the OpenGL 1.3 specification + - GL_IBM_rasterpos_clip extension + - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp) + - GL_ARB_texture_mirrored_repeat extension + - WindML UGL driver (Stephane Raimbault) + - added OSMESA_MAX_WIDTH/HEIGHT queries + - attempted compiliation fixes for Solaris 5, 7 and 8 + - updated glext.h and glxext.h files + - updated Windows driver (Karl Schultz) + Bug fixes: + - added some missing GLX 1.3 tokens to include/GL/glx.h + - GL_COLOR_MATRIX changes weren't recognized by teximage functions + - glCopyPixels with scale and bias was broken + - glRasterPos with lighting could segfault + - glDeleteTextures could leave a dangling pointer + - Proxy textures for cube maps didn't work + - fixed a number of 16-bit color channel bugs + - fixed a few minor memory leaks + - GLX context sharing was broken in 3.5 + - fixed state-update bugs in glPopClientAttrib() + - fixed glDrawRangeElements() bug + - fixed a glPush/PopAttrib() bug related to texture binding + - flat-shaded, textured lines were broken + - fixed a dangling pointer problem in the XMesa code (Chris Burghart) + - lighting didn't always produce the correct alpha value + - fixed 3DNow! code to not read past end of arrays (Andrew Lewycky) + + +4.0.1 December 17, 2001 + New: + - better sub-pixel sample positions for AA triangles (Ray Tice) + - slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO) + Bug fixes: + - added missing break statements in glGet*() for multisample cases + - fixed uninitialized hash table mutex bug (display lists / texobjs) + - fixed bad teximage error check conditional (bug 476846) + - fixed demos readtex.c compilation problem on Windows (Karl Schultz) + - added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT + - silence some compiler warnings (gcc 2.96) + - enable the #define GL_VERSION_1_3 in GL/gl.h + - added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h + - fixed glu.h typedef problem found with MSDev 6.0 + - build libGL.so with -Bsymbolic (fixes bug found with Chromium) + - added missing 'const' to glXGetContextIDEXT() in glxext.h + - fixed a few glXGetProcAddress() errors (texture compression, etc) + - fixed start index bug in compiled vertex arrays (Keith) + - fixed compilation problems in src/SPARC/glapi_sparc.S + - fixed triangle strip "parity" bug found in VTK medical1 demo (Keith) + - use glXGetProcAddressARB in GLUT to avoid extension linking problems + - provoking vertex of flat-shaded, color-index triangles was wrong + - fixed a few display list bugs (GLUT walker, molecule, etc) (Keith) + - glTexParameter didn't flush the vertex buffer (Ray Tice) + - feedback attributes for glDraw/CopyPixels and glBitmap were wrong + - fixed bug in normal length caching (ParaView lighting bug) + - fixed separate_specular color bug found in Chimera (18 Dec 2001) + + +4.0.2 April 2, 2002 + New: + - New DOS (DJGPP) driver written by Daniel Borca + - New driver interface functions for TCL drivers (such as Radeon DRI) + - GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32" + if using deep color channels + - latest GL/glext.h and GL/glxext.h headers from SGI + Bug fixes: + - GL_BLEND with non-black texture env color wasn't always correct + - GL_REPLACE with GL_RGB texture format wasn't always correct (alpha) + - glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken + - glReadPixels was sometimes mistakenly clipped by the scissor box + - glDraw/ReadPixels didn't catch all the errors that they should have + - Fixed 24bpp rendering problem in Windows driver (Karl Schultz) + - 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c) + - Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP) + - glColorMask as sometimes effecting glXSwapBuffers() + - fixed a potential bug in XMesaGarbageCollect() + - N threads rendering into one window didn't work reliably + - glCopyPixels didn't work for deep color channels + - improved 8 -> 16bit/channel texture image conversion (Gerk Huisma) + - glPopAttrib() didn't correctly restore user clip planes + - user clip planes failed for some perspective projections (Chromium) + Known bugs: + - mipmap LOD computation + + +4.0.3 June 25, 2002 + New: + - updated GL/glext.h file (version 15) + - corrected MMX blend code (Jose Fonseca) + - support for software-based alpha planes in Windows driver + - updated GGI driver (Filip Spacek) + Bug fixes: + - glext.h had wrong values for GL_DOT3_RGB[A]_EXT tokens + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed lighting bug with non-uniform scaling and display lists + - fixed bug when deleting shared display lists + - disabled SPARC cliptest assembly code (Mesa bug 544665) + - fixed a couple Solaris compilation/link problems + - blending clipped glDrawPixels didn't always work + - glGetTexImage() didn't accept packed pixel types + - glPixelMapu[is]v() could explode given too large of pixelmap + - glGetTexParameter[if]v() didn't accept GL_TEXTURE_MAX_ANISOTROPY_EXT + - glXCopyContext() could lead to segfaults + - glCullFace(GL_FRONT_AND_BACK) didn't work (bug 572665) + Changes: + - lots of C++ (g++) code clean-ups + - lots of T&L updates for the Radeon DRI driver + Known bugs: + - mipmap LOD computation (fixed for Mesa 4.1) + + +4.0.4 October 3, 2002 + New: + - GL_NV_texture_rectangle extension + - updated glext.h header (version 17) + - updated DOS driver (Daniel Borca) + - updated BeOS R5 driver (Philippe Houdoin) + - added GL_IBM_texture_mirror_repeat + - glxinfo now takes -l option to print interesting OpenGL limits info + - GL_MESA_ycbcr_texture extension + - GL_APPLE_client_storage extension (for some DRI drivers only) + - GL_MESA_pack_invert extension + Bug fixes: + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx MESA_GLX_FX=window (render to window) didn't work + - fixed memory leak in wglCreateContest (Karl Schultz) + - define GLAPIENTRY and GLAPI if undefined in glu.h + - wglGetProcAddress didn't handle all API functions + - when testing for OpenGL 1.2 vs 1.3, check for GL_ARB_texture_cube_map + - removed GL_MAX_CONVOLUTION_WIDTH/HEIGHT from glGetInteger/Float/etc() + - error checking in compressed tex image functions had some glitches + - fixed AIX compile problem in src/config.c + - glGetTexImage was using pixel unpacking instead of packing params + - auto-mipmap generation for cube maps was incorrect + Changes: + - max texture units reduced to six to accomodate texture rectangles + - removed unfinished GL_MESA_sprite_point extension code + + +4.1 October 29, 2002 + New: + - GL_NV_vertex_program extension + - GL_NV_vertex_program1_1 extension + - GL_ARB_window_pos extension + - GL_ARB_depth_texture extension + - GL_ARB_shadow extension + - GL_ARB_shadow_ambient extension + - GL_EXT_shadow_funcs extension + - GL_ARB_point_parameters extension + - GL_ARB_texture_env_crossbar + - GL_NV_point_sprite extension + - GL_NV_texture_rectangle extension + - GL_EXT_multi_draw_arrays extension + - GL_EXT_stencil_two_side extension + - GLX_SGIX_fbconfig and GLX_SGIX_pbuffer extensions + - GL_ATI_texture_mirror_once extension (Ian Romanick) + - massive overhaul/simplification of software rasterizer module, + many contributions from Klaus Niederkrueger + - faster software texturing in some cases (i.e. trilinear filtering) + - new OSMesaGetProcAddress() function + - more blend modes implemented with MMX code (Jose Fonseca) + - added glutGetProcAddress() to GLUT + - added GLUT_FPS env var to compute frames/second in glutSwapBuffers() + - pbinfo and pbdemo PBuffer programs + - glxinfo -v prints transprent pixel info (Gerd Sussner) + Bug fixes: + - better mipmap LOD computation (prevents excessive blurriness) + - OSMesaMakeCurrent() didn't recognize buffer size changes + - assorted conformance fixes for 16-bit/channel rendering + - texcombine alpha subtraction mode was broken + - fixed some blend problems when GLchan==GLfloat (Gerk Huisma) + - clamp colors to [0,inf] in OSMesa if GLchan==GLfloat (Gerk Huisma) + - fixed divide by zero error in NURBS tessellator (Jon Perry) + - fixed GL_LINEAR fog bug by adding clamping + - fixed FP exceptions found using Alpha CPU + - 3dfx/glide driver render-to-window feature was broken + - added missing GLX_TRANSPARENT_RGB token to glx.h + - fixed error checking related to paletted textures + - fixed reference count error in glDeleteTextures (Randy Fayan) + Changes: + - New spec file and Python code to generate some GL dispatch files + - Glide driver defaults to "no" with autoconf/automake + - updated demos/stex3d with new options + + +5.0 November 13, 2002 + New: + - OpenGL 1.4 support (glGetString(GL_VERSION) returns "1.4") + - removed some overlooked debugging code + - glxinfo updated to support GLX_ARB_multisample + - GLUT now support GLX_ARB_multisample + - updated DOS driver (Daniel Borca) + Bug fixes: + - GL_POINT and GL_LINE-mode polygons didn't obey cull state + - fixed potential bug in _mesa_align_malloc/calloc() + - fixed missing triangle bug when running vertex programs + - fixed a few HPUX compilation problems + - FX (Glide) driver didn't compile + - setting GL_TEXTURE_BORDER_COLOR with glTexParameteriv() didn't work + - a few EXT functions, like glGenTexturesEXT, were no-ops + - a few OpenGL 1.4 functions like glFogCoord*, glBlendFuncSeparate, + glMultiDrawArrays and glMultiDrawElements were missing + - glGet*(GL_ACTIVE_STENCIL_FACE_EXT) was broken + - Pentium 4 Mobile was mistakenly identified as having 3DNow! + - fixed one-bit error in point/line fragment Z calculation + - fixed potential segfault in fakeglx code + - fixed color overflow problem in DOT3 texture env mode + + +5.0.1 March 30, 2003 + New: + - DOS driver updates from Daniel Borca + - updated GL/gl_mangle.h file (Bill Hoffman) + Bug fixes: + - auto mipmap generation for cube maps was broken (bug 641363) + - writing/clearing software alpha channels was unreliable + - minor compilation fixes for OS/2 (Evgeny Kotsuba) + - fixed some bad assertions found with shadowtex demo + - fixed error checking bug in glCopyTexSubImage2D (bug 659020) + - glRotate(angle, -x, 0, 0) was incorrect (bug 659677) + - fixed potential segfault in texture object validation (bug 659012) + - fixed some bogus code in _mesa_test_os_sse_exception_support (Linus) + - fix fog stride bug in tnl code for h/w drivers (Michel Danzer) + - fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080) + - glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3 + - fixed compilation problem on Solaris7/x86 (bug 536406) + - fixed prefetch bug in 3DNow! code (Felix Kuhling) + - fixed NeXT build problem (FABSF macro) + - glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811) + - zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964) + - AA line and triangle Z values are now rounded, not truncated + - fixed color interpolation bug when GLchan==GLfloat (bug 694461) + - glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca) + - fixed a minor GL_COLOR_MATERIAL bug + - NV vertex program EXP instruction was broken + - glColorMask misbehaved with X window / pixmap rendering + - fix autoconf/libtool GLU C++ linker problem on Linux (a total hack) + - attempt to fix GGI compilation problem when MesaDemos not present + - NV vertex program ARL-relative fetches didn't work + Changes: + - use glPolygonOffset in gloss demo to avoid z-fighting artifacts + - updated winpos and pointblast demos to use ARB extensions + - disable SPARC normal transformation code (bug 673938) + - GLU fixes for OS/2 (Evgeny Kotsuba) + + +5.0.2 September 5, 2003 + Bug fixes: + - fixed texgen problem causing texcoord's Q to be zero (stex3d) + - default GL_TEXTURE_COMPARE_MODE_ARB was wrong + - GL_CURRENT_MATRIX_NV query was wrong + - GL_CURRENT_MATRIX_STACK_DEPTH_NV query was off by one + - GL_LIST_MODE query wasn't correct + - GL_FOG_COORDINATE_SOURCE_EXT query wasn't supported + - GL_SECONDARY_COLOR_ARRAY_SIZE_EXT query returned wrong value + - blended, wide lines didn't always work correctly (bug 711595) + - glVertexAttrib4svNV w component was always 1 + - fixed bug in GL_IBM_rasterpos_clip (missing return) + - GL_DEPTH_TEXTURE_MODE = GL_ALPHA didn't work correctly + - a few Solaris compilation fixes + - fixed glClear() problem for DRI drivers (non-existant stencil, etc) + - fixed int/REAL mixup in GLU NURBS curve evaluator (Eric Cazeaux) + - fixed delete [] bug in SI GLU (bug 721765) (Diego Santa Cruz) + - glFog() didn't clamp fog colors + - fixed bad float/int conversion for GL_TEXTURE_PRIORITY in the + gl[Get]TexParameteri[v] functions + - fixed invalid memory references in glTexGen functions (bug 781602) + - integer-valued color arrays weren't handled correctly + - glDrawPixels(GL_DEPTH_COMPONENT) with glPixelZoom didn't work + - GL_EXT_texture_lod_bias is part of 1.4, overlooked in 5.0.1 + Changes: + - build GLUT with -fexceptions so C++ apps propogate exceptions + + +5.1 December 17, 2003 + New: + - reorganized directory tree + - GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche) + - GL_ATI_texture_env_combine3 extension (Ian Romanick) + - GL_SGI_texture_color_table extension (Eric Plante) + - GL_NV_fragment_program extension + - GL_NV_light_max_exponent extension + - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle) + - GL_ARB_occlusion_query extension + - GL_ARB_point_sprite extension + - GL_ARB_texture_non_power_of_two extension + - GL_IBM_multimode_draw_arrays extension + - GL_EXT_texture_mirror_clamp extension (Ian Romanick) + - GL_ARB_vertex_buffer_object extension + - new X86 feature detection code (Petr Sebor) + - less memory used for display lists and vertex buffers + - demo of per-pixel lighting with a fragment program (demos/fplight.c) + - new version (18) of glext.h header + - new spriteblast.c demo of GL_ARB_point_sprite + - faster glDrawPixels in X11 driver in some cases (see RELNOTES-5.1) + - faster glCopyPixels in X11 driver in some cases (see RELNOTES-5.1) + Bug fixes: + - really enable OpenGL 1.4 features in DOS driver. + - fixed issues in glDrawPixels and glCopyPixels for very wide images + - glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint + - fixed some texgen bugs reported by Daniel Borca + - fixed wglMakeCurrent(NULL, NULL) bug (#835861) + - fixed glTexSubImage3D z-offset bug (Cedric Gautier) + - fixed RGBA blend enable bug (Ville Syrjala) + - glAccum is supposed to be a no-op in selection/feedback mode + - fixed texgen bug #597589 (John Popplewell) + Changes: + - dropped API trace feature (src/Trace/) + - documentation overhaul. merged with website content. more html. + - glxgears.c demo updated to use GLX swap rate extensions + - glTexImage1/2/3D now allows width/height/depth = 0 + - disable SPARC asm code on Linux (bug 852204) + + +6.0 January 16, 2004 + New: + - full OpenGL 1.5 support + - updated GL/glext.h file to version 21 + Changes: + - changed max framebuffer size to 4Kx4K (MAX_WIDTH/HEIGHT in config.h) + Bug fixes: + - fixed bug in UNCLAMPED_FLOAT_TO_UBYTE macro; solves a color + clamping issue + - updated suno5-gcc configs + - glColor3 functions sometimes resulted in undefined alpha values + - fixed FP divide by zero error seen on VMS with xlockmore, others + - fixed vertex/fragment program debug problem (bug 873011) + - building on AIX with gcc works now + - glDeleteProgramsARB failed for ARB fragment programs (bug 876160) + - glDrawRangeElements tried to modify potentially read-only storage + - updated files for building on Windows + + +6.0.1 April 2, 2004 + New: + - upgraded glext.h to version 22 + - new build targets (Dan Schikore) + - new linux-x86-opteron build target (Heath Feather) + Bug fixes: + - glBindProgramARB didn't update all necessary state + - fixed build problems on OpenBSD + - omit CVS directories from tarballs + - glGetTexImage(GL_COLOR_INDEX) was broken + - fixed an infinite loop in t&l module + - silenced some valgrind warnings about using unitialized memory + - fixed some compilation/link glitches on IRIX (Mike Stephens) + - glBindProgram wasn't getting compiled into display lists + - GLX_FBCONFIG_ID wasn't recognized in glXChooseFBConfig() (bug 888079) + - two-sided lighting and vertex program didn't work (bug 887330) + - stores to program parameter registers in vertex state programs + didn't work. + - fixed glOrtho bug found with gcc 3.2.2 (RH9) + - glXCreateWindow() wasn't fully implemented (bug 890894) + - generic vertex attribute arrays didn't work in display lists + - vertex buffer objects' default usage and access fields were wrong + - glDrawArrays with start!=0 was broken + - fragment program PK2H, UP2H, UP4B and UP4UB instructions were broken + - linux-osmesa16-static config didn't work + - fixed a few color index rendering problems (bug 910687) + - glInterleavedArrays didn't respect GL_CLIENT_ACTIVE_TEXTURE + - OSMesa RGB and BGR modes were broken + - glProgramStringARB mistakenly required a null-terminated string + - fragment program XPD instruction was incorrect + - glGetMaterial() didn't work reliably + - ARB_fragment_program KIL instruction was incorrect + + +6.1 August 18, 2004 + New: + - Revamped Makefile system + - glXUseRotatedXFont() utility (see xdemos/xuserotfont.c) + - internal driver interface changes related to texture object + allocation, vertex/fragment programs, BlendEquationSeparate, etc. + - option to walk triangle edges with double-precision floats + (Justin Novosad of Discreet) (see config.h file) + - support for AUX buffers in software GLX driver + - updated glext.h to version 24 and glxext.h to version 6 + - new MESA_GLX_FORCE_ALPHA and MESA_GLX_DEPTH_BITS env vars + - updated BeOS support (Philippe Houdoin) + Changes: + - fragment fog interpolation is perspective corrected now + - new glTexImage code, much cleaner, may be a bit faster + Bug fixes: + - glArrayElement in display lists didn't handle generic vertex attribs + - glFogCoord didn't always work properly + - ARB_fragment_program fog options didn't work + - frag prog TEX instruction no longer incorrectly divides s,t,r by q + - ARB frag prog TEX and TEXP instructions now use LOD=0 + - glTexEnviv in display lists didn't work + - glRasterPos didn't do texgen or apply texture matrix + - GL_DOUBLE-valued vertex arrays were broken in some cases + - fixed texture rectangle edge/border sampling bugs + - sampling an incomplete texture in a fragment program would segfault + - glTexImage was missing a few error checks + - fixed some minor glGetTexParameter glitches + - GL_INTENSITY was mistakenly accepted as a to glTexImage + - fragment program writes to RC/HC register were broken + - fixed a few glitches in GL_HP_occlusion_test extension + - glBeginQueryARB and glEndQueryARB didn't work inside display lists + - vertex program state references were broken + - fixed triangle color interpolation bug on AIX (Shane Blackett) + - fixed a number of minor memory leaks (bug #1002030) + + +6.2 October 2, 2004 + New: + - enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle) + - updated Doxygen support (Jose Fonseca) + Changes: + - some GGI driver updates (Christoph Egger, bug 1025977) + Bug fixes: + - Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features + - fixed a few compilation issues on IRIX + - fixed a matrix classification bug (reported by Wes Bethel) + - we weren't reseting the vertex/fragment program error state + before parsing (Dave Reveman) + - adjust texcoords for sampling texture rectangles (Dave Reveman) + - glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented + - repeated calls to glDeleteTexture(t) could lead to a crash + - fixed potential ref count bugs in VBOs and vertex/fragment programs + - spriteblast demo didn't handle window size changes correctly + - glTexSubImage didn't handle pixels=NULL correctly for PBOs + - fixed color index mode glDrawPixels bug (Karl Schultz) + + +6.2.1 December 9, 2004 + Bug fixes: + - don't apply regular fog or color sum when using a fragment program + - glProgramEnvParameter4fARB always generated an error on + GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645) + - glVertexAttrib3svNV and glVertexAttrib3svARB were broken + - fixed width/height mix-up in glSeparableFilter2D() + - fixed regression in glCopyPixels + convolution + - glReadPixels from a clipped front color buffer didn't always work + - glTexImage didn't accept GL_RED/GREEN/BLUE as the format + - Attempting queries/accesses of VBO 0 weren't detected as errors + - paletted textures failed if the palette had fewer than 256 entries + Changes: + - fixed a bunch of compiler warnings found with gcc 3.4 + - bug reports should to go bugzilla.freedesktop.org + + +6.3 July 20, 2005 + New: + - GL_EXT_framebuffer_object extension + - GL_ARB_draw_buffers extension + - GL_ARB_pixel_buffer_object extension + - GL_OES_read_format extension (Ian Romanick) + - DirectFB driver (Claudio Ciccani) + - x86_64 vertex transformation code (Mikko T.) + - Updated GL/glext.h to version 29 + Changes: + - added -stereo option for glxgears demo (Jacek Rosik) + - updated the PBuffer demo code in xdemos/ directory + - glDeleteTextures/Programs/Buffers() now makes the object ID + available for immediate re-use + - assorted 64-bit clean-ups fixes (x86_64 and Win64) + - lots of internal changes for GL_EXT_framebuffer_object + Bug fixes: + - some functions didn't support PBO functionality + - glGetTexImage didn't convert color index images to RGBA as required + - fragment program texcoords were sometimes wrong for points and lines + - fixed problem with negative dot product in arbfplight, fplight demos + - fixed bug in perspective correction of antialiased, textured lines + - querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value + - fixed a couple per-pixel fog bugs (Soju Matsumoto) + - glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken + - fixed float parsing bug in ARB frag/vert programs (bug 2520) + - XMesaGetDepthBuffer() returned incorrect value for bytesPerValue + - GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha + - glXChooseFBConfig() crashed if attribList pointer was NULL + - program state.light[n].spot.direction.w was wrong value (bug 3083) + - fragment program fog option required glEnable(GL_FOG) - wrong. + - glColorTable() could produce a Mesa implementation error (bug 3135) + - RasterPos could get corrupted by color index rendering path + - Removed bad XTranslateCoordinates call when rendering to Pixmaps + - glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state + - fixed a few Darwin compilation problems + + +6.3.1 + This was an intermediate release for X.org which wasn't otherwise released. + + +6.3.2 August 19, 2005 + New: + - The distribution now includes the DRI drivers and GLX code + Changes: + - Made the DRI "new" driver interface standard, remove old code + Bug fixes: + - GL_ARB_vertex/fragment_shader were mistakenly listed in the + extensions string + - negative relative addressing in vertex programs was broken + - update/fix SPARC assembly code for vertex transformation + - fixed memory leak when freeing GLX drawables/renderbuffers + - fixed display list memory leak + - the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer + - wglGetProcAddress() didn't handle wgl-functions + - fixed glxext.h cross-compile issue (Colin Harrison) + - assorted DRI driver fixes + + +6.4 October 24, 2005 + New: + - Added a fast XOR line drawing function in Xlib driver + - Added support for GL_ARB_texture_mirrored_repeat to savage + driver (supported only on Savage4 hardware). + Changes: + - Mesa now packaged in three parts: Library, Demos and GLUT + Bug fixes: + - GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig + - Some files were present multiple times in the 6.3.2 tarballs + - r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) + - glxgears_fbconfig demo didn't work (bug 4237) + - fixed bug when bilinear sampling 2d textures with borders + - glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) + - fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) + - fixed a few problems with proxy color tables (bug 4270) + - fixed precision problem in Z clearing (bug 4395) + - glBitmap, glDraw/CopyPixels mistakenly generated selection hits + - fixed potential segfault caused by reading pixels outside + of renderbuffer bounds + - glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB + - fixed memory corruption bug involving software alpha buffers + - glReadPixels clipped by window bounds was sometimes broken + - glDraw/CopyPixels of stencil data ignored the stencil write mask + - glReadPixels from a texture bound to a framebuffer object didn't work + - glIsRender/FramebufferEXT weren't totally correct + - fixed a number of point size attenuation/fade bugs + - fixed glFogCoord bug 4729 + - GLX encoding for transpose matrix functions was broken + - fixed broken fragment program KIL and SWZ instructions + - fragment programs that wrote result.depth.z didn't work + + +6.4.1 November 30, 2005 + Bug fixes: + - redefining a vertex program string didn't take effect in TNL module + - fixed occasional segfault upon vertex/fragment parsing error + - vertex program LIT instruction didn't handle 0^0=1 correctly + - fragment program fog option didn't work with glDrawPixels, glBitmap + - USE_MGL_NAMESPACE didn't work for x86-64 + - OSMesa demos were missing from previous release tarballs + - fixed problem with float->ushort conversion in glClear (bug 4992) + - popping of GL_EYE_PLANE texgen state was broken (bug 4996) + - popping of GL_SPOT_DIRECTION light state was broken (bug 5005) + - fixed occasional triangle color interpolation problem on VMS + - work around invalid free() call (bug 5131) + - fixed BSD X server compilation problem by including stdint.h + + +6.4.2 February 2, 2006 + New: + - added OSMesaColorClamp() function/feature + - added wglGetExtensionStringARB() function + Bug fixes: + - fixed some problems when building on Windows + - GLw header files weren't installed by installmesa script (bug 5396) + - GL/glfbdev.h file was missing from tarballs + - fixed TNL initialization bug which could lead to crash (bug 5791) + + +6.5 March 31, 2006 + New: + - OpenGL Shading Language support through GL_ARB_shader_objects, + GL_ARB_shading_language_100, GL_ARB_vertex_shader and + GL_ARB_fragment_shader (done by Michal Krol) + - GL_EXT_packed_depth_stencil extension + - GL_EXT_timer_query extension + - GL_EXT_framebuffer_blit extension + - GL_ARB_half_float_pixel + - reflect demo improved to support multiple windows + - singlebuffer demo (shows no/little-flicker single-buffered rendering) + - r200: enable GL_ARB_texture_env_crossbar, separate the texture + sampling unit bits from the texture env combine enable bits + - r200: add support for GL_ATI_fragment_shader + - added fast XOR-mode line drawing optimization + - radeon: add support for all 3 tmus, GL_ARB_texture_cube_map + and GL_EXT_fog_coord + - MESA_GLX_ALPHA_BITS env var for xlib driver + - many DRI driver updates (including screen rotation support + for the Intel DRI driver) + Changes: + - removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead) + - removed GL_SGIX/SGIS_pixel_texture extensions + Bug fixes: + - fixed glxcontextmodes.c datatype problem (bug 5835) + - fixed aix-gcc build/install bugs (bug 5874) + - fixed some bugs in texture env program generation + - glXCopyContext() didn't handle texture object bindings properly + - glXCopyContext() didn't copy all lighting state + - fixed FreeBSD config (Pedro Giffuni) + - fixed some minor framebuffer object bugs + - replaced dprintf() with _glu_printf() in GLU (bug 6244) + - fixed a number of thread safety bugs/regressions + - fixed a number of GLU tesselator bugs (John Shell, bug 6339) + - paletted texturing was broken w/ floating point palettes (K. Schultz) + - lots of assorted framebuffer object bug fixes + +6.5.1 August 31, 2006 + New: + - Intel i965 DRI driver + - GL_APPLE_vertex_array_object extension (Ian Romanick) + - GL_EXT_texture_sRGB extension + - GL_EXT_gpu_program_parameters (Ian Romanick) + - "engine" demo + - updated fbdev driver and GLUT for fbdev (Sean D'Epagnier) + - many updates to the DRI drivers + Changes: + - The glVertexAttribARB functions no longer alias the conventional + vertex attributes. + - glxinfo program prints more info with -l option + - GL_FRAGMENT_PROGRAM_NV and GL_FRAGMENT_PROGRAM_ARB are now + compatible, in terms of glBindProgramARB() + Bug fixes: + - fixed broken texture border handling for depth textures (bug 6498) + - removed the test for duplicated framebuffer attachments, per + version 117 of the GL_EXT_framebuffer_object specification + - fixed a few render-to-texture bugs, including render to depth texture + - clipping of lines against user-defined clip planes was broken (6512) + - assembly language dispatch for SPARC was broken (bug 6484) + - assorted compilation fixes on various Unix platforms (Dan Schikore) + - glPopAttrib could restore an invalid value for GL_DRAW_BUFFER + - assorted minor fixes for 16 and 32 bit/channel modes + - fixed assorted bugs in texture compression paths + - fixed indirect rendering vertex array crashes (bug 6863) + - glDrawPixels GL_INDEX_OFFSET didn't always work + - fixed convolution memory leak (bug 7077) + - rectangular depth textures didn't work + - invalid mode to glBegin didn't generate an error (bug 7142) + - 'normalized' parameter to glVertexAttribPointerARB didn't work + - disable bogus GLX_SGI_video_sync extension in xlib driver + - fixed R128 driver locking bug (Martijn van Oosterhout) + - using evaluators with vertex programs caused crashes (bug 7564) + - fragment.position wasn't set correctly for point/line primitives + - fixed parser bug for scalar sources for GL_NV_fragment_program + - max fragment program length was incorrectly 128, now 1024 + - writes to result.depth in fragment programs weren't clamped to [0,1] + - fixed potential dangling pointer bug in glBindProgram() + - fixed some memory leaks (and potential crashes) in Xlib driver --- mesa-7.9~git20100924.orig/docs/enums.txt +++ mesa-7.9~git20100924/docs/enums.txt @@ -0,0 +1,57 @@ + +See the OpenGL ARB enum registry at http://www.opengl.org/registry/api/enum.spec + +Blocks allocated to Mesa: + 0x8750-0x875F + 0x8BB0-0x8BBF + + +GL_MESA_packed_depth_stencil + GL_DEPTH_STENCIL_MESA 0x8750 + GL_UNSIGNED_INT_24_8_MESA 0x8751 + GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 + GL_UNSIGNED_SHORT_15_1_MESA 0x8753 + GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +GL_MESA_trace.spec: + GL_TRACE_ALL_BITS_MESA 0xFFFF + GL_TRACE_OPERATIONS_BIT_MESA 0x0001 + GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 + GL_TRACE_ARRAYS_BIT_MESA 0x0004 + GL_TRACE_TEXTURES_BIT_MESA 0x0008 + GL_TRACE_PIXELS_BIT_MESA 0x0010 + GL_TRACE_ERRORS_BIT_MESA 0x0020 + GL_TRACE_MASK_MESA 0x8755 + GL_TRACE_NAME_MESA 0x8756 + +MESA_ycbcr_texture.spec: + GL_YCBCR_MESA 0x8757 + GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple's */ + GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple's */ + +GL_MESA_pack_invert.spec + GL_PACK_INVERT_MESA 0x8758 + +GL_MESA_shader_debug.spec: (obsolete) + GL_DEBUG_OBJECT_MESA 0x8759 + GL_DEBUG_PRINT_MESA 0x875A + GL_DEBUG_ASSERT_MESA 0x875B + +GL_MESA_program_debug.spec: (obsolete) + GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_MESA 0x???? + GL_FRAGMENT_PROGRAM_POSITION_MESA 0x???? + GL_VERTEX_PROGRAM_POSITION_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x???? + GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x???? + +GL_MESAX_texture_stack: + GL_TEXTURE_1D_STACK_MESAX 0x8759 + GL_TEXTURE_2D_STACK_MESAX 0x875A + GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B + GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C + GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D + GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +